Thread (4 messages) 4 messages, 3 authors, 2022-07-29

Re: [PATCH] powerpc/52xx: Mark gpt driver as not removable

From: Christophe Leroy <hidden>
Date: 2022-07-07 08:51:45


Le 12/06/2022 à 23:34, Uwe Kleine-König a écrit :
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 <redacted>
Reviewed-by: Christophe Leroy <redacted>
quoted hunk ↗ jump to hunk
---
  arch/powerpc/platforms/52xx/mpc52xx_gpt.c | 7 +------
  1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_gpt.c b/arch/powerpc/platforms/52xx/mpc52xx_gpt.c
index 968f5b727273..b2c24cab4b1e 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_gpt.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_gpt.c
@@ -755,11 +755,6 @@ static int mpc52xx_gpt_probe(struct platform_device *ofdev)
  	return 0;
  }
  
-static int mpc52xx_gpt_remove(struct platform_device *ofdev)
-{
-	return -EBUSY;
-}
-
  static const struct of_device_id mpc52xx_gpt_match[] = {
  	{ .compatible = "fsl,mpc5200-gpt", },
  
@@ -772,10 +767,10 @@ static const struct of_device_id mpc52xx_gpt_match[] = {
  static struct platform_driver mpc52xx_gpt_driver = {
  	.driver = {
  		.name = "mpc52xx-gpt",
+		.suppress_bind_attrs = true,
  		.of_match_table = mpc52xx_gpt_match,
  	},
  	.probe = mpc52xx_gpt_probe,
-	.remove = mpc52xx_gpt_remove,
  };
  
  static int __init mpc52xx_gpt_init(void)
base-commit: f2906aa863381afb0015a9eb7fefad885d4e5a56
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help