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>
This commit is contained in:
Masahiro Yamada
2017-09-16 14:10:41 +09:00
committed by Tom Rini
parent b44b30260f
commit 9b643e312d
128 changed files with 560 additions and 560 deletions

View File

@@ -49,7 +49,7 @@ static int as3722_sd_enable(struct udevice *pmic, unsigned int sd)
err = pmic_clrsetbits(pmic, AS3722_SD_CONTROL, 0, 1 << sd);
if (err) {
error("failed to update SD control register: %d", err);
pr_err("failed to update SD control register: %d", err);
return err;
}
@@ -70,13 +70,13 @@ int tegra_pcie_board_init(void)
ret = as3722_sd_enable(dev, 4);
if (ret < 0) {
error("failed to enable SD4: %d\n", ret);
pr_err("failed to enable SD4: %d\n", ret);
return ret;
}
ret = as3722_sd_set_voltage(dev, 4, 0x24);
if (ret < 0) {
error("failed to set SD4 voltage: %d\n", ret);
pr_err("failed to set SD4 voltage: %d\n", ret);
return ret;
}

View File

@@ -161,7 +161,7 @@ int board_usb_init(int index, enum usb_init_type init)
samsung_get_base_usb3_phy();
if (!phy) {
error("usb3 phy not supported");
pr_err("usb3 phy not supported");
return -ENODEV;
}

View File

@@ -457,7 +457,7 @@ void draw_logo(void)
addr = panel_info.logo_addr;
if (!addr) {
error("There is no logo data.");
pr_err("There is no logo data.");
return;
}

View File

@@ -102,7 +102,7 @@ int board_mmc_init(bd_t *bis)
ret = s5p_mmc_init(0, 4);
if (ret)
error("MMC: Failed to init MMC:0.\n");
pr_err("MMC: Failed to init MMC:0.\n");
/*
* SD card (T_FLASH) detect and init
@@ -127,7 +127,7 @@ int board_mmc_init(bd_t *bis)
ret_sd = s5p_mmc_init(2, 4);
if (ret_sd)
error("MMC: Failed to init SD card (MMC:2).\n");
pr_err("MMC: Failed to init SD card (MMC:2).\n");
}
return ret & ret_sd;

View File

@@ -429,7 +429,7 @@ int exynos_power_init(void)
};
if (regulator_list_autoset(mmc_regulators, NULL, true))
error("Unable to init all mmc regulators");
pr_err("Unable to init all mmc regulators");
return 0;
}
@@ -442,7 +442,7 @@ static int s5pc210_phy_control(int on)
ret = regulator_get_by_platname("VDD_UOTG_3.0V", &dev);
if (ret) {
error("Regulator get error: %d", ret);
pr_err("Regulator get error: %d", ret);
return ret;
}
@@ -487,25 +487,25 @@ int board_usb_init(int index, enum usb_init_type init)
ret = regulator_get_by_platname("VCC_P3V3_2.85V", &dev);
if (ret) {
error("Regulator get error: %d", ret);
pr_err("Regulator get error: %d", ret);
return ret;
}
ret = regulator_set_enable(dev, true);
if (ret) {
error("Regulator %s enable setting error: %d", dev->name, ret);
pr_err("Regulator %s enable setting error: %d", dev->name, ret);
return ret;
}
ret = regulator_set_value(dev, 750000);
if (ret) {
error("Regulator %s value setting error: %d", dev->name, ret);
pr_err("Regulator %s value setting error: %d", dev->name, ret);
return ret;
}
ret = regulator_set_value(dev, 3300000);
if (ret) {
error("Regulator %s value setting error: %d", dev->name, ret);
pr_err("Regulator %s value setting error: %d", dev->name, ret);
return ret;
}
#endif