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>
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 @@
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 @@
(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 @@
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 @@
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;
}