diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2017-09-16 05:10:41 (GMT) |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2017-10-04 15:59:44 (GMT) |
commit | 9b643e312d528f291966c1f30b0d90bf3b1d43dc (patch) | |
tree | 35e3780c0aabb8af73ce19a60bb8973b3f2479cd /drivers/ram | |
parent | b44b30260ffa3dc82f4bb98b022483bb09e95353 (diff) | |
download | u-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/ram')
-rw-r--r-- | drivers/ram/rockchip/dmc-rk3368.c | 14 | ||||
-rw-r--r-- | drivers/ram/rockchip/sdram_rk3399.c | 2 | ||||
-rw-r--r-- | drivers/ram/stm32_sdram.c | 8 |
3 files changed, 12 insertions, 12 deletions
diff --git a/drivers/ram/rockchip/dmc-rk3368.c b/drivers/ram/rockchip/dmc-rk3368.c index 7577ff0..bfcb1dd 100644 --- a/drivers/ram/rockchip/dmc-rk3368.c +++ b/drivers/ram/rockchip/dmc-rk3368.c @@ -230,7 +230,7 @@ static int memory_init(struct rk3368_ddr_pctl *pctl, tmp = get_timer(0); do { if (get_timer(tmp) > timeout_ms) { - error("%s: POWER_UP_START did not complete in %ld ms\n", + pr_err("%s: POWER_UP_START did not complete in %ld ms\n", __func__, timeout_ms); return -ETIME; } @@ -422,7 +422,7 @@ static int dfi_cfg(struct rk3368_ddr_pctl *pctl) tmp = get_timer(0); do { if (get_timer(tmp) > timeout_ms) { - error("%s: DFI init did not complete within %ld ms\n", + pr_err("%s: DFI init did not complete within %ld ms\n", __func__, timeout_ms); return -ETIME; } @@ -457,7 +457,7 @@ static int pctl_calc_timings(struct rk3368_sdram_params *params, u32 tfaw_as_ps; if (params->ddr_speed_bin != DDR3_1600K) { - error("%s: unimplemented DDR3 speed bin %d\n", + pr_err("%s: unimplemented DDR3 speed bin %d\n", __func__, params->ddr_speed_bin); return -1; } @@ -585,7 +585,7 @@ static int ddrphy_data_training(struct rk3368_ddr_pctl *pctl, tmp = get_timer(0); do { if (get_timer(tmp) > timeout_ms) { - error("%s: did not complete within %ld ms\n", + pr_err("%s: did not complete within %ld ms\n", __func__, timeout_ms); return -ETIME; } @@ -625,7 +625,7 @@ static int sdram_col_row_detect(struct udevice *dev) } if (col == 8) { - error("%s: col detect error\n", __func__); + pr_err("%s: col detect error\n", __func__); return -EINVAL; } @@ -644,7 +644,7 @@ static int sdram_col_row_detect(struct udevice *dev) } if (row == 11) { - error("%s: row detect error\n", __func__); + pr_err("%s: row detect error\n", __func__); return -EINVAL; } @@ -764,7 +764,7 @@ static int msch_niu_config(struct rk3368_msch *msch, } } - error("%s: ddrconf (NIU config) not found\n", __func__); + pr_err("%s: ddrconf (NIU config) not found\n", __func__); return -EINVAL; } diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index 5ed4b03..76c1fe8 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -551,7 +551,7 @@ static int pctl_cfg(const struct chan_info *chan, u32 channel, tmp = get_timer(0); do { if (get_timer(tmp) > timeout_ms) { - error("DRAM (%s): phy failed to lock within %ld ms\n", + pr_err("DRAM (%s): phy failed to lock within %ld ms\n", __func__, timeout_ms); return -ETIME; } diff --git a/drivers/ram/stm32_sdram.c b/drivers/ram/stm32_sdram.c index b1b0289..fdf088e 100644 --- a/drivers/ram/stm32_sdram.c +++ b/drivers/ram/stm32_sdram.c @@ -262,7 +262,7 @@ static int stm32_fmc_ofdata_to_platdata(struct udevice *dev) bank_name = (char *)ofnode_get_name(bank_node); strsep(&bank_name, "@"); if (!bank_name) { - error("missing sdram bank index"); + pr_err("missing sdram bank index"); return -EINVAL; } @@ -271,7 +271,7 @@ static int stm32_fmc_ofdata_to_platdata(struct udevice *dev) (long unsigned int *)&bank_params->target_bank); if (bank_params->target_bank >= MAX_SDRAM_BANK) { - error("Found bank %d , but only bank 0 and 1 are supported", + pr_err("Found bank %d , but only bank 0 and 1 are supported", bank_params->target_bank); return -EINVAL; } @@ -285,7 +285,7 @@ static int stm32_fmc_ofdata_to_platdata(struct udevice *dev) sizeof(struct stm32_sdram_control)); if (!params->bank_params[bank].sdram_control) { - error("st,sdram-control not found for %s", + pr_err("st,sdram-control not found for %s", ofnode_get_name(bank_node)); return -EINVAL; } @@ -298,7 +298,7 @@ static int stm32_fmc_ofdata_to_platdata(struct udevice *dev) sizeof(struct stm32_sdram_timing)); if (!params->bank_params[bank].sdram_timing) { - error("st,sdram-timing not found for %s", + pr_err("st,sdram-timing not found for %s", ofnode_get_name(bank_node)); return -EINVAL; } |