Skip to content

Commit 07a251b

Browse files
xhackerustcBartosz Golaszewski
authored andcommitted
gpio: msc313: 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> Acked-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Link: https://lore.kernel.org/r/20251124002105.25429-8-jszhang@kernel.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
1 parent a92f492 commit 07a251b

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

drivers/gpio/gpio-msc313.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ static const struct of_device_id msc313_gpio_of_match[] = {
694694
* SoC goes into suspend to memory mode so we need to save some
695695
* of the register bits before suspending and put it back when resuming
696696
*/
697-
static int __maybe_unused msc313_gpio_suspend(struct device *dev)
697+
static int msc313_gpio_suspend(struct device *dev)
698698
{
699699
struct msc313_gpio *gpio = dev_get_drvdata(dev);
700700
int i;
@@ -705,7 +705,7 @@ static int __maybe_unused msc313_gpio_suspend(struct device *dev)
705705
return 0;
706706
}
707707

708-
static int __maybe_unused msc313_gpio_resume(struct device *dev)
708+
static int msc313_gpio_resume(struct device *dev)
709709
{
710710
struct msc313_gpio *gpio = dev_get_drvdata(dev);
711711
int i;
@@ -716,13 +716,13 @@ static int __maybe_unused msc313_gpio_resume(struct device *dev)
716716
return 0;
717717
}
718718

719-
static SIMPLE_DEV_PM_OPS(msc313_gpio_ops, msc313_gpio_suspend, msc313_gpio_resume);
719+
static DEFINE_SIMPLE_DEV_PM_OPS(msc313_gpio_ops, msc313_gpio_suspend, msc313_gpio_resume);
720720

721721
static struct platform_driver msc313_gpio_driver = {
722722
.driver = {
723723
.name = DRIVER_NAME,
724724
.of_match_table = msc313_gpio_of_match,
725-
.pm = &msc313_gpio_ops,
725+
.pm = pm_sleep_ptr(&msc313_gpio_ops),
726726
},
727727
.probe = msc313_gpio_probe,
728728
};

0 commit comments

Comments
 (0)