Skip to content

Commit f975b65

Browse files
nathanlynchmpe
authored andcommitted
powerpc/rtas: define pr_fmt and convert printk call sites
Set pr_fmt to "rtas: " and convert the handful of printk() uses in rtas.c, adjusting the messages to remove now-redundant "RTAS" strings. Note that rtas_restart(), rtas_power_off(), and rtas_halt() all currently use printk() without specifying a log level. These have been changed to use pr_emerg(), which matches the behavior of rtas_os_term(). Signed-off-by: Nathan Lynch <[email protected]> Reviewed-by: Andrew Donnellan <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 9581f8a commit f975b65

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

arch/powerpc/kernel/rtas.c

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
* Copyright (C) 2001 IBM.
88
*/
99

10+
#define pr_fmt(fmt) "rtas: " fmt
11+
1012
#include <linux/capability.h>
1113
#include <linux/delay.h>
1214
#include <linux/export.h>
@@ -718,8 +720,7 @@ static int rtas_error_rc(int rtas_rc)
718720
rc = -ENODEV;
719721
break;
720722
default:
721-
printk(KERN_ERR "%s: unexpected RTAS error %d\n",
722-
__func__, rtas_rc);
723+
pr_err("%s: unexpected error %d\n", __func__, rtas_rc);
723724
rc = -ERANGE;
724725
break;
725726
}
@@ -923,8 +924,8 @@ void __noreturn rtas_restart(char *cmd)
923924
{
924925
if (rtas_flash_term_hook)
925926
rtas_flash_term_hook(SYS_RESTART);
926-
printk("RTAS system-reboot returned %d\n",
927-
rtas_call(rtas_token("system-reboot"), 0, 1, NULL));
927+
pr_emerg("system-reboot returned %d\n",
928+
rtas_call(rtas_token("system-reboot"), 0, 1, NULL));
928929
for (;;);
929930
}
930931

@@ -933,8 +934,8 @@ void rtas_power_off(void)
933934
if (rtas_flash_term_hook)
934935
rtas_flash_term_hook(SYS_POWER_OFF);
935936
/* allow power on only with power button press */
936-
printk("RTAS power-off returned %d\n",
937-
rtas_call(rtas_token("power-off"), 2, 1, NULL, -1, -1));
937+
pr_emerg("power-off returned %d\n",
938+
rtas_call(rtas_token("power-off"), 2, 1, NULL, -1, -1));
938939
for (;;);
939940
}
940941

@@ -943,8 +944,8 @@ void __noreturn rtas_halt(void)
943944
if (rtas_flash_term_hook)
944945
rtas_flash_term_hook(SYS_HALT);
945946
/* allow power on only with power button press */
946-
printk("RTAS power-off returned %d\n",
947-
rtas_call(rtas_token("power-off"), 2, 1, NULL, -1, -1));
947+
pr_emerg("power-off returned %d\n",
948+
rtas_call(rtas_token("power-off"), 2, 1, NULL, -1, -1));
948949
for (;;);
949950
}
950951

@@ -978,7 +979,7 @@ void rtas_os_term(char *str)
978979
} while (rtas_busy_delay_time(status));
979980

980981
if (status != 0)
981-
printk(KERN_EMERG "ibm,os-term call failed %d\n", status);
982+
pr_emerg("ibm,os-term call failed %d\n", status);
982983
}
983984

984985
/**

0 commit comments

Comments
 (0)