From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
To: maddy@linux.ibm.com, mpe@ellerman.id.au, npiggin@gmail.com,
christophe.leroy@csgroup.eu, naveen@kernel.org
Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org,
Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Subject: [PATCH 0/2] powerpc: gpio_mdio: Simplify gpio_mdio_probe()
Date: Sun, 2 Mar 2025 15:59:14 +0100 [thread overview]
Message-ID: <cover.1740926808.git.christophe.jaillet@wanadoo.fr> (raw)
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
next reply other threads:[~2025-03-02 15:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-02 14:59 Christophe JAILLET [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1740926808.git.christophe.jaillet@wanadoo.fr \
--to=christophe.jaillet@wanadoo.fr \
--cc=christophe.leroy@csgroup.eu \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=naveen@kernel.org \
--cc=npiggin@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).