Skip to content

powerpc: gpio_mdio: Simplify gpio_mdio_probe()

Christophe JAILLET kernel-janitors linuxppc-dev lkml 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2powerpc: gpio_mdio: Use devm_mdiobus_alloc_size()arch/powerpc/platforms/pasemi/gpio_mdio.c+5 -210 replies
2/2powerpc: gpio_mdio: Use devm_of_mdiobus_register()arch/powerpc/platforms/pasemi/gpio_mdio.c+1 -140 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] powerpc: gpio_mdio: Simplify gpio_mdio_probe()

While wondering if it was correct to call mdiobus_free() in the remove function and only kfree() in the error handling of the probe, I arrived at the conclusion that the code could be simpler here.

Patch 1 uses mdiobus_alloc_size() instead of a hand written mdiobus_alloc() + kzalloc(). it also uses the devm_ version in order to save some LoC (and answer my initial question)

Patch 2 uses devm_of_mdiobus_register() to completly remove the .remove() function and save some more LoC.

Both patches are compile tested only.

Christophe JAILLET (2):
powerpc: gpio_mdio: Use devm_mdiobus_alloc_size()
powerpc: gpio_mdio: Use devm_of_mdiobus_register()

 arch/powerpc/platforms/pasemi/gpio_mdio.c | 41 ++++-------------------
 1 file changed, 6 insertions(+), 35 deletions(-)
Signature · 1 line
2.48.1