]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
clk: rs9: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
authorGeert Uytterhoeven <geert+renesas@glider.be>
Wed, 21 Jan 2026 11:03:11 +0000 (12:03 +0100)
committerStephen Boyd <sboyd@kernel.org>
Tue, 3 Feb 2026 00:35:56 +0000 (16:35 -0800)
Convert the Renesas 9-series PCIe clock generator 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>
Reviewed-by: Brian Masney <bmasney@redhat.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/clk-renesas-pcie.c

index f94a9c4d0b6700ff1814a4590ac87c55951f0d42..aa108df12e44fb9f54d183ead12484f459220195 100644 (file)
@@ -354,7 +354,7 @@ static int rs9_probe(struct i2c_client *client)
        return ret;
 }
 
-static int __maybe_unused rs9_suspend(struct device *dev)
+static int rs9_suspend(struct device *dev)
 {
        struct rs9_driver_data *rs9 = dev_get_drvdata(dev);
 
@@ -364,7 +364,7 @@ static int __maybe_unused rs9_suspend(struct device *dev)
        return 0;
 }
 
-static int __maybe_unused rs9_resume(struct device *dev)
+static int rs9_resume(struct device *dev)
 {
        struct rs9_driver_data *rs9 = dev_get_drvdata(dev);
        int ret;
@@ -410,12 +410,12 @@ static const struct of_device_id clk_rs9_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, clk_rs9_of_match);
 
-static SIMPLE_DEV_PM_OPS(rs9_pm_ops, rs9_suspend, rs9_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(rs9_pm_ops, rs9_suspend, rs9_resume);
 
 static struct i2c_driver rs9_driver = {
        .driver = {
                .name = "clk-renesas-pcie-9series",
-               .pm     = &rs9_pm_ops,
+               .pm     = pm_sleep_ptr(&rs9_pm_ops),
                .of_match_table = clk_rs9_of_match,
        },
        .probe          = rs9_probe,