From patchwork Fri May 4 20:05:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ezequiel Garcia X-Patchwork-Id: 10381629 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E16F46037D for ; Fri, 4 May 2018 20:12:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CEDCF29450 for ; Fri, 4 May 2018 20:12:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C3993295A4; Fri, 4 May 2018 20:12:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 84FEE29450 for ; Fri, 4 May 2018 20:12:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751871AbeEDUHx (ORCPT ); Fri, 4 May 2018 16:07:53 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:53982 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751756AbeEDUHr (ORCPT ); Fri, 4 May 2018 16:07:47 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: ezequiel) with ESMTPSA id 33937286553 From: Ezequiel Garcia To: linux-media@vger.kernel.org Cc: kernel@collabora.com, Hans Verkuil , Mauro Carvalho Chehab , Shuah Khan , Pawel Osciak , Alexandre Courbot , Sakari Ailus , Brian Starkey , linux-kernel@vger.kernel.org, Gustavo Padovan , Ezequiel Garcia Subject: [PATCH v9 02/15] hackrf: group device capabilities Date: Fri, 4 May 2018 17:05:59 -0300 Message-Id: <20180504200612.8763-3-ezequiel@collabora.com> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180504200612.8763-1-ezequiel@collabora.com> References: <20180504200612.8763-1-ezequiel@collabora.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Gustavo Padovan Instead of putting V4L2_CAP_STREAMING and V4L2_CAP_READWRITE everywhere, set device_caps earlier with these values. Signed-off-by: Gustavo Padovan --- drivers/media/usb/hackrf/hackrf.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/media/usb/hackrf/hackrf.c b/drivers/media/usb/hackrf/hackrf.c index 7eb53517a82f..6d692fb3e8dd 100644 --- a/drivers/media/usb/hackrf/hackrf.c +++ b/drivers/media/usb/hackrf/hackrf.c @@ -909,18 +909,15 @@ static int hackrf_querycap(struct file *file, void *fh, dev_dbg(&intf->dev, "\n"); + cap->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_READWRITE; if (vdev->vfl_dir == VFL_DIR_RX) - cap->device_caps = V4L2_CAP_SDR_CAPTURE | V4L2_CAP_TUNER | - V4L2_CAP_STREAMING | V4L2_CAP_READWRITE; - + cap->device_caps |= V4L2_CAP_SDR_CAPTURE | V4L2_CAP_TUNER; else - cap->device_caps = V4L2_CAP_SDR_OUTPUT | V4L2_CAP_MODULATOR | - V4L2_CAP_STREAMING | V4L2_CAP_READWRITE; + cap->device_caps |= V4L2_CAP_SDR_OUTPUT | V4L2_CAP_MODULATOR; cap->capabilities = V4L2_CAP_SDR_CAPTURE | V4L2_CAP_TUNER | V4L2_CAP_SDR_OUTPUT | V4L2_CAP_MODULATOR | - V4L2_CAP_STREAMING | V4L2_CAP_READWRITE | - V4L2_CAP_DEVICE_CAPS; + V4L2_CAP_DEVICE_CAPS | cap->device_caps; strlcpy(cap->driver, KBUILD_MODNAME, sizeof(cap->driver)); strlcpy(cap->card, dev->rx_vdev.name, sizeof(cap->card)); usb_make_path(dev->udev, cap->bus_info, sizeof(cap->bus_info));