net: ethernet: ti: cpsw_new: Switch to use dev_err_probe() helper
authorYang Yingliang <yangyingliang@huawei.com>
Thu, 15 Sep 2022 11:42:10 +0000 (19:42 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 21 Sep 2022 12:50:03 +0000 (13:50 +0100)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/cpsw_new.c

index 007de15179f08629c5575be35fc4f86e1b4248f1..14fd90da32fdd5ccba0a26fc350c5fd9114ee25a 100644 (file)
@@ -1288,9 +1288,8 @@ static int cpsw_probe_dt(struct cpsw_common *cpsw)
                if (of_phy_is_fixed_link(port_np)) {
                        ret = of_phy_register_fixed_link(port_np);
                        if (ret) {
-                               if (ret != -EPROBE_DEFER)
-                                       dev_err(dev, "%pOF failed to register fixed-link phy: %d\n",
-                                               port_np, ret);
+                               dev_err_probe(dev, ret, "%pOF failed to register fixed-link phy\n",
+                                             port_np);
                                goto err_node_put;
                        }
                        slave_data->phy_node = of_node_get(port_np);