net: ll_temac: Switch to use dev_err_probe() helper
authorYang Yingliang <yangyingliang@huawei.com>
Thu, 15 Sep 2022 11:42:14 +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/xilinx/ll_temac_main.c

index 3f6b9dfca095cf93251df3d812ac0e30cdc9b365..c090068dc60e80f79e3dbab6e6cc8512784332a8 100644 (file)
@@ -1563,16 +1563,12 @@ static int temac_probe(struct platform_device *pdev)
        }
 
        /* Error handle returned DMA RX and TX interrupts */
-       if (lp->rx_irq < 0) {
-               if (lp->rx_irq != -EPROBE_DEFER)
-                       dev_err(&pdev->dev, "could not get DMA RX irq\n");
-               return lp->rx_irq;
-       }
-       if (lp->tx_irq < 0) {
-               if (lp->tx_irq != -EPROBE_DEFER)
-                       dev_err(&pdev->dev, "could not get DMA TX irq\n");
-               return lp->tx_irq;
-       }
+       if (lp->rx_irq < 0)
+               return dev_err_probe(&pdev->dev, lp->rx_irq,
+                                    "could not get DMA RX irq\n");
+       if (lp->tx_irq < 0)
+               return dev_err_probe(&pdev->dev, lp->tx_irq,
+                                    "could not get DMA TX irq\n");
 
        if (temac_np) {
                /* Retrieve the MAC address */