Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: renesas_usbhs: Convert to DEFINE_SIMPLE_DEV_PM_OPS()

Convert the Renesas USBHS driver from SIMPLE_DEV_PM_OPS() to
DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr(). This lets us drop the
__maybe_unused annotations from its suspend and resume callbacks, and
reduces kernel size in case CONFIG_PM or CONFIG_PM_SLEEP is disabled.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/e1136dcd351a19b2e7145436bea1f38faa93a677.1752087914.git.geert+renesas@glider.be
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Geert Uytterhoeven and committed by
Greg Kroah-Hartman
782aee5b c6efba92

+4 -4
+4 -4
drivers/usb/renesas_usbhs/common.c
··· 823 823 usbhs_pipe_remove(priv); 824 824 } 825 825 826 - static __maybe_unused int usbhsc_suspend(struct device *dev) 826 + static int usbhsc_suspend(struct device *dev) 827 827 { 828 828 struct usbhs_priv *priv = dev_get_drvdata(dev); 829 829 struct usbhs_mod *mod = usbhs_mod_get_current(priv); ··· 839 839 return 0; 840 840 } 841 841 842 - static __maybe_unused int usbhsc_resume(struct device *dev) 842 + static int usbhsc_resume(struct device *dev) 843 843 { 844 844 struct usbhs_priv *priv = dev_get_drvdata(dev); 845 845 struct platform_device *pdev = usbhs_priv_to_pdev(priv); ··· 856 856 return 0; 857 857 } 858 858 859 - static SIMPLE_DEV_PM_OPS(usbhsc_pm_ops, usbhsc_suspend, usbhsc_resume); 859 + static DEFINE_SIMPLE_DEV_PM_OPS(usbhsc_pm_ops, usbhsc_suspend, usbhsc_resume); 860 860 861 861 static struct platform_driver renesas_usbhs_driver = { 862 862 .driver = { 863 863 .name = "renesas_usbhs", 864 - .pm = &usbhsc_pm_ops, 864 + .pm = pm_sleep_ptr(&usbhsc_pm_ops), 865 865 .of_match_table = usbhs_of_match, 866 866 }, 867 867 .probe = usbhs_probe,