Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp5585950pxb; Mon, 28 Mar 2022 14:35:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwcOJWLaVBUU2XXcKvE4eQOGE+SHYNqW7kLbQGwqcCH3BkoYtDdobWnMVaua8yyKvK1DqnF X-Received: by 2002:a1f:b658:0:b0:33e:f2db:a41e with SMTP id g85-20020a1fb658000000b0033ef2dba41emr13625175vkf.15.1648503308727; Mon, 28 Mar 2022 14:35:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648503308; cv=none; d=google.com; s=arc-20160816; b=D+3Kha1ASpwkvHHRbmHBR6RVasC5Xb/LKX2dZvP5sJ52oZXzmW3hxhO/v/Cb7r1NMe HzzLY4T1ROr34ANouX4f1B9nLp1q8DiTqzk3dj6yu3cF9pjVAJkB8EDI3CWCkjjFSfj6 mZtlsM7Fa6Zpa+VNsxYlM4DkdJxDz3GUVohZI1lDkYlGNANMcixYqBzhO0J/GaMKLUjG NAGd+CXQZfTJVApyrjq3Q9bricd6aKQ41yQbK1Q+Pcj4PGnF6ZogBiHnk6vnrmviaNc/ NQfH2z2/+o5QwJK0655vbkrN7f29iLl+jzDyss24CBVP7d0VYwpyazrC/G3EzDuWVyEy 9LcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:from :dkim-signature; bh=uCGxfV2Dfr+2+rzb4ttYCI8faZlTbFjknBiew6el/+A=; b=WgctLgqN6nLKDBS5HTwzZVXk72X2uNekwHwcJ4138cAh3juISBfPbZir8lzeZ04rd8 2qqc2W5A1mihusfX9Qf4cQ5fhKAHWkNECxqvRO4rBJePqaypTlXffS/pZNul8WfbqRK/ 8o9UpqU/djFD/UdRz+R10x+rB1dUOnRdOLqmMc1IN4G0X77S04nejdhneO/CctR8Zw2m ikWc71LlIN/4zAtClVxU/P4xk1OBI17LjT4SQot9ArKvpZDq0cl4V5JRyHVgvBPbCPlg 1pjI92EEVoJQ5LdifHlk692I863nUSCv0NPrpXDj41HgIAPDXbIqDRI/E8tdEiEsZUeB Lvcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=kNkL3JFe; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id v9-20020a67c889000000b00324c5c3be62si3097065vsk.164.2022.03.28.14.35.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Mar 2022 14:35:08 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=kNkL3JFe; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EBC3B888F9; Mon, 28 Mar 2022 14:13:47 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345602AbiC1Uqu (ORCPT + 99 others); Mon, 28 Mar 2022 16:46:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345700AbiC1Un2 (ORCPT ); Mon, 28 Mar 2022 16:43:28 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D24566ADF; Mon, 28 Mar 2022 13:41:47 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D845DB81227; Mon, 28 Mar 2022 20:41:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2DB5AC341C5; Mon, 28 Mar 2022 20:41:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648500103; bh=QiSpOx/mpTl3wUFgHzQUrea+xGFIrXTGCEAo0MWpF4c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kNkL3JFe4zb55JL91uziKYv6uLQnt0CAC90hNvzRsN4kxl02M2PbdfdEWgNmGL7X+ dB7KqMIRYs+eTf4+hc4Z6MmxyVLd++GV3YkThzBe49a0cG+7r860fdKEHu1YopLUgF Ip5qvi+dC7N/5j34Se9qtHEksd6ZcWU+tfNYcgXGBkPpxZgbvOsNqWeSdPElJRuKQG 2eZKStiqXpMIMKNZU876NPsTet/52DkAyMWykPXeV7vuJ5LTuiFXPNlkxKM+9Iu9uX nRYlHgeqcOY19JR35iSjq9laNYrb6gJYeoimXoyjslplPYDvTVa9icpmJuaAxp5Q5K a3NjW1dpBSIJg== Received: from mchehab by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1nYwBI-000lcy-PN; Mon, 28 Mar 2022 22:41:40 +0200 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH 18/26] media: dvb-usb: pctv452e: use an enum for the device number Date: Mon, 28 Mar 2022 22:41:30 +0200 Message-Id: <283a8c6bdf9778f832b4f6acc104c06688281668.1648499509.git.mchehab@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The device number is currently a value that needs to be the same on two separate tables, but the code doesn't actually enforce it, leading to errors as boards get added or removed. Fix it by using an enum. Signed-off-by: Mauro Carvalho Chehab --- To avoid mailbombing on a large number of people, only mailing lists were C/C on the cover. See [PATCH 00/26] at: https://lore.kernel.org/all/cover.1648499509.git.mchehab@kernel.org/ drivers/media/usb/dvb-usb/pctv452e.c | 22 ++++++++++++++-------- include/media/dvb-usb-ids.h | 2 +- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/drivers/media/usb/dvb-usb/pctv452e.c b/drivers/media/usb/dvb-usb/pctv452e.c index 9b78b40abc6d..f0794c68c622 100644 --- a/drivers/media/usb/dvb-usb/pctv452e.c +++ b/drivers/media/usb/dvb-usb/pctv452e.c @@ -951,13 +951,19 @@ static int pctv452e_tuner_attach(struct dvb_usb_adapter *a) return 0; } +enum { + PINNACLE_PCTV_452E, + TECHNOTREND_CONNECT_S2_3600, + TECHNOTREND_CONNECT_S2_3650_CI, +}; + static struct usb_device_id pctv452e_usb_table[] = { - {USB_DEVICE(USB_VID_PINNACLE, USB_PID_PCTV_452E)}, - {USB_DEVICE(USB_VID_TECHNOTREND, USB_PID_TECHNOTREND_CONNECT_S2_3600)}, - {USB_DEVICE(USB_VID_TECHNOTREND, - USB_PID_TECHNOTREND_CONNECT_S2_3650_CI)}, - {} + DVB_USB_DEV(PINNACLE, PINNACLE_PCTV_452E), + DVB_USB_DEV(TECHNOTREND, TECHNOTREND_CONNECT_S2_3600), + DVB_USB_DEV(TECHNOTREND, TECHNOTREND_CONNECT_S2_3650_CI), + { } }; + MODULE_DEVICE_TABLE(usb, pctv452e_usb_table); static struct dvb_usb_device_properties pctv452e_properties = { @@ -1006,7 +1012,7 @@ static struct dvb_usb_device_properties pctv452e_properties = { .devices = { { .name = "PCTV HDTV USB", .cold_ids = { NULL, NULL }, /* this is a warm only device */ - .warm_ids = { &pctv452e_usb_table[0], NULL } + .warm_ids = { &pctv452e_usb_table[PINNACLE_PCTV_452E], NULL } }, { NULL }, } @@ -1060,11 +1066,11 @@ static struct dvb_usb_device_properties tt_connect_s2_3600_properties = { .devices = { { .name = "Technotrend TT Connect S2-3600", .cold_ids = { NULL, NULL }, /* this is a warm only device */ - .warm_ids = { &pctv452e_usb_table[1], NULL } + .warm_ids = { &pctv452e_usb_table[TECHNOTREND_CONNECT_S2_3600], NULL } }, { .name = "Technotrend TT Connect S2-3650-CI", .cold_ids = { NULL, NULL }, - .warm_ids = { &pctv452e_usb_table[2], NULL } + .warm_ids = { &pctv452e_usb_table[TECHNOTREND_CONNECT_S2_3650_CI], NULL } }, { NULL }, } diff --git a/include/media/dvb-usb-ids.h b/include/media/dvb-usb-ids.h index 6aa15988b577..ed6e37f23cbc 100644 --- a/include/media/dvb-usb-ids.h +++ b/include/media/dvb-usb-ids.h @@ -314,7 +314,6 @@ #define USB_PID_PCTV_200E 0x020e #define USB_PID_PCTV_400E 0x020f #define USB_PID_PCTV_450E 0x0222 -#define USB_PID_PCTV_452E 0x021f #define USB_PID_PCTV_78E 0x025a #define USB_PID_PCTV_79E 0x0262 #define USB_PID_PINNACLE_EXPRESSCARD_320CX 0x022e @@ -330,6 +329,7 @@ #define USB_PID_PINNACLE_PCTV74E 0x0246 #define USB_PID_PINNACLE_PCTV801E 0x023a #define USB_PID_PINNACLE_PCTV801E_SE 0x023b +#define USB_PID_PINNACLE_PCTV_452E 0x021f #define USB_PID_PINNACLE_PCTV_DUAL_DIVERSITY_DVB_T 0x0229 #define USB_PID_PINNACLE_PCTV_DVB_T_FLASH 0x0228 #define USB_PID_PIXELVIEW_SBTVD 0x5010 -- 2.35.1