]> git.sur5r.net Git - u-boot/blobdiff - drivers/net/bcm-sf2-eth.c
dwc2 USB controller hangs with lan78xx
[u-boot] / drivers / net / bcm-sf2-eth.c
index e2747365a20b3d46389bb7384bc4c66e9de5c47c..615037f1a3f3092157f165f1983ef37e3c5a696d 100644 (file)
@@ -1,7 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright 2014 Broadcom Corporation.
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -40,7 +39,7 @@ static int bcm_sf2_eth_init(struct eth_device *dev)
 
        rc = eth->mac_init(dev);
        if (rc) {
-               error("%s: Couldn't cofigure MAC!\n", __func__);
+               pr_err("%s: Couldn't cofigure MAC!\n", __func__);
                return rc;
        }
 
@@ -90,7 +89,7 @@ static int bcm_sf2_eth_send(struct eth_device *dev, void *packet, int length)
                debug(".");
                i++;
                if (i > 20) {
-                       error("%s: Tx timeout: retried 20 times\n", __func__);
+                       pr_err("%s: Tx timeout: retried 20 times\n", __func__);
                        rc = -1;
                        break;
                }
@@ -117,7 +116,7 @@ static int bcm_sf2_eth_receive(struct eth_device *dev)
                        debug("\nNO More Rx\n");
                        break;
                } else if ((rcvlen == 0) || (rcvlen > RX_BUF_SIZE)) {
-                       error("%s: Wrong Ethernet packet size (%d B), skip!\n",
+                       pr_err("%s: Wrong Ethernet packet size (%d B), skip!\n",
                              __func__, rcvlen);
                        break;
                } else {
@@ -166,9 +165,9 @@ static int bcm_sf2_eth_open(struct eth_device *dev, bd_t *bt)
         */
        for (i = 0; i < eth->port_num; i++) {
                if (phy_startup(eth->port[i])) {
-                       error("%s: PHY %d startup failed!\n", __func__, i);
+                       pr_err("%s: PHY %d startup failed!\n", __func__, i);
                        if (i == CONFIG_BCM_SF2_ETH_DEFAULT_PORT) {
-                               error("%s: No default port %d!\n", __func__, i);
+                               pr_err("%s: No default port %d!\n", __func__, i);
                                return -1;
                        }
                }
@@ -205,13 +204,13 @@ int bcm_sf2_eth_register(bd_t *bis, u8 dev_num)
 
        dev = (struct eth_device *)malloc(sizeof(struct eth_device));
        if (dev == NULL) {
-               error("%s: Not enough memory!\n", __func__);
+               pr_err("%s: Not enough memory!\n", __func__);
                return -1;
        }
 
        eth = (struct eth_info *)malloc(sizeof(struct eth_info));
        if (eth == NULL) {
-               error("%s: Not enough memory!\n", __func__);
+               pr_err("%s: Not enough memory!\n", __func__);
                return -1;
        }
 
@@ -234,7 +233,7 @@ int bcm_sf2_eth_register(bd_t *bis, u8 dev_num)
        if (gmac_add(dev)) {
                free(eth);
                free(dev);
-               error("%s: Adding GMAC failed!\n", __func__);
+               pr_err("%s: Adding GMAC failed!\n", __func__);
                return -1;
        }
 #else
@@ -263,7 +262,7 @@ int bcm_sf2_eth_register(bd_t *bis, u8 dev_num)
 
        rc = bcm_sf2_eth_init(dev);
        if (rc != 0) {
-               error("%s: configuration failed!\n", __func__);
+               pr_err("%s: configuration failed!\n", __func__);
                return -1;
        }