aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2016-03-02 10:24:06 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-03-03 23:37:41 -0500
commit9fc7c85dc49116cb8209321ae343a26b82b37d2f (patch)
treed2e309733c5e6a3e2cc42c9293effd35b76760c1
parentd29051930becb9c63a9b13409722090e701cdacc (diff)
usb: ehci-atmel: use __maybe_unused to hide pm functions
The ehci-atmel driver uses #ifdef to check for CONFIG_PM, but then uses SIMPLE_DEV_PM_OPS, which leaves the references out when CONFIG_PM_SLEEP is not defined, so we get a warning with PM=y && PM_SLEEP=n: drivers/usb/host/ehci-atmel.c:189:12: error: 'ehci_atmel_drv_suspend' defined but not used [-Werror=unused-function] drivers/usb/host/ehci-atmel.c:203:12: error: 'ehci_atmel_drv_resume' defined but not used [-Werror=unused-function] This removes the incorrect #ifdef and instead uses a __maybe_unused annotation to let the compiler know it can silently drop the function definition. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/host/ehci-atmel.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/usb/host/ehci-atmel.c b/drivers/usb/host/ehci-atmel.c
index be0964a801e8..7440722bfbf0 100644
--- a/drivers/usb/host/ehci-atmel.c
+++ b/drivers/usb/host/ehci-atmel.c
@@ -185,8 +185,7 @@ static int ehci_atmel_drv_remove(struct platform_device *pdev)
185 return 0; 185 return 0;
186} 186}
187 187
188#ifdef CONFIG_PM 188static int __maybe_unused ehci_atmel_drv_suspend(struct device *dev)
189static int ehci_atmel_drv_suspend(struct device *dev)
190{ 189{
191 struct usb_hcd *hcd = dev_get_drvdata(dev); 190 struct usb_hcd *hcd = dev_get_drvdata(dev);
192 struct atmel_ehci_priv *atmel_ehci = hcd_to_atmel_ehci_priv(hcd); 191 struct atmel_ehci_priv *atmel_ehci = hcd_to_atmel_ehci_priv(hcd);
@@ -200,7 +199,7 @@ static int ehci_atmel_drv_suspend(struct device *dev)
200 return 0; 199 return 0;
201} 200}
202 201
203static int ehci_atmel_drv_resume(struct device *dev) 202static int __maybe_unused ehci_atmel_drv_resume(struct device *dev)
204{ 203{
205 struct usb_hcd *hcd = dev_get_drvdata(dev); 204 struct usb_hcd *hcd = dev_get_drvdata(dev);
206 struct atmel_ehci_priv *atmel_ehci = hcd_to_atmel_ehci_priv(hcd); 205 struct atmel_ehci_priv *atmel_ehci = hcd_to_atmel_ehci_priv(hcd);
@@ -208,7 +207,6 @@ static int ehci_atmel_drv_resume(struct device *dev)
208 atmel_start_clock(atmel_ehci); 207 atmel_start_clock(atmel_ehci);
209 return ehci_resume(hcd, false); 208 return ehci_resume(hcd, false);
210} 209}
211#endif
212 210
213#ifdef CONFIG_OF 211#ifdef CONFIG_OF
214static const struct of_device_id atmel_ehci_dt_ids[] = { 212static const struct of_device_id atmel_ehci_dt_ids[] = {