From: Lorenzo Bianconi <lorenzo@kernel.org>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org, netdev@vger.kernel.org
Subject: Re: [PATCH v3 4/4] net: airoha: Use dev_err_probe()
Date: Sat, 17 May 2025 16:09:40 +0200 [thread overview]
Message-ID: <aCiYpEVR6LqimFR9@lore-desk> (raw)
In-Reply-To: <bb64aa1ea0205329c377ad32dde46cdf5c232db9.1746715755.git.christophe.jaillet@wanadoo.fr>
[-- Attachment #1: Type: text/plain, Size: 2388 bytes --]
> Use dev_err_probe() to slightly simplify the code.
> It is less verbose, more informational and makes error logging more
> consistent in the probe.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Lorenzo Bianconi <lorenzo@kernel.org>
> ---
> Changes in v3:
> - None
>
> Changes in v2:
> - New patch
> v2: https://lore.kernel.org/all/1b67aa9ea0245325c3779d32dde46cdf5c232db9.1746715755.git.christophe.jaillet@wanadoo.fr/
>
> Compile tested only.
> ---
> drivers/net/ethernet/airoha/airoha_eth.c | 21 +++++++++------------
> 1 file changed, 9 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/net/ethernet/airoha/airoha_eth.c b/drivers/net/ethernet/airoha/airoha_eth.c
> index 2335aa59b06f..7404ee894467 100644
> --- a/drivers/net/ethernet/airoha/airoha_eth.c
> +++ b/drivers/net/ethernet/airoha/airoha_eth.c
> @@ -2896,10 +2896,9 @@ static int airoha_probe(struct platform_device *pdev)
> eth->dev = &pdev->dev;
>
> err = dma_set_mask_and_coherent(eth->dev, DMA_BIT_MASK(32));
> - if (err) {
> - dev_err(eth->dev, "failed configuring DMA mask\n");
> - return err;
> - }
> + if (err)
> + return dev_err_probe(eth->dev, err,
> + "failed configuring DMA mask\n");
>
> eth->fe_regs = devm_platform_ioremap_resource_byname(pdev, "fe");
> if (IS_ERR(eth->fe_regs))
> @@ -2912,10 +2911,9 @@ static int airoha_probe(struct platform_device *pdev)
> err = devm_reset_control_bulk_get_exclusive(eth->dev,
> ARRAY_SIZE(eth->rsts),
> eth->rsts);
> - if (err) {
> - dev_err(eth->dev, "failed to get bulk reset lines\n");
> - return err;
> - }
> + if (err)
> + return dev_err_probe(eth->dev, err,
> + "failed to get bulk reset lines\n");
>
> eth->xsi_rsts[0].id = "xsi-mac";
> eth->xsi_rsts[1].id = "hsi0-mac";
> @@ -2925,10 +2923,9 @@ static int airoha_probe(struct platform_device *pdev)
> err = devm_reset_control_bulk_get_exclusive(eth->dev,
> ARRAY_SIZE(eth->xsi_rsts),
> eth->xsi_rsts);
> - if (err) {
> - dev_err(eth->dev, "failed to get bulk xsi reset lines\n");
> - return err;
> - }
> + if (err)
> + return dev_err_probe(eth->dev, err,
> + "failed to get bulk xsi reset lines\n");
>
> eth->napi_dev = alloc_netdev_dummy(0);
> if (!eth->napi_dev)
> --
> 2.49.0
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2025-05-17 14:09 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-15 19:59 [PATCH v3 1/4] net: airoha: Fix an error handling path in airoha_alloc_gdm_port() Christophe JAILLET
2025-05-15 19:59 ` [PATCH v3 2/4] net: airoha: Fix an error handling path in airoha_probe() Christophe JAILLET
2025-05-16 20:16 ` Simon Horman
2025-05-24 8:54 ` Christophe JAILLET
2025-05-17 14:07 ` Lorenzo Bianconi
2025-05-15 19:59 ` [PATCH v3 3/4] net: airoha: Use for_each_child_of_node_scoped() Christophe JAILLET
2025-05-15 19:59 ` [PATCH v3 4/4] net: airoha: Use dev_err_probe() Christophe JAILLET
2025-05-16 20:16 ` Simon Horman
2025-05-17 14:09 ` Lorenzo Bianconi [this message]
2025-05-15 21:16 ` [PATCH v3 1/4] net: airoha: Fix an error handling path in airoha_alloc_gdm_port() Lorenzo Bianconi
2025-05-16 20:17 ` Simon Horman
2025-05-16 20:16 ` Simon Horman
2025-05-16 20:21 ` Simon Horman
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=aCiYpEVR6LqimFR9@lore-desk \
--to=lorenzo@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=christophe.jaillet@wanadoo.fr \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.