From: Lei Zhu <zhulei_szu@163.com>
To: lorenzo@kernel.org, andrew+netdev@lunn.ch, davem@davemloft.net,
edumazet@google.com, kuba@kernel.org, pabeni@redhat.com
Cc: netdev@vger.kernel.org, zhulei_szu@163.com
Subject: [PATCH net-next] net: airoha: Make use of the helper function dev_err_probe()
Date: Wed, 17 Jun 2026 17:03:02 +0800 [thread overview]
Message-ID: <20260617090302.210933-1-zhulei_szu@163.com> (raw)
From: Lei Zhu <zhulei@kylinos.cn>
Use dev_err_probe() to reduce code size and simplify the code.
Signed-off-by: Lei Zhu <zhulei@kylinos.cn>
---
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 31cdb11cd78d..189f64e83a46 100644
--- a/drivers/net/ethernet/airoha/airoha_eth.c
+++ b/drivers/net/ethernet/airoha/airoha_eth.c
@@ -3071,10 +3071,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))
@@ -3087,10 +3086,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");
xsi_rsts = devm_kcalloc(eth->dev,
eth->soc->num_xsi_rsts, sizeof(*xsi_rsts),
@@ -3105,10 +3103,9 @@ static int airoha_probe(struct platform_device *pdev)
err = devm_reset_control_bulk_get_exclusive(eth->dev,
eth->soc->num_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.25.1
reply other threads:[~2026-06-17 9:03 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260617090302.210933-1-zhulei_szu@163.com \
--to=zhulei_szu@163.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=lorenzo@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox