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: usb251xb: use modern PM macros

Use the modern PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or
CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Reviewed-by: Richard Leitner <richard.leitner@linux.dev>
Link: https://lore.kernel.org/r/20250825234509.1041-3-jszhang@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jisheng Zhang and committed by
Greg Kroah-Hartman
22fbedf9 ea32cd91

+4 -4
+4 -4
drivers/usb/misc/usb251xb.c
··· 698 698 return usb251xb_probe(hub); 699 699 } 700 700 701 - static int __maybe_unused usb251xb_suspend(struct device *dev) 701 + static int usb251xb_suspend(struct device *dev) 702 702 { 703 703 struct i2c_client *client = to_i2c_client(dev); 704 704 struct usb251xb *hub = i2c_get_clientdata(client); ··· 706 706 return regulator_disable(hub->vdd); 707 707 } 708 708 709 - static int __maybe_unused usb251xb_resume(struct device *dev) 709 + static int usb251xb_resume(struct device *dev) 710 710 { 711 711 struct i2c_client *client = to_i2c_client(dev); 712 712 struct usb251xb *hub = i2c_get_clientdata(client); ··· 719 719 return usb251xb_connect(hub); 720 720 } 721 721 722 - static SIMPLE_DEV_PM_OPS(usb251xb_pm_ops, usb251xb_suspend, usb251xb_resume); 722 + static DEFINE_SIMPLE_DEV_PM_OPS(usb251xb_pm_ops, usb251xb_suspend, usb251xb_resume); 723 723 724 724 static const struct i2c_device_id usb251xb_id[] = { 725 725 { "usb2422" }, ··· 739 739 .driver = { 740 740 .name = DRIVER_NAME, 741 741 .of_match_table = usb251xb_of_match, 742 - .pm = &usb251xb_pm_ops, 742 + .pm = pm_sleep_ptr(&usb251xb_pm_ops), 743 743 }, 744 744 .probe = usb251xb_i2c_probe, 745 745 .id_table = usb251xb_id,