[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240828121805.3696631-1-lihongbo22@huawei.com>
Date: Wed, 28 Aug 2024 20:18:05 +0800
From: Hongbo Li <lihongbo22@...wei.com>
To: <linus.walleij@...aro.org>, <alsi@...g-olufsen.dk>, <andrew@...n.ch>,
<f.fainelli@...il.com>, <olteanv@...il.com>, <davem@...emloft.net>,
<edumazet@...gle.com>, <kuba@...nel.org>, <pabeni@...hat.com>
CC: <netdev@...r.kernel.org>, <lihongbo22@...wei.com>
Subject: [PATCH net-next] net: dsa: realtek: make use of dev_err_cast_probe()
Using dev_err_cast_probe() to simplify the code.
Signed-off-by: Hongbo Li <lihongbo22@...wei.com>
---
drivers/net/dsa/realtek/rtl83xx.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/net/dsa/realtek/rtl83xx.c b/drivers/net/dsa/realtek/rtl83xx.c
index 35709a1756ae..3c5018d5e1f9 100644
--- a/drivers/net/dsa/realtek/rtl83xx.c
+++ b/drivers/net/dsa/realtek/rtl83xx.c
@@ -185,11 +185,9 @@ rtl83xx_probe(struct device *dev,
/* TODO: if power is software controlled, set up any regulators here */
priv->reset_ctl = devm_reset_control_get_optional(dev, NULL);
- if (IS_ERR(priv->reset_ctl)) {
- ret = PTR_ERR(priv->reset_ctl);
- dev_err_probe(dev, ret, "failed to get reset control\n");
- return ERR_CAST(priv->reset_ctl);
- }
+ if (IS_ERR(priv->reset_ctl))
+ return dev_err_cast_probe(dev, priv->reset_ctl,
+ "failed to get reset control\n");
priv->reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
if (IS_ERR(priv->reset)) {
--
2.34.1
Powered by blists - more mailing lists