From: Maxime Chevallier <maxime.chevallier@bootlin.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH 3/3 net-next] net: mdio: mscc-miim: Use devm_of_mdiobus_register()
Date: Fri, 15 May 2026 17:54:01 +0200 [thread overview]
Message-ID: <3e698b9d-254a-4112-9cd5-217447efc8d3@bootlin.com> (raw)
In-Reply-To: <139ebd0e3698de5e785bb0c70a4d4da43925a7ae.1778856199.git.christophe.jaillet@wanadoo.fr>
Hi,
On 5/15/26 16:50, Christophe JAILLET wrote:
> Use devm_of_mdiobus_register() instead of hand writing it.
> This saves some lines of code.
>
> The remove function can be removed completely and the
> platform_set_drvdata() call at the end of the probe is now also useless and
> can be removed as-well.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Maxime
> ---
> Compile tested only.
> ---
> drivers/net/mdio/mdio-mscc-miim.c | 12 +-----------
> 1 file changed, 1 insertion(+), 11 deletions(-)
>
> diff --git a/drivers/net/mdio/mdio-mscc-miim.c b/drivers/net/mdio/mdio-mscc-miim.c
> index 4d8f60d458b8..7bdcf3e9baa0 100644
> --- a/drivers/net/mdio/mdio-mscc-miim.c
> +++ b/drivers/net/mdio/mdio-mscc-miim.c
> @@ -322,22 +322,13 @@ static int mscc_miim_probe(struct platform_device *pdev)
> if (ret)
> return ret;
>
> - ret = of_mdiobus_register(bus, np);
> + ret = devm_of_mdiobus_register(dev, bus, np);
> if (ret < 0)
> return dev_err_probe(dev, ret, "Cannot register MDIO bus\n");
>
> - platform_set_drvdata(pdev, bus);
> -
> return 0;
> }
>
> -static void mscc_miim_remove(struct platform_device *pdev)
> -{
> - struct mii_bus *bus = platform_get_drvdata(pdev);
> -
> - mdiobus_unregister(bus);
> -}
> -
> static const struct mscc_miim_info mscc_ocelot_miim_info = {
> .phy_reset_offset = MSCC_PHY_REG_PHY_CFG,
> .phy_reset_bits = PHY_CFG_PHY_ENA | PHY_CFG_PHY_COMMON_RESET |
> @@ -363,7 +354,6 @@ MODULE_DEVICE_TABLE(of, mscc_miim_match);
>
> static struct platform_driver mscc_miim_driver = {
> .probe = mscc_miim_probe,
> - .remove = mscc_miim_remove,
> .driver = {
> .name = "mscc-miim",
> .of_match_table = mscc_miim_match,
prev parent reply other threads:[~2026-05-15 15:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-15 14:50 [PATCH 0/3] net: phy: micrel: Code clean-up Christophe JAILLET
2026-05-15 14:50 ` [PATCH 1/3 net-next] net: mdio: mscc-miim: Remove some redundant code Christophe JAILLET
2026-05-15 15:45 ` Maxime Chevallier
2026-05-15 14:50 ` [PATCH 2/3 net-next] net: mdio: mscc-miim: Use devm_clk_get_optional_enabled() Christophe JAILLET
2026-05-15 15:53 ` Maxime Chevallier
2026-05-15 14:50 ` [PATCH 3/3 net-next] net: mdio: mscc-miim: Use devm_of_mdiobus_register() Christophe JAILLET
2026-05-15 15:54 ` Maxime Chevallier [this message]
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=3e698b9d-254a-4112-9cd5-217447efc8d3@bootlin.com \
--to=maxime.chevallier@bootlin.com \
--cc=andrew@lunn.ch \
--cc=christophe.jaillet@wanadoo.fr \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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