From patchwork Wed Jan 20 11:05:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 8071101 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9896EBEEE5 for ; Wed, 20 Jan 2016 11:06:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AE1B520443 for ; Wed, 20 Jan 2016 11:06:28 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 4F42020386 for ; Wed, 20 Jan 2016 11:06:27 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 32D37265ABD; Wed, 20 Jan 2016 12:06:26 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id EF3E5260544; Wed, 20 Jan 2016 12:06:14 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 1B81D26058F; Wed, 20 Jan 2016 12:06:14 +0100 (CET) Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.75]) by alsa0.perex.cz (Postfix) with ESMTP id 0FB0B260412 for ; Wed, 20 Jan 2016 12:06:07 +0100 (CET) Received: from wuerfel.localnet ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue101) with ESMTPSA (Nemesis) id 0M0Qv7-1a0jvu0ks1-00uZ4d; Wed, 20 Jan 2016 12:05:59 +0100 From: Arnd Bergmann To: Mark Brown , Oder Chiou , alsa-devel@alsa-project.org, Liam Girdwood , linux-kernel@vger.kernel.org, Bard Liao , linux-arm-kernel@lists.infradead.org Date: Wed, 20 Jan 2016 12:05:55 +0100 Message-ID: <1477393.QDzvbob2TI@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) MIME-Version: 1.0 X-Provags-ID: V03:K0:2ehJtaNkZhpCbtlPXpg0WDNMDtAbT/qwIJkk/z8Ic5D+NUxgTRM z1HutjNz3vzDKY+QCkaNZa+vunM+Iu69BQ8oxwVHHFxl0aZ0aY7LNTBQ7XilozbsRxE6qBl MvJwA8DD+DRC83RjeElNP21RL6GWzzgtno9z9wULNa4qDX0OrzGeIhaTKL5k9pDuGA8BhUO omHMHiV1pFD7jRUZPMasA== X-UI-Out-Filterresults: notjunk:1; V01:K0:ZAgcxO06cBQ=:xK/qY3N/GPiZGFVGM1XZoi wACc8yWcftvAefFwpYkaqqn4b9oEh6e8L3yLl1YUebe61AeB2IQK+4vzyzvLIgWuonQwb5nKu xEO1FM7WT9Scsm9vgT3ljWJuSYDRP6NLM1OP8fY5Rjly+znF8gNEfWwzuDQ230TDuV65OG7AH r0O27V3YdDvTAemYOo6OVe7OzmGmSEqMFkiBRfCkiwQFOsDGtlWGWfva5MFt+n5mPhHe7Pa4a coLkFCrSU+qfMmuPmCCS65t1PGj5NUFV4znpM6nMJN/E146XXjfn9eborDSB/uy5yepjsZz9u JkVD+DceRALAMpM0HR4A1xH5VlK4ADclpcOW4d47tl2GhN9bI0EM7LkKh8Jny8rlcEzB9hIxq GLSDa03UUdQRAidVrJ9pg1TlU2dHGlVjNwgNebkA3t8EX0sqIGcALRTCwqBkVKW/SxKNru3XP UeKpkwAzeI2fen9hNM5N+IdEwtInj0P07zQ94OZJjd9Sg5XC8UUFEPdLBawFbfVvXC4hwZ36G WGoaW+drxJ10ejQrzdQi9ID/NMHTQw73sIcGP5wYyqU5k8ACaTbkaIEpmtgmd6ThIKoNuOU1u FwUp78kA+Vp5Y+hWUaJcOsSHFrVtPxtTq5t0tqonOLfrgMZ2oqn4CbdkyAwF6r32IheY8pH2T hAkuohIIf515qpAeIRhADH3kW1z+PZN5esxIMo6RBwdLtPun60HIICgsQkQtw8LQNgXdjAOBO htq43vlDeI9DokT7 Subject: [alsa-devel] [PATCH v2] ASoC: avoid unused variable warning for rt5659_acpi_match X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP The newly added rt5659 codec driver unconditionally defines an ACPI device match table but then uses ACPI_PTR() to remove the only reference to it, so we get a harmless build warning: sound/soc/codecs/rt5659.c:4200:30: warning: 'rt5659_acpi_match' defined but not used [-Wunused-variable] static struct acpi_device_id rt5659_acpi_match[] = { This changes both the OF match table and the ACPI match table to follow the same style, using ACPI_PTR/of_match_ptr to make the reference conditional, and using an #ifdef to hide the table. This also adds the missing MODULE_DEVICE_TABLE for the OF case and adapts the formatting to the same style. Signed-off-by: Arnd Bergmann --- I still want to give this some time in the random build testing to avoid introducing a stupid mistake, please apply after tomorrow unless you hear from me otherwise. diff --git a/sound/soc/codecs/rt5659.c b/sound/soc/codecs/rt5659.c index c166d9394c69..efe87af33f8f 100644 --- a/sound/soc/codecs/rt5659.c +++ b/sound/soc/codecs/rt5659.c @@ -4183,24 +4183,29 @@ void rt5659_i2c_shutdown(struct i2c_client *client) regmap_write(rt5659->regmap, RT5659_RESET, 0); } +#ifdef CONFIG_OF static const struct of_device_id rt5659_of_match[] = { { .compatible = "realtek,rt5658", }, { .compatible = "realtek,rt5659", }, - {}, + { }, }; +MODULE_DEVICE_TABLE(of, rt5659_of_match) +#endif +#ifdef CONFIG_ACPI static struct acpi_device_id rt5659_acpi_match[] = { - { "10EC5658", 0}, - { "10EC5659", 0}, - { }, + { "10EC5658", 0, }, + { "10EC5659", 0, }, + { }, }; MODULE_DEVICE_TABLE(acpi, rt5659_acpi_match); +#endif struct i2c_driver rt5659_i2c_driver = { .driver = { .name = "rt5659", .owner = THIS_MODULE, - .of_match_table = rt5659_of_match, + .of_match_table = of_match_ptr(rt5659_of_match), .acpi_match_table = ACPI_PTR(rt5659_acpi_match), }, .probe = rt5659_i2c_probe,