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: 101151 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp3104552lbb; Wed, 20 Jan 2016 03:06:39 -0800 (PST) X-Received: by 10.66.149.7 with SMTP id tw7mr51795618pab.72.1453287999746; Wed, 20 Jan 2016 03:06:39 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e88si54645379pfb.26.2016.01.20.03.06.39; Wed, 20 Jan 2016 03:06:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964852AbcATLGh (ORCPT + 29 others); Wed, 20 Jan 2016 06:06:37 -0500 Received: from mout.kundenserver.de ([217.72.192.75]:59458 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964805AbcATLGe (ORCPT ); Wed, 20 Jan 2016 06:06:34 -0500 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 Subject: [PATCH v2] ASoC: avoid unused variable warning for rt5659_acpi_match 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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,