From: Uwe Kleine-König Date: Thu, 7 Jul 2022 06:14:40 +0000 (+0200) Subject: powerpc/platforms/83xx/suspend: Prevent unloading the driver X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=ccc1439b924bca5d5a5d81cf6b0d4b10b321282e;p=linux.git powerpc/platforms/83xx/suspend: Prevent unloading the driver Returning an error in .remove() doesn't prevent a driver from being unloaded. On unbind this only results in an error message, but the device is remove anyhow. I guess the author's idea of just returning -EPERM in .remove() was to prevent unbinding a device. To achieve that set the suppress_bind_attrs driver property and drop the useless .remove callback. This is a preparation for making platform remove callbacks return void. Signed-off-by: Uwe Kleine-König Reviewed-by: Christophe Leroy Acked-by: Scott Wood Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220707061441.193869-2-u.kleine-koenig@pengutronix.de --- diff --git a/arch/powerpc/platforms/83xx/suspend.c b/arch/powerpc/platforms/83xx/suspend.c index 30b7700a2c988..309f42ab63d40 100644 --- a/arch/powerpc/platforms/83xx/suspend.c +++ b/arch/powerpc/platforms/83xx/suspend.c @@ -421,18 +421,13 @@ out: return ret; } -static int pmc_remove(struct platform_device *ofdev) -{ - return -EPERM; -}; - static struct platform_driver pmc_driver = { .driver = { .name = "mpc83xx-pmc", .of_match_table = pmc_match, + .suppress_bind_attrs = true, }, .probe = pmc_probe, - .remove = pmc_remove }; builtin_platform_driver(pmc_driver);