From patchwork Fri Jun 27 14:15:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 4435671 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 73206BEEAA for ; Fri, 27 Jun 2014 14:16:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 58DAD201D3 for ; Fri, 27 Jun 2014 14:16:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 666062026F for ; Fri, 27 Jun 2014 14:16:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753415AbaF0OP5 (ORCPT ); Fri, 27 Jun 2014 10:15:57 -0400 Received: from smtp-vbr1.xs4all.nl ([194.109.24.21]:1552 "EHLO smtp-vbr1.xs4all.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753907AbaF0OP4 (ORCPT ); Fri, 27 Jun 2014 10:15:56 -0400 Received: from tschai.lan (209.80-203-20.nextgentel.com [80.203.20.209]) (authenticated bits=0) by smtp-vbr1.xs4all.nl (8.13.8/8.13.8) with ESMTP id s5REFikD051485; Fri, 27 Jun 2014 16:15:47 +0200 (CEST) (envelope-from hverkuil@xs4all.nl) Received: from durdane.cisco.com (173-38-208-170.cisco.com [173.38.208.170]) by tschai.lan (Postfix) with ESMTPSA id 7370F2A1FCF; Fri, 27 Jun 2014 16:15:38 +0200 (CEST) From: Hans Verkuil To: linux-media@vger.kernel.org Cc: it@sca-uk.com, =stoth@kernellabs.com, Hans Verkuil Subject: [PATCH 1/2] cx23885: fix UNSET/TUNER_ABSENT confusion. Date: Fri, 27 Jun 2014 16:15:41 +0200 Message-Id: <1403878542-1230-2-git-send-email-hverkuil@xs4all.nl> X-Mailer: git-send-email 2.0.0 In-Reply-To: <1403878542-1230-1-git-send-email-hverkuil@xs4all.nl> References: <1403878542-1230-1-git-send-email-hverkuil@xs4all.nl> X-Virus-Scanned: by XS4ALL Virus Scanner Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Hans Verkuil Sometimes dev->tuner_type is compared to UNSET, sometimes to TUNER_ABSENT, but these defines have different values. Standardize to TUNER_ABSENT. Signed-off-by: Hans Verkuil --- drivers/media/pci/cx23885/cx23885-417.c | 8 ++++---- drivers/media/pci/cx23885/cx23885-video.c | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/media/pci/cx23885/cx23885-417.c b/drivers/media/pci/cx23885/cx23885-417.c index 95666ee..bf89fc8 100644 --- a/drivers/media/pci/cx23885/cx23885-417.c +++ b/drivers/media/pci/cx23885/cx23885-417.c @@ -1266,7 +1266,7 @@ static int vidioc_g_tuner(struct file *file, void *priv, struct cx23885_fh *fh = file->private_data; struct cx23885_dev *dev = fh->dev; - if (UNSET == dev->tuner_type) + if (dev->tuner_type == TUNER_ABSENT) return -EINVAL; if (0 != t->index) return -EINVAL; @@ -1284,7 +1284,7 @@ static int vidioc_s_tuner(struct file *file, void *priv, struct cx23885_fh *fh = file->private_data; struct cx23885_dev *dev = fh->dev; - if (UNSET == dev->tuner_type) + if (dev->tuner_type == TUNER_ABSENT) return -EINVAL; /* Update the A/V core */ @@ -1299,7 +1299,7 @@ static int vidioc_g_frequency(struct file *file, void *priv, struct cx23885_fh *fh = file->private_data; struct cx23885_dev *dev = fh->dev; - if (UNSET == dev->tuner_type) + if (dev->tuner_type == TUNER_ABSENT) return -EINVAL; f->type = V4L2_TUNER_ANALOG_TV; f->frequency = dev->freq; @@ -1347,7 +1347,7 @@ static int vidioc_querycap(struct file *file, void *priv, V4L2_CAP_READWRITE | V4L2_CAP_STREAMING | 0; - if (UNSET != dev->tuner_type) + if (dev->tuner_type != TUNER_ABSENT) cap->capabilities |= V4L2_CAP_TUNER; return 0; diff --git a/drivers/media/pci/cx23885/cx23885-video.c b/drivers/media/pci/cx23885/cx23885-video.c index e0a5952..2a890e9 100644 --- a/drivers/media/pci/cx23885/cx23885-video.c +++ b/drivers/media/pci/cx23885/cx23885-video.c @@ -1156,7 +1156,7 @@ static int vidioc_querycap(struct file *file, void *priv, V4L2_CAP_READWRITE | V4L2_CAP_STREAMING | V4L2_CAP_VBI_CAPTURE; - if (UNSET != dev->tuner_type) + if (dev->tuner_type != TUNER_ABSENT) cap->capabilities |= V4L2_CAP_TUNER; return 0; } @@ -1474,7 +1474,7 @@ static int vidioc_g_tuner(struct file *file, void *priv, { struct cx23885_dev *dev = ((struct cx23885_fh *)priv)->dev; - if (unlikely(UNSET == dev->tuner_type)) + if (dev->tuner_type == TUNER_ABSENT) return -EINVAL; if (0 != t->index) return -EINVAL; @@ -1490,7 +1490,7 @@ static int vidioc_s_tuner(struct file *file, void *priv, { struct cx23885_dev *dev = ((struct cx23885_fh *)priv)->dev; - if (UNSET == dev->tuner_type) + if (dev->tuner_type == TUNER_ABSENT) return -EINVAL; if (0 != t->index) return -EINVAL; @@ -1506,7 +1506,7 @@ static int vidioc_g_frequency(struct file *file, void *priv, struct cx23885_fh *fh = priv; struct cx23885_dev *dev = fh->dev; - if (unlikely(UNSET == dev->tuner_type)) + if (dev->tuner_type == TUNER_ABSENT) return -EINVAL; /* f->type = fh->radio ? V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV; */ @@ -1522,7 +1522,7 @@ static int cx23885_set_freq(struct cx23885_dev *dev, const struct v4l2_frequency { struct v4l2_control ctrl; - if (unlikely(UNSET == dev->tuner_type)) + if (dev->tuner_type == TUNER_ABSENT) return -EINVAL; if (unlikely(f->tuner != 0)) return -EINVAL;