summaryrefslogtreecommitdiff
path: root/drivers/net/bcm-sf2-eth.c
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2017-09-16 05:10:41 (GMT)
committerTom Rini <trini@konsulko.com>2017-10-04 15:59:44 (GMT)
commit9b643e312d528f291966c1f30b0d90bf3b1d43dc (patch)
tree35e3780c0aabb8af73ce19a60bb8973b3f2479cd /drivers/net/bcm-sf2-eth.c
parentb44b30260ffa3dc82f4bb98b022483bb09e95353 (diff)
downloadu-boot-9b643e312d528f291966c1f30b0d90bf3b1d43dc.tar.xz
treewide: replace with error() with pr_err()
U-Boot widely uses error() as a bit noisier variant of printf(). This macro causes name conflict with the following line in include/linux/compiler-gcc.h: # define __compiletime_error(message) __attribute__((error(message))) This prevents us from using __compiletime_error(), and makes it difficult to fully sync BUILD_BUG macros with Linux. (Notice Linux's BUILD_BUG_ON_MSG is implemented by using compiletime_assert().) Let's convert error() into now treewide-available pr_err(). Done with the help of Coccinelle, excluing tools/ directory. The semantic patch I used is as follows: // <smpl> @@@@ -error +pr_err (...) // </smpl> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org> [trini: Re-run Coccinelle] Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'drivers/net/bcm-sf2-eth.c')
-rw-r--r--drivers/net/bcm-sf2-eth.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/net/bcm-sf2-eth.c b/drivers/net/bcm-sf2-eth.c
index e274736..9056f71 100644
--- a/drivers/net/bcm-sf2-eth.c
+++ b/drivers/net/bcm-sf2-eth.c
@@ -40,7 +40,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 +90,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 +117,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 +166,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 +205,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 +234,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 +263,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;
}