From: Florian Fainelli <f.fainelli@gmail.com>
To: Jinjie Ruan <ruanjinjie@huawei.com>,
woojung.huh@microchip.com, andrew@lunn.ch, olteanv@gmail.com,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, linus.walleij@linaro.org,
alsi@bang-olufsen.dk, justin.chen@broadcom.com,
sebastian.hesselbarth@gmail.com, alexandre.torgue@foss.st.com,
joabreu@synopsys.com, mcoquelin.stm32@gmail.com, wens@csie.org,
jernej.skrabec@gmail.com, samuel@sholland.org,
hkallweit1@gmail.com, linux@armlinux.org.uk,
UNGLinuxDriver@microchip.com, netdev@vger.kernel.org,
bcm-kernel-feedback-list@broadcom.com,
linux-arm-kernel@lists.infradead.org,
linux-sunxi@lists.linux.dev,
linux-stm32@st-md-mailman.stormreply.com, krzk@kernel.org,
jic23@kernel.org
Subject: Re: [PATCH net-next v4 5/8] net: mdio: mux-mmioreg: Simplified with dev_err_probe()
Date: Mon, 2 Sep 2024 08:29:01 -0700 [thread overview]
Message-ID: <27a0d076-ed61-486b-b961-8a0982e7b96d@gmail.com> (raw)
In-Reply-To: <20240830031325.2406672-6-ruanjinjie@huawei.com>
On 8/29/2024 8:13 PM, Jinjie Ruan wrote:
> Use the dev_err_probe() helper to simplify code.
>
> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
> ---
> v4:
> - Remove the extra parentheses.
> v3:
> - Add Reviewed-by.
> v2:
> - Split into 2 patches.
> ---
> drivers/net/mdio/mdio-mux-mmioreg.c | 48 ++++++++++++-----------------
> 1 file changed, 20 insertions(+), 28 deletions(-)
>
> diff --git a/drivers/net/mdio/mdio-mux-mmioreg.c b/drivers/net/mdio/mdio-mux-mmioreg.c
> index 4d87e61fec7b..b70e6d1ad429 100644
> --- a/drivers/net/mdio/mdio-mux-mmioreg.c
> +++ b/drivers/net/mdio/mdio-mux-mmioreg.c
> @@ -109,30 +109,25 @@ static int mdio_mux_mmioreg_probe(struct platform_device *pdev)
> return -ENOMEM;
>
> ret = of_address_to_resource(np, 0, &res);
> - if (ret) {
> - dev_err(&pdev->dev, "could not obtain memory map for node %pOF\n",
> - np);
> - return ret;
> - }
> + if (ret)
> + return dev_err_probe(&pdev->dev, ret,
> + "could not obtain memory map for node %pOF\n", np);
Besides that one, which I don't think is even a candidate for resource
deferral in the first place given the OF platform implementation, it
does not seem to help that much to switch to dev_err_probe() other than
just combining the error message and return code in a single statement.
So it's fewer lines of codes, but it is not exactly what dev_err_probe()
was originally intended for IMHO.
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
--
Florian
next prev parent reply other threads:[~2024-09-02 15:29 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-30 3:13 [PATCH net-next v4 0/8] net: Simplified with scoped function Jinjie Ruan
2024-08-30 3:13 ` [PATCH net-next v4 1/8] net: stmmac: dwmac-sun8i: Use for_each_child_of_node_scoped() Jinjie Ruan
2024-09-02 15:26 ` Florian Fainelli
2024-08-30 3:13 ` [PATCH net-next v4 2/8] net: dsa: realtek: " Jinjie Ruan
2024-09-02 8:22 ` Linus Walleij
2024-09-02 15:26 ` Florian Fainelli
2024-08-30 3:13 ` [PATCH net-next v4 3/8] net: phy: Use for_each_available_child_of_node_scoped() Jinjie Ruan
2024-09-02 15:26 ` Florian Fainelli
2024-08-30 3:13 ` [PATCH net-next v4 4/8] net: mdio: mux-mmioreg: Simplified with scoped function Jinjie Ruan
2024-09-02 15:27 ` Florian Fainelli
2024-08-30 3:13 ` [PATCH net-next v4 5/8] net: mdio: mux-mmioreg: Simplified with dev_err_probe() Jinjie Ruan
2024-09-02 15:29 ` Florian Fainelli [this message]
2024-09-03 12:53 ` Andrew Lunn
2024-08-30 3:13 ` [PATCH net-next v4 6/8] net: mv643xx_eth: Simplify with scoped for each OF child loop Jinjie Ruan
2024-09-02 15:29 ` Florian Fainelli
2024-08-30 3:13 ` [PATCH net-next v4 7/8] net: dsa: microchip: Use scoped function to simplfy code Jinjie Ruan
2024-09-02 15:29 ` Florian Fainelli
2024-08-30 3:13 ` [PATCH net-next v4 8/8] net: bcmasp: Simplify with scoped for each OF child loop Jinjie Ruan
2024-09-03 11:00 ` [PATCH net-next v4 0/8] net: Simplified with scoped function patchwork-bot+netdevbpf
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=27a0d076-ed61-486b-b961-8a0982e7b96d@gmail.com \
--to=f.fainelli@gmail.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=alexandre.torgue@foss.st.com \
--cc=alsi@bang-olufsen.dk \
--cc=andrew@lunn.ch \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=jernej.skrabec@gmail.com \
--cc=jic23@kernel.org \
--cc=joabreu@synopsys.com \
--cc=justin.chen@broadcom.com \
--cc=krzk@kernel.org \
--cc=kuba@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=linux-sunxi@lists.linux.dev \
--cc=linux@armlinux.org.uk \
--cc=mcoquelin.stm32@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=ruanjinjie@huawei.com \
--cc=samuel@sholland.org \
--cc=sebastian.hesselbarth@gmail.com \
--cc=wens@csie.org \
--cc=woojung.huh@microchip.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