From patchwork Fri Mar 9 17:49:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Padovan X-Patchwork-Id: 10271485 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 CE2726016D for ; Fri, 9 Mar 2018 17:52:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BC192286F3 for ; Fri, 9 Mar 2018 17:52:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B0D6E298C3; Fri, 9 Mar 2018 17:52:55 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 49A7A286F3 for ; Fri, 9 Mar 2018 17:52:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932499AbeCIRtr (ORCPT ); Fri, 9 Mar 2018 12:49:47 -0500 Received: from mail-qt0-f196.google.com ([209.85.216.196]:46055 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932342AbeCIRtp (ORCPT ); Fri, 9 Mar 2018 12:49:45 -0500 Received: by mail-qt0-f196.google.com with SMTP id v90so11607067qte.12; Fri, 09 Mar 2018 09:49:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=AbZORU/xmPi2XLGQ8TgQSS6tDboO8dWO6oe/bQYgj2M=; b=bUutvEKhKlJunhiJIZCrYnD1Sydmt52Qz6urU+UDS1CT1aVDdCScwcmwt9BQwiJ+Sx KDU7ckLBuhOo1NGIpIIGG97q3VpwNwbcAyrfpJ/vjEgCKaAymC9eWy1OwixBu7DbWX93 /THSqRY71oCdUuZBLyg2AwhfdYchh9D/HkBaIdt4UfMJ5iomhFABA0UhZ6P0KYx7clCq gKDjohcj8FNjjDTTODhGzSjlzQtmZAPZuh6J5rI4ZBDaokzD+U0GoCXJzxe1Vkzxjbdv dfuvKIDY7DKchlyye7UxlEM/9fU3p2A4Sb8R43aRex3ADAn+JbDpIsZnSn/RhOKsZMD4 1TMA== X-Gm-Message-State: AElRT7EGbWXNlS0BHXFOIp6nt3rNypnQJs8/JypReDxl5S0CPKHi17vm K6pPDw0a4NppWCUGfxUUBKXKx4zV X-Google-Smtp-Source: AG47ELsqlUkGckamVrNhiPyZn+rCQA/vY4F6yfIvFg0cJyfHk5SZUOrZajNWX5LDRj61wUixxCOodQ== X-Received: by 10.237.37.161 with SMTP id x30mr46006019qtc.78.1520617784043; Fri, 09 Mar 2018 09:49:44 -0800 (PST) Received: from localhost.localdomain ([2804:14c:138:2ada:4961:b672:c997:efad]) by smtp.gmail.com with ESMTPSA id g4sm873976qke.91.2018.03.09.09.49.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 09 Mar 2018 09:49:43 -0800 (PST) From: Gustavo Padovan 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 Subject: [PATCH v8 02/13] [media] hackrf: group device capabilities Date: Fri, 9 Mar 2018 14:49:09 -0300 Message-Id: <20180309174920.22373-3-gustavo@padovan.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180309174920.22373-1-gustavo@padovan.org> References: <20180309174920.22373-1-gustavo@padovan.org> 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));