diff options
author | Hongbo Li <lihongbo22@huawei.com> | 2024-08-28 20:18:05 +0800 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-08-29 11:41:54 -0700 |
commit | 9023fda2f186168e45bb8e7397ad15ff17fd7bf8 (patch) | |
tree | 4042805cf91c93ca8488955bb432fff10eee8410 /drivers/net/dsa | |
parent | a41de3b12ec17dbaba443d7aa7cb481dc21aea28 (diff) | |
download | lwn-9023fda2f186168e45bb8e7397ad15ff17fd7bf8.tar.gz lwn-9023fda2f186168e45bb8e7397ad15ff17fd7bf8.zip |
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@huawei.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Alvin Šipraga <alsi@bang-olufsen.dk>
Link: https://patch.msgid.link/20240828121805.3696631-1-lihongbo22@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/dsa')
-rw-r--r-- | drivers/net/dsa/realtek/rtl83xx.c | 8 |
1 files 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)) { |