diff mbox series

powerpc/ep8248e: Mark driver as non removable

Message ID 20230726081442.461026-1-u.kleine-koenig@pengutronix.de (mailing list archive)
State Accepted
Commit bbfa509d632946578d4f19aa2cedf1ca2f34565d
Headers show
Series powerpc/ep8248e: Mark driver as non removable | expand

Checks

Context Check Description
snowpatch_ozlabs/github-powerpc_selftests success Successfully ran 8 jobs.
snowpatch_ozlabs/github-powerpc_ppctests success Successfully ran 8 jobs.
snowpatch_ozlabs/github-powerpc_kernel_qemu success Successfully ran 23 jobs.
snowpatch_ozlabs/github-powerpc_sparse success Successfully ran 4 jobs.
snowpatch_ozlabs/github-powerpc_clang success Successfully ran 6 jobs.

Commit Message

Uwe Kleine-König July 26, 2023, 8:14 a.m. UTC
Instead of resorting to BUG() ensure that the driver isn't unbound by
suppressing its bind and unbind sysfs attributes. As the driver is
built-in there is no way to remove a device once bound.

As a nice side effect this allows to drop the remove function.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 arch/powerpc/platforms/82xx/ep8248e.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)


base-commit: 06c2afb862f9da8dc5efa4b6076a0e48c3fbaaa5

Comments

Michael Ellerman Aug. 10, 2023, 6:02 a.m. UTC | #1
On Wed, 26 Jul 2023 10:14:42 +0200, Uwe Kleine-König wrote:
> Instead of resorting to BUG() ensure that the driver isn't unbound by
> suppressing its bind and unbind sysfs attributes. As the driver is
> built-in there is no way to remove a device once bound.
> 
> As a nice side effect this allows to drop the remove function.
> 
> 
> [...]

Applied to powerpc/next.

[1/1] powerpc/ep8248e: Mark driver as non removable
      https://git.kernel.org/powerpc/c/bbfa509d632946578d4f19aa2cedf1ca2f34565d

cheers
diff mbox series

Patch

diff --git a/arch/powerpc/platforms/82xx/ep8248e.c b/arch/powerpc/platforms/82xx/ep8248e.c
index 8f1856ba692e..3409cf04b630 100644
--- a/arch/powerpc/platforms/82xx/ep8248e.c
+++ b/arch/powerpc/platforms/82xx/ep8248e.c
@@ -140,12 +140,6 @@  static int ep8248e_mdio_probe(struct platform_device *ofdev)
 	return ret;
 }
 
-static int ep8248e_mdio_remove(struct platform_device *ofdev)
-{
-	BUG();
-	return 0;
-}
-
 static const struct of_device_id ep8248e_mdio_match[] = {
 	{
 		.compatible = "fsl,ep8248e-mdio-bitbang",
@@ -157,9 +151,9 @@  static struct platform_driver ep8248e_mdio_driver = {
 	.driver = {
 		.name = "ep8248e-mdio-bitbang",
 		.of_match_table = ep8248e_mdio_match,
+		.suppress_bind_attrs = true,
 	},
 	.probe = ep8248e_mdio_probe,
-	.remove = ep8248e_mdio_remove,
 };
 
 struct cpm_pin {