Commit 161266c7 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Marc Kleine-Budde
Browse files

can: rcar_canfd: Convert to DEFINE_SIMPLE_DEV_PM_OPS()



Convert the Renesas R-Car CAN-FD 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: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: default avatarBiju Das <biju.das.jz@bp.renesas.com>
Signed-off-by: default avatarBiju Das <biju.das.jz@bp.renesas.com>
Link: https://patch.msgid.link/20251124102837.106973-7-biju.das.jz@bp.renesas.com


Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent ddf9bbf2
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -2255,17 +2255,17 @@ static void rcar_canfd_remove(struct platform_device *pdev)
	rcar_canfd_global_deinit(gpriv, true);
}

static int __maybe_unused rcar_canfd_suspend(struct device *dev)
static int rcar_canfd_suspend(struct device *dev)
{
	return 0;
}

static int __maybe_unused rcar_canfd_resume(struct device *dev)
static int rcar_canfd_resume(struct device *dev)
{
	return 0;
}

static SIMPLE_DEV_PM_OPS(rcar_canfd_pm_ops, rcar_canfd_suspend,
static DEFINE_SIMPLE_DEV_PM_OPS(rcar_canfd_pm_ops, rcar_canfd_suspend,
				rcar_canfd_resume);

static const __maybe_unused struct of_device_id rcar_canfd_of_table[] = {
@@ -2283,7 +2283,7 @@ static struct platform_driver rcar_canfd_driver = {
	.driver = {
		.name = RCANFD_DRV_NAME,
		.of_match_table = of_match_ptr(rcar_canfd_of_table),
		.pm = &rcar_canfd_pm_ops,
		.pm = pm_sleep_ptr(&rcar_canfd_pm_ops),
	},
	.probe = rcar_canfd_probe,
	.remove = rcar_canfd_remove,