powerpc/52xx: Mark gpt driver as not removable

Returning an error code (here -EBUSY) from a remove callback doesn't
prevent the driver from being unloaded. The only effect is that an error
message is emitted and the driver is removed anyhow.

So instead drop the remove function (which is equivalent to returning zero)
and set the suppress_bind_attrs property to make it impossible to unload
the driver via sysfs.

This is a preparation for making platform remove callbacks return void.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220612213400.159257-1-u.kleine-koenig@pengutronix.de
This commit is contained in:
Uwe Kleine-König 2022-06-12 23:34:00 +02:00 committed by Michael Ellerman
parent 999d7c47a0
commit 1978c48495

View File

@ -753,11 +753,6 @@ static int mpc52xx_gpt_probe(struct platform_device *ofdev)
return 0; return 0;
} }
static int mpc52xx_gpt_remove(struct platform_device *ofdev)
{
return -EBUSY;
}
static const struct of_device_id mpc52xx_gpt_match[] = { static const struct of_device_id mpc52xx_gpt_match[] = {
{ .compatible = "fsl,mpc5200-gpt", }, { .compatible = "fsl,mpc5200-gpt", },
@ -770,10 +765,10 @@ static const struct of_device_id mpc52xx_gpt_match[] = {
static struct platform_driver mpc52xx_gpt_driver = { static struct platform_driver mpc52xx_gpt_driver = {
.driver = { .driver = {
.name = "mpc52xx-gpt", .name = "mpc52xx-gpt",
.suppress_bind_attrs = true,
.of_match_table = mpc52xx_gpt_match, .of_match_table = mpc52xx_gpt_match,
}, },
.probe = mpc52xx_gpt_probe, .probe = mpc52xx_gpt_probe,
.remove = mpc52xx_gpt_remove,
}; };
static int __init mpc52xx_gpt_init(void) static int __init mpc52xx_gpt_init(void)