net: stmmac: dwc-qos: Switch to use dev_err_probe() helper
authorYang Yingliang <yangyingliang@huawei.com>
Thu, 15 Sep 2022 11:42:13 +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/stmicro/stmmac/dwmac-dwc-qos-eth.c

index 358fc26f8d1fcd6b9cb17170fbb9e132162064ac..80efdeeb0b594c2be222e85e711b9bf60559af03 100644 (file)
@@ -445,9 +445,7 @@ static int dwc_eth_dwmac_probe(struct platform_device *pdev)
 
        ret = data->probe(pdev, plat_dat, &stmmac_res);
        if (ret < 0) {
-               if (ret != -EPROBE_DEFER)
-                       dev_err(&pdev->dev, "failed to probe subdriver: %d\n",
-                               ret);
+               dev_err_probe(&pdev->dev, ret, "failed to probe subdriver\n");
 
                goto remove_config;
        }