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: st: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM_SLEEP support is simpler and less error prone than the
use of #ifdef based kernel configuration guards.

Signed-off-by: Raphael Gallais-Pou <rgallaispou@gmail.com>
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/20250109152055.52931-1-rgallaispou@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Raphael Gallais-Pou and committed by
Greg Kroah-Hartman
e84a7da8 a266462b

+2 -4
+2 -4
drivers/usb/dwc3/dwc3-st.c
··· 309 309 reset_control_assert(dwc3_data->rstc_rst); 310 310 } 311 311 312 - #ifdef CONFIG_PM_SLEEP 313 312 static int st_dwc3_suspend(struct device *dev) 314 313 { 315 314 struct st_dwc3 *dwc3_data = dev_get_drvdata(dev); ··· 342 343 343 344 return 0; 344 345 } 345 - #endif /* CONFIG_PM_SLEEP */ 346 346 347 - static SIMPLE_DEV_PM_OPS(st_dwc3_dev_pm_ops, st_dwc3_suspend, st_dwc3_resume); 347 + static DEFINE_SIMPLE_DEV_PM_OPS(st_dwc3_dev_pm_ops, st_dwc3_suspend, st_dwc3_resume); 348 348 349 349 static const struct of_device_id st_dwc3_match[] = { 350 350 { .compatible = "st,stih407-dwc3" }, ··· 358 360 .driver = { 359 361 .name = "usb-st-dwc3", 360 362 .of_match_table = st_dwc3_match, 361 - .pm = &st_dwc3_dev_pm_ops, 363 + .pm = pm_sleep_ptr(&st_dwc3_dev_pm_ops), 362 364 }, 363 365 }; 364 366