Message ID | 20220915114214.3145427-5-yangyingliang@huawei.com (mailing list archive) |
---|---|
State | Accepted |
Commit | d02bb8bef4576d4511425270e61617b13ec4c387 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | net: drivers: Switch to use dev_err_probe() helper | expand |
On Thu, Sep 15, 2022 at 07:42:11PM +0800, Yang Yingliang wrote: > dev_err() can be replace with dev_err_probe() which will check if error > code is -EPROBE_DEFER. > > Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> > --- Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
diff --git a/drivers/net/dsa/lantiq_gswip.c b/drivers/net/dsa/lantiq_gswip.c index e531b93f3cb2..88f95d6e41c9 100644 --- a/drivers/net/dsa/lantiq_gswip.c +++ b/drivers/net/dsa/lantiq_gswip.c @@ -1989,11 +1989,9 @@ static int gswip_gphy_fw_probe(struct gswip_priv *priv, } gphy_fw->reset = of_reset_control_array_get_exclusive(gphy_fw_np); - if (IS_ERR(gphy_fw->reset)) { - if (PTR_ERR(gphy_fw->reset) != -EPROBE_DEFER) - dev_err(dev, "Failed to lookup gphy reset\n"); - return PTR_ERR(gphy_fw->reset); - } + if (IS_ERR(gphy_fw->reset)) + return dev_err_probe(dev, PTR_ERR(gphy_fw->reset), + "Failed to lookup gphy reset\n"); return gswip_gphy_fw_load(priv, gphy_fw); }
dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER. Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> --- drivers/net/dsa/lantiq_gswip.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)