linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] powerpc: gpio_mdio: Simplify gpio_mdio_probe()
@ 2025-03-02 14:59 Christophe JAILLET
  2025-03-02 14:59 ` [PATCH 1/2] powerpc: gpio_mdio: Use devm_mdiobus_alloc_size() Christophe JAILLET
  2025-03-02 14:59 ` [PATCH 2/2] powerpc: gpio_mdio: Use devm_of_mdiobus_register() Christophe JAILLET
  0 siblings, 2 replies; 3+ messages in thread
From: Christophe JAILLET @ 2025-03-02 14:59 UTC (permalink / raw)
  To: maddy, mpe, npiggin, christophe.leroy, naveen
  Cc: linuxppc-dev, linux-kernel, kernel-janitors, Christophe JAILLET

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(-)

-- 
2.48.1



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-03-02 15:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-02 14:59 [PATCH 0/2] powerpc: gpio_mdio: Simplify gpio_mdio_probe() Christophe JAILLET
2025-03-02 14:59 ` [PATCH 1/2] powerpc: gpio_mdio: Use devm_mdiobus_alloc_size() Christophe JAILLET
2025-03-02 14:59 ` [PATCH 2/2] powerpc: gpio_mdio: Use devm_of_mdiobus_register() Christophe JAILLET

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).