Commit 323623a7 authored by Joe Perches's avatar Joe Perches Committed by Matthew Garrett

ibm_rtl: Use pr_fmt and pr_<level>

Remove hard coded prefixes from logging messages.
Neaten RTL_DEBUG macro and uses.
Convert __FUNCTION__ to __func__.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarMatthew Garrett <mjg@redhat.com>
parent b5a4223c
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
* *
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/module.h> #include <linux/module.h>
...@@ -69,9 +71,10 @@ struct ibm_rtl_table { ...@@ -69,9 +71,10 @@ struct ibm_rtl_table {
#define RTL_SIGNATURE 0x0000005f4c54525fULL #define RTL_SIGNATURE 0x0000005f4c54525fULL
#define RTL_MASK 0x000000ffffffffffULL #define RTL_MASK 0x000000ffffffffffULL
#define RTL_DEBUG(A, ...) do { \ #define RTL_DEBUG(fmt, ...) \
if (debug) \ do { \
pr_info("ibm-rtl: " A, ##__VA_ARGS__ ); \ if (debug) \
pr_info(fmt, ##__VA_ARGS__); \
} while (0) } while (0)
static DEFINE_MUTEX(rtl_lock); static DEFINE_MUTEX(rtl_lock);
...@@ -114,7 +117,7 @@ static int ibm_rtl_write(u8 value) ...@@ -114,7 +117,7 @@ static int ibm_rtl_write(u8 value)
int ret = 0, count = 0; int ret = 0, count = 0;
static u32 cmd_port_val; static u32 cmd_port_val;
RTL_DEBUG("%s(%d)\n", __FUNCTION__, value); RTL_DEBUG("%s(%d)\n", __func__, value);
value = value == 1 ? RTL_CMD_ENTER_PRTM : RTL_CMD_EXIT_PRTM; value = value == 1 ? RTL_CMD_ENTER_PRTM : RTL_CMD_EXIT_PRTM;
...@@ -144,8 +147,8 @@ static int ibm_rtl_write(u8 value) ...@@ -144,8 +147,8 @@ static int ibm_rtl_write(u8 value)
while (ioread8(&rtl_table->command)) { while (ioread8(&rtl_table->command)) {
msleep(10); msleep(10);
if (count++ > 500) { if (count++ > 500) {
pr_err("ibm-rtl: Hardware not responding to " pr_err("Hardware not responding to "
"mode switch request\n"); "mode switch request\n");
ret = -EIO; ret = -EIO;
break; break;
} }
...@@ -250,7 +253,7 @@ static int __init ibm_rtl_init(void) { ...@@ -250,7 +253,7 @@ static int __init ibm_rtl_init(void) {
int ret = -ENODEV, i; int ret = -ENODEV, i;
if (force) if (force)
pr_warning("ibm-rtl: module loaded by force\n"); pr_warn("module loaded by force\n");
/* first ensure that we are running on IBM HW */ /* first ensure that we are running on IBM HW */
else if (efi_enabled || !dmi_check_system(ibm_rtl_dmi_table)) else if (efi_enabled || !dmi_check_system(ibm_rtl_dmi_table))
return -ENODEV; return -ENODEV;
...@@ -295,7 +298,7 @@ static int __init ibm_rtl_init(void) { ...@@ -295,7 +298,7 @@ static int __init ibm_rtl_init(void) {
rtl_cmd_width = ioread8(&rtl_table->cmd_granularity); rtl_cmd_width = ioread8(&rtl_table->cmd_granularity);
rtl_cmd_type = ioread8(&rtl_table->cmd_address_type); rtl_cmd_type = ioread8(&rtl_table->cmd_address_type);
RTL_DEBUG("rtl_cmd_width = %u, rtl_cmd_type = %u\n", RTL_DEBUG("rtl_cmd_width = %u, rtl_cmd_type = %u\n",
rtl_cmd_width, rtl_cmd_type); rtl_cmd_width, rtl_cmd_type);
addr = ioread32(&rtl_table->cmd_port_address); addr = ioread32(&rtl_table->cmd_port_address);
RTL_DEBUG("addr = %#llx\n", (unsigned long long)addr); RTL_DEBUG("addr = %#llx\n", (unsigned long long)addr);
plen = rtl_cmd_width/sizeof(char); plen = rtl_cmd_width/sizeof(char);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment