From patchwork Wed Jan 20 11:46:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101149 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp3122904lbb; Wed, 20 Jan 2016 03:47:19 -0800 (PST) X-Received: by 10.66.162.9 with SMTP id xw9mr51748684pab.46.1453290439505; Wed, 20 Jan 2016 03:47:19 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 83si54765305pfs.84.2016.01.20.03.47.19; Wed, 20 Jan 2016 03:47:19 -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 S933310AbcATLrQ (ORCPT + 29 others); Wed, 20 Jan 2016 06:47:16 -0500 Received: from mout.kundenserver.de ([217.72.192.75]:57649 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933145AbcATLrM (ORCPT ); Wed, 20 Jan 2016 06:47:12 -0500 Received: from wuerfel.localnet ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue104) with ESMTPSA (Nemesis) id 0MYeLS-1ahBSl0BPu-00VRzF; Wed, 20 Jan 2016 12:46:33 +0100 From: Arnd Bergmann To: Mark Brown Cc: Oder Chiou , alsa-devel@alsa-project.org, Liam Girdwood , linux-kernel@vger.kernel.org, Bard Liao , linux-arm-kernel@lists.infradead.org Subject: [PATCH] ASoC: avoid unused variable warning for rt5659_acpi_match Date: Wed, 20 Jan 2016 12:46:24 +0100 Message-ID: <1957179.2R1q7SBuPk@wuerfel> User-Ag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1JUjKKiyoEiBD/vWvuU0e 28SvlQxxLvI3bM9j 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 --- v3: actually builds with CONFIG_OF enabled, testing in a couple of configurations with and without OF diff --git a/sound/soc/codecs/rt5659.c b/sound/soc/codecs/rt5659.c index c166d9394c69..fb8ea05c0de1 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,