From patchwork Mon Mar 4 20:33:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10838585 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8EAA61399 for ; Mon, 4 Mar 2019 20:35:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 789FA2AAFC for ; Mon, 4 Mar 2019 20:35:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6CED82AB80; Mon, 4 Mar 2019 20:35:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AAF9C2AAFC for ; Mon, 4 Mar 2019 20:35:52 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D4999854; Mon, 4 Mar 2019 21:35:00 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D4999854 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1551731750; bh=QVjXyxtYeGMycqhz1imN99rZIK2DMc6+Ap10BNGQIqY=; h=From:To:Date:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=QBeUMLnLDwbexKyVfmJpQjUVld3nv10kMVqfcuDz2LLIn3hO7gwFv9A+atjKNfwyM 5by3s5GoNlEvKYAXxa8RxEP3p2bySmwf5v4fmuJQLZrKUUX6c5YB+GiJtOl4wxEqbL 8zWVqpTuqolBinSjFGX0YqfV9iEXuXp/ubhhUhHQ= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 26CC4F896EE; Mon, 4 Mar 2019 21:34:30 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id BDD73F896EE; Mon, 4 Mar 2019 21:34:29 +0100 (CET) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id E560CF896EE for ; Mon, 4 Mar 2019 21:34:26 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E560CF896EE Received: from wuerfel.lan ([109.192.41.194]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.145]) with ESMTPA (Nemesis) id 1Mf0FY-1hTvJJ3PYI-00gV08; Mon, 04 Mar 2019 21:33:39 +0100 From: Arnd Bergmann To: Jaroslav Kysela , Takashi Iwai , Thierry Reding , Jonathan Hunter Date: Mon, 4 Mar 2019 21:33:25 +0100 Message-Id: <20190304203337.1968705-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:gGK9SLW1WNjwagJZ5WFg+KFg0y7X0g2wg/CrYquepC0s5WUELGF o14XabNuJgO/suXkwp7p4K8TMKxHIrI4xDgg4lio6eVcYsmczGOnrevZ6X1DusS+X5o9ZYg 9+1hZ+MejNu3gcJdVciuuyH2Cgw1dRivtTjVj4zCAAKTXKrG/tfRzjmffH/usklhoebPNho RzQpWf2ohVS1a8ShyEL6A== X-UI-Out-Filterresults: notjunk:1;V03:K0:XvlmZ2uJsrA=:q+bRwaMqf6nyDryl1YymE2 2nNh3fPQY1VfWN+cdrt5dYqQ4XUMAS0aFe7Bsm/zcoz1zuHLZzWoHD8XEKGZptRhHyWIfuObr giyQ6JpPjP99eXqUvhifbmXfdugRkcefJBQTVIOGlDB29gurC9HL6nIVrn9Q+3Mu4JVKvF5AS 7ROJEet1ZoJBEmLqzpOR89BkPA3HklXb6zwtmPAas5e5BJBCeJj7zbDLWLxBtN1FTuMIfWBU1 SdLlWkrHZ+b495t8T3Vw5/VGOZfZMzrgWZkVfTiHc+oQkXXAAn0PMEoTgIpoZaEvP8BqPHJs2 Eg3P+pdHBK+yG421GmuXZFRH9au5/Hv3P5XCU8tOeEHzFRNZAgH4+YaC7CBLhT1Z/RmJMDhVv 6n5LtLDWuSCgyyHa087e0WLIptyQ/F68Kbd2QOhyQUdVLsuM3+uMdp4A8o2Mq2RoqH3hiOlea tLyqoXGhYZJkgvSTu3lB35YxT94K+ltHbS2UL+Xikxhy40aw/unOJc2rfmU24Py8MMKj9XWI7 tszfIA8VHFQu0cBxMXWpeze7ImHwymlPWQoB9dZHauKPLG/cyXYk/tE2VSsTY6Xt4gHckEUeM sGqmRtK0r6vbNjylBVrw2YlzX4rKVk/JQdRfklbk0xULEfHrUpclzXG/ryI9nWCGOwabNIOrt dPO+z83WWD8cGasbG5QHhKdJvMPpXNXVGsTYajedUfVNUz3E7bnE909Ua4/8M2KGo2A01B8ML SGxIQePQ8kehbi37jDVlgpw9nxvBL7LcM1Bo5w== Cc: alsa-devel@alsa-project.org, Arnd Bergmann , Sameer Pujar , Pierre-Louis Bossart , linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org, Ravindra Lokhande , Mohan Kumar D Subject: [alsa-devel] [PATCH] ALSA: hda/tegra: avoid build error without CONFIG_PM X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP The #ifdef protection around the PM functions is wrong, leading to a failed reference in some configurations: sound/pci/hda/hda_tegra.c: In function 'hda_tegra_runtime_suspend': sound/pci/hda/hda_tegra.c:273:2: error: implicit declaration of function 'hda_tegra_disable_clocks'; did you mean 'hda_tegra_enable_clocks'? [-Werror=implicit-function-declaration] Better remove the #ifdefs entirely and rely on the compiler silently dropping unused functions marked __maybe_unused. Fixes: 707e0759f2f4 ("ALSA: hda/tegra: implement runtime suspend/resume") Signed-off-by: Arnd Bergmann Acked-by: Thierry Reding --- sound/pci/hda/hda_tegra.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/sound/pci/hda/hda_tegra.c b/sound/pci/hda/hda_tegra.c index dbd8da5685cb..3d68f9ef7694 100644 --- a/sound/pci/hda/hda_tegra.c +++ b/sound/pci/hda/hda_tegra.c @@ -219,7 +219,6 @@ static int hda_tegra_enable_clocks(struct hda_tegra *data) return rc; } -#ifdef CONFIG_PM_SLEEP static void hda_tegra_disable_clocks(struct hda_tegra *data) { clk_disable_unprepare(data->hda2hdmi_clk); @@ -230,7 +229,7 @@ static void hda_tegra_disable_clocks(struct hda_tegra *data) /* * power management */ -static int hda_tegra_suspend(struct device *dev) +static int __maybe_unused hda_tegra_suspend(struct device *dev) { struct snd_card *card = dev_get_drvdata(dev); int rc; @@ -243,7 +242,7 @@ static int hda_tegra_suspend(struct device *dev) return 0; } -static int hda_tegra_resume(struct device *dev) +static int __maybe_unused hda_tegra_resume(struct device *dev) { struct snd_card *card = dev_get_drvdata(dev); int rc; @@ -255,10 +254,8 @@ static int hda_tegra_resume(struct device *dev) return 0; } -#endif /* CONFIG_PM_SLEEP */ -#ifdef CONFIG_PM -static int hda_tegra_runtime_suspend(struct device *dev) +static int __maybe_unused hda_tegra_runtime_suspend(struct device *dev) { struct snd_card *card = dev_get_drvdata(dev); struct azx *chip = card->private_data; @@ -275,7 +272,7 @@ static int hda_tegra_runtime_suspend(struct device *dev) return 0; } -static int hda_tegra_runtime_resume(struct device *dev) +static int __maybe_unused hda_tegra_runtime_resume(struct device *dev) { struct snd_card *card = dev_get_drvdata(dev); struct azx *chip = card->private_data; @@ -292,7 +289,6 @@ static int hda_tegra_runtime_resume(struct device *dev) return 0; } -#endif /* CONFIG_PM */ static const struct dev_pm_ops hda_tegra_pm = { SET_SYSTEM_SLEEP_PM_OPS(hda_tegra_suspend, hda_tegra_resume)