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

Configure Feed

Select the types of activity you want to include in your feed.

usb: dwc3: qcom: use modern PM macros

The use of the old SET_SYSTEM_SLEEP_PM_OPS/SET_RUNTIME_PM_OPS macros
without __maybe_unused annotations causes warnings when build testing
without CONFIG_PM:

drivers/usb/dwc3/dwc3-qcom.c:421:12: error: unused function 'dwc3_qcom_suspend' [-Werror,-Wunused-function]
421 | static int dwc3_qcom_suspend(struct dwc3_qcom *qcom, bool wakeup)
| ^~~~~~~~~~~~~~~~~
drivers/usb/dwc3/dwc3-qcom.c:457:12: error: unused function 'dwc3_qcom_resume' [-Werror,-Wunused-function]
457 | static int dwc3_qcom_resume(struct dwc3_qcom *qcom, bool wakeup)

Change these to the modern SYSTEM_SLEEP_PM_OPS/RUNTIME_PM_OPS/pm_ptr
macros, which avoids the warnings and improves readability at the same
time.

Fixes: 1881a32fe14d ("usb: dwc3: qcom: Transition to flattened model")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Abel Vesa <abel.vesa@linaro.org>
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/20250423162613.2082417-1-arnd@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Arnd Bergmann and committed by
Greg Kroah-Hartman
45ebb7ba 495df45f

+5 -12
+5 -12
drivers/usb/dwc3/dwc3-qcom.c
··· 832 832 reset_control_assert(qcom->resets); 833 833 } 834 834 835 - #ifdef CONFIG_PM_SLEEP 836 835 static int dwc3_qcom_pm_suspend(struct device *dev) 837 836 { 838 837 struct dwc3 *dwc = dev_get_drvdata(dev); ··· 885 886 886 887 return dwc3_pm_prepare(dwc); 887 888 } 888 - #else 889 - #define dwc3_qcom_complete NULL 890 - #define dwc3_qcom_prepare NULL 891 - #endif /* CONFIG_PM_SLEEP */ 892 889 893 - #ifdef CONFIG_PM 894 890 static int dwc3_qcom_runtime_suspend(struct device *dev) 895 891 { 896 892 struct dwc3 *dwc = dev_get_drvdata(dev); ··· 916 922 { 917 923 return dwc3_runtime_idle(dev_get_drvdata(dev)); 918 924 } 919 - #endif /* CONFIG_PM */ 920 925 921 926 static const struct dev_pm_ops dwc3_qcom_dev_pm_ops = { 922 - SET_SYSTEM_SLEEP_PM_OPS(dwc3_qcom_pm_suspend, dwc3_qcom_pm_resume) 923 - SET_RUNTIME_PM_OPS(dwc3_qcom_runtime_suspend, dwc3_qcom_runtime_resume, 927 + SYSTEM_SLEEP_PM_OPS(dwc3_qcom_pm_suspend, dwc3_qcom_pm_resume) 928 + RUNTIME_PM_OPS(dwc3_qcom_runtime_suspend, dwc3_qcom_runtime_resume, 924 929 dwc3_qcom_runtime_idle) 925 - .complete = dwc3_qcom_complete, 926 - .prepare = dwc3_qcom_prepare, 930 + .complete = pm_sleep_ptr(dwc3_qcom_complete), 931 + .prepare = pm_sleep_ptr(dwc3_qcom_prepare), 927 932 }; 928 933 929 934 static const struct of_device_id dwc3_qcom_of_match[] = { ··· 936 943 .remove = dwc3_qcom_remove, 937 944 .driver = { 938 945 .name = "dwc3-qcom", 939 - .pm = &dwc3_qcom_dev_pm_ops, 946 + .pm = pm_ptr(&dwc3_qcom_dev_pm_ops), 940 947 .of_match_table = dwc3_qcom_of_match, 941 948 }, 942 949 };