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: 8071331 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 F32EEBEEE5 for ; Wed, 20 Jan 2016 11:47:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 32ED720450 for ; Wed, 20 Jan 2016 11:47:03 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id C457020434 for ; Wed, 20 Jan 2016 11:47:01 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 774CC26058F; Wed, 20 Jan 2016 12:47:00 +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 7E6EE26058F; Wed, 20 Jan 2016 12:46:52 +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 6BAC82605B0; Wed, 20 Jan 2016 12:46:51 +0100 (CET) Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.75]) by alsa0.perex.cz (Postfix) with ESMTP id 5CEDE260544 for ; Wed, 20 Jan 2016 12:46:44 +0100 (CET) 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 Date: Wed, 20 Jan 2016 12:46:24 +0100 Message-ID: <1957179.2R1q7SBuPk@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:6pK+1fvvRlphlxrcdT6Zb2KLbXPZmfcwlGbiEoVDh77Q+P4SCge /kChed4HF3q+jShv/keVheIDjk5cSTfmkjzVd2c7IkCkWSCfa+3JdaSJYU5imEUp+w9FCn9 AeJ8ORCWMePnie9dFBlSfRQ/1csZAya+Fy+qNMSEBMuVcElwZLygqjzuP00A2SeyOi6RVn8 LB/2K1DsXi0RU/bDEhmPg== X-UI-Out-Filterresults: notjunk:1; V01:K0:cuvztdsUxyk=:uz2lkqswOXiirQjQRzrNWO Fb/8vihg4eVbGn1WCbVDKZcgoav/P6LyY70i3Fu6GFX9+tobvCSNvzLm0oVYNfhClZtPQ3fqS CQsgVy5NlZrWoZ0JJAnPXHnUSVs4FAhmqNKYLdGJrUXuxYPY2aYlDH8X2XdduZqJ6NXMctVTU lghGNe16rMCxea2l6Eecd9r6ZlKYGsmUC2E8KwZJCzq2X43DHgueId7wTmnFiCGFet0ADfYaU HH3FsIPTjwvKDk2YxEAS4T4tevZYDDAZ3STYyxOEVW2RJWf7P/rkxckElXsy5Wwqk5a+cxT5h dNVJNTvY6lkAARuR278Cn1VYsdH0HpRSiJzc5RL7f3n+D/vP/vlVNf5ps5fhKzj+7hOFAvKjo j9wd63CZcVeSCcxJ0y55sywhSG5uTCuEuYzsBCCJsT2XIhD461Hy1QJCHLBf79V+tQkO2pucs V/RDQ3QEwIVei+TrmvvHrvtWnrJurfcK2VoFY0XRyQuVAUP5IF5ou/nWMpe5HAdPmOV3v4uRH v1OkMpkoLZn8jTUm+ScP6MGF8tRdxSmDxQeqZkBI3YUjn020ok6KVEc6MefzSl/pdIbd77ruG NgmuZ4qe0A0px5tQLdAg/x6QVaMfFKEM/bwm/sPd0CeYZO/9Qkfn1g+mBOHOY+sjNIJJ6gZyc y1PqAIVmvOnEzYKjcspdBckkLdEuE+r+l23cnuEv7EXmCawjnd8w1JUjKKiyoEiBD/vWvuU0e 28SvlQxxLvI3bM9j Cc: Oder Chiou , alsa-devel@alsa-project.org, Liam Girdwood , linux-kernel@vger.kernel.org, Bard Liao , linux-arm-kernel@lists.infradead.org Subject: [alsa-devel] [PATCH] 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 --- 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,