2011-03-29 22:22:12

by Joe Perches

[permalink] [raw]
Subject: [PATCH 00/23] drivers/platform/x86: Remove warnings and use pr_<level>

Removed a couple of compilation warnings.
Use pr_<level> consistently.

Joe Perches (23):
asus-wmi: Remove __init from asus_wmi_platform_init
ibm_rtl: Remove warnings from casts of pointer to int
acer-wmi: pr_<level> cleanups
asus: Add pr_fmt and convert printks to pr_<level>
compal-laptop: Convert printks to pr_<level>
dell: Convert printks to pr_<level>
eeepc: Use pr_warn
fujitsu-laptop: Convert printks to pr_<level>
hdaps: Convert printks to pr_<level>
hp-wmi: Convert printks to pr_<level>
ibm_rtl: Use pr_fmt and pr_<level>
ideapad-laptop: Add pr_fmt
intel_menlow: Add pr_fmt and use pr_<level>
intel_pmic_gpio: Convert printks to pr_<level>
msi-laptop: pr_<level> neatening
msi-wmi: Use pr_fmt and pr_<level>
sony-laptop: Add and use #define pr_fmt
tc1100-wmi: Add pr_fmt, use pr_<level>
thinkpad_acpi: Convert printks to pr_<level>
topstar-laptop: Convert remaining printk to pr_info
toshiba: Convert printks to pr_<level>
wmi: Removed trailing whitespace from logging message.
xo15-ebook: Use pr_<level>

drivers/platform/x86/acer-wmi.c | 32 +-
drivers/platform/x86/asus-laptop.c | 34 +-
drivers/platform/x86/asus-wmi.c | 22 +-
drivers/platform/x86/asus_acpi.c | 77 ++---
drivers/platform/x86/compal-laptop.c | 22 +-
drivers/platform/x86/dell-laptop.c | 12 +-
drivers/platform/x86/dell-wmi-aio.c | 3 +-
drivers/platform/x86/dell-wmi.c | 17 +-
drivers/platform/x86/eeepc-laptop.c | 20 +-
drivers/platform/x86/eeepc-wmi.c | 14 +-
drivers/platform/x86/fujitsu-laptop.c | 39 ++--
drivers/platform/x86/hdaps.c | 19 +-
drivers/platform/x86/hp-wmi.c | 43 +--
drivers/platform/x86/ibm_rtl.c | 23 +-
drivers/platform/x86/ideapad-laptop.c | 2 +
drivers/platform/x86/intel_menlow.c | 5 +-
drivers/platform/x86/intel_pmic_gpio.c | 14 +-
drivers/platform/x86/msi-laptop.c | 9 +-
drivers/platform/x86/msi-wmi.c | 45 ++--
drivers/platform/x86/sony-laptop.c | 104 +++----
drivers/platform/x86/tc1100-wmi.c | 7 +-
drivers/platform/x86/thinkpad_acpi.c | 471 ++++++++++++------------------
drivers/platform/x86/topstar-laptop.c | 2 +-
drivers/platform/x86/toshiba_acpi.c | 59 ++--
drivers/platform/x86/toshiba_bluetooth.c | 11 +-
drivers/platform/x86/wmi.c | 10 +-
drivers/platform/x86/xo15-ebook.c | 5 +-
27 files changed, 495 insertions(+), 626 deletions(-)

--
1.7.4.2.g597a6.dirty


2011-03-29 22:22:14

by Joe Perches

[permalink] [raw]
Subject: [PATCH 01/23] asus-wmi: Remove __init from asus_wmi_platform_init

It's used by a non-init function.

Signed-off-by: Joe Perches <[email protected]>
---
drivers/platform/x86/asus-wmi.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index efc776c..c382af6 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -1223,7 +1223,7 @@ static int asus_wmi_sysfs_init(struct platform_device *device)
/*
* Platform device
*/
-static int __init asus_wmi_platform_init(struct asus_wmi *asus)
+static int asus_wmi_platform_init(struct asus_wmi *asus)
{
int rv;

--
1.7.4.2.g597a6.dirty

2011-03-29 22:22:20

by Joe Perches

[permalink] [raw]
Subject: [PATCH 05/23] compal-laptop: Convert printks to pr_<level>

Add pr_fmt.
Convert printks to pr_<level> removing DRIVER_NAME prefix.

Signed-off-by: Joe Perches <[email protected]>
---
drivers/platform/x86/compal-laptop.c | 22 +++++++++-------------
1 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/drivers/platform/x86/compal-laptop.c b/drivers/platform/x86/compal-laptop.c
index c16a276..4c4a742 100644
--- a/drivers/platform/x86/compal-laptop.c
+++ b/drivers/platform/x86/compal-laptop.c
@@ -68,6 +68,8 @@
* only enabled on a JHL90 board until it is verified that they work on the
* other boards too. See the extra_features variable. */

+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
@@ -760,16 +762,14 @@ static struct rfkill *bt_rfkill;

static int dmi_check_cb(const struct dmi_system_id *id)
{
- printk(KERN_INFO DRIVER_NAME": Identified laptop model '%s'\n",
- id->ident);
+ pr_info("Identified laptop model '%s'\n", id->ident);
extra_features = false;
return 1;
}

static int dmi_check_cb_extra(const struct dmi_system_id *id)
{
- printk(KERN_INFO DRIVER_NAME": Identified laptop model '%s', "
- "enabling extra features\n",
+ pr_info("Identified laptop model '%s', enabling extra features\n",
id->ident);
extra_features = true;
return 1;
@@ -956,14 +956,12 @@ static int __init compal_init(void)
int ret;

if (acpi_disabled) {
- printk(KERN_ERR DRIVER_NAME": ACPI needs to be enabled for "
- "this driver to work!\n");
+ pr_err("ACPI needs to be enabled for this driver to work!\n");
return -ENODEV;
}

if (!force && !dmi_check_system(compal_dmi_table)) {
- printk(KERN_ERR DRIVER_NAME": Motherboard not recognized (You "
- "could try the module's force-parameter)");
+ pr_err("Motherboard not recognized (You could try the module's force-parameter)\n");
return -ENODEV;
}

@@ -998,8 +996,7 @@ static int __init compal_init(void)
if (ret)
goto err_rfkill;

- printk(KERN_INFO DRIVER_NAME": Driver "DRIVER_VERSION
- " successfully loaded\n");
+ pr_info("Driver " DRIVER_VERSION " successfully loaded\n");
return 0;

err_rfkill:
@@ -1064,7 +1061,7 @@ static void __exit compal_cleanup(void)
rfkill_destroy(wifi_rfkill);
rfkill_destroy(bt_rfkill);

- printk(KERN_INFO DRIVER_NAME": Driver unloaded\n");
+ pr_info("Driver unloaded\n");
}

static int __devexit compal_remove(struct platform_device *pdev)
@@ -1074,8 +1071,7 @@ static int __devexit compal_remove(struct platform_device *pdev)
if (!extra_features)
return 0;

- printk(KERN_INFO DRIVER_NAME": Unloading: resetting fan control "
- "to motherboard\n");
+ pr_info("Unloading: resetting fan control to motherboard\n");
pwm_disable_control();

data = platform_get_drvdata(pdev);
--
1.7.4.2.g597a6.dirty

2011-03-29 22:22:23

by Joe Perches

[permalink] [raw]
Subject: [PATCH 06/23] dell: Convert printks to pr_<level>

Add pr_fmt.
Remove hard coded prefixes and use pr_<level>.

Signed-off-by: Joe Perches <[email protected]>
---
drivers/platform/x86/dell-laptop.c | 12 ++++++------
drivers/platform/x86/dell-wmi-aio.c | 3 ++-
drivers/platform/x86/dell-wmi.c | 17 ++++++++---------
3 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c
index de301aa..d3841de 100644
--- a/drivers/platform/x86/dell-laptop.c
+++ b/drivers/platform/x86/dell-laptop.c
@@ -11,6 +11,8 @@
* published by the Free Software Foundation.
*/

+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
@@ -434,8 +436,7 @@ static int __init dell_setup_rfkill(void)
int ret;

if (dmi_check_system(dell_blacklist)) {
- printk(KERN_INFO "dell-laptop: Blacklisted hardware detected - "
- "not enabling rfkill\n");
+ pr_info("Blacklisted hardware detected - not enabling rfkill\n");
return 0;
}

@@ -606,7 +607,7 @@ static int __init dell_init(void)
dmi_walk(find_tokens, NULL);

if (!da_tokens) {
- printk(KERN_INFO "dell-laptop: Unable to find dmi tokens\n");
+ pr_info("Unable to find dmi tokens\n");
return -ENODEV;
}

@@ -636,14 +637,13 @@ static int __init dell_init(void)
ret = dell_setup_rfkill();

if (ret) {
- printk(KERN_WARNING "dell-laptop: Unable to setup rfkill\n");
+ pr_warn("Unable to setup rfkill\n");
goto fail_rfkill;
}

ret = i8042_install_filter(dell_laptop_i8042_filter);
if (ret) {
- printk(KERN_WARNING
- "dell-laptop: Unable to install key filter\n");
+ pr_warn("Unable to install key filter\n");
goto fail_filter;
}

diff --git a/drivers/platform/x86/dell-wmi-aio.c b/drivers/platform/x86/dell-wmi-aio.c
index 0ed8457..3f94545 100644
--- a/drivers/platform/x86/dell-wmi-aio.c
+++ b/drivers/platform/x86/dell-wmi-aio.c
@@ -15,6 +15,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/kernel.h>
@@ -138,7 +139,7 @@ static int __init dell_wmi_aio_init(void)

guid = dell_wmi_aio_find();
if (!guid) {
- pr_warning("No known WMI GUID found\n");
+ pr_warn("No known WMI GUID found\n");
return -ENXIO;
}

diff --git a/drivers/platform/x86/dell-wmi.c b/drivers/platform/x86/dell-wmi.c
index 77f1d55..ce79082 100644
--- a/drivers/platform/x86/dell-wmi.c
+++ b/drivers/platform/x86/dell-wmi.c
@@ -23,6 +23,8 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
@@ -141,7 +143,7 @@ static void dell_wmi_notify(u32 value, void *context)

status = wmi_get_event_data(value, &response);
if (status != AE_OK) {
- printk(KERN_INFO "dell-wmi: bad event status 0x%x\n", status);
+ pr_info("bad event status 0x%x\n", status);
return;
}

@@ -153,8 +155,8 @@ static void dell_wmi_notify(u32 value, void *context)
u16 *buffer_entry = (u16 *)obj->buffer.pointer;

if (dell_new_hk_type && (buffer_entry[1] != 0x10)) {
- printk(KERN_INFO "dell-wmi: Received unknown WMI event"
- " (0x%x)\n", buffer_entry[1]);
+ pr_info("Received unknown WMI event (0x%x)\n",
+ buffer_entry[1]);
kfree(obj);
return;
}
@@ -167,8 +169,7 @@ static void dell_wmi_notify(u32 value, void *context)
key = sparse_keymap_entry_from_scancode(dell_wmi_input_dev,
reported_key);
if (!key) {
- printk(KERN_INFO "dell-wmi: Unknown key %x pressed\n",
- reported_key);
+ pr_info("Unknown key %x pressed\n", reported_key);
} else if ((key->keycode == KEY_BRIGHTNESSUP ||
key->keycode == KEY_BRIGHTNESSDOWN) && acpi_video) {
/* Don't report brightness notifications that will also
@@ -275,7 +276,7 @@ static int __init dell_wmi_init(void)
acpi_status status;

if (!wmi_has_guid(DELL_EVENT_GUID)) {
- printk(KERN_WARNING "dell-wmi: No known WMI GUID found\n");
+ pr_warn("No known WMI GUID found\n");
return -ENODEV;
}

@@ -290,9 +291,7 @@ static int __init dell_wmi_init(void)
dell_wmi_notify, NULL);
if (ACPI_FAILURE(status)) {
dell_wmi_input_destroy();
- printk(KERN_ERR
- "dell-wmi: Unable to register notify handler - %d\n",
- status);
+ pr_err("Unable to register notify handler - %d\n", status);
return -ENODEV;
}

--
1.7.4.2.g597a6.dirty

2011-03-29 22:22:31

by Joe Perches

[permalink] [raw]
Subject: [PATCH 09/23] hdaps: Convert printks to pr_<level>

Added pr_fmt, converted printks and removed
hard coded prefixes.

Signed-off-by: Joe Perches <[email protected]>
---
drivers/platform/x86/hdaps.c | 19 ++++++++++---------
1 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/drivers/platform/x86/hdaps.c b/drivers/platform/x86/hdaps.c
index 067bf36..5a34973 100644
--- a/drivers/platform/x86/hdaps.c
+++ b/drivers/platform/x86/hdaps.c
@@ -26,6 +26,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/

+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/delay.h>
#include <linux/platform_device.h>
#include <linux/input-polldev.h>
@@ -238,7 +240,7 @@ static int hdaps_device_init(void)
__check_latch(0x1611, 0x01))
goto out;

- printk(KERN_DEBUG "hdaps: initial latch check good (0x%02x).\n",
+ printk(KERN_DEBUG "hdaps: initial latch check good (0x%02x)\n",
__get_latch(0x1611));

outb(0x17, 0x1610);
@@ -299,7 +301,7 @@ static int hdaps_probe(struct platform_device *dev)
if (ret)
return ret;

- printk(KERN_INFO "hdaps: device successfully initialized.\n");
+ pr_info("device successfully initialized\n");
return 0;
}

@@ -480,7 +482,7 @@ static struct attribute_group hdaps_attribute_group = {
/* hdaps_dmi_match - found a match. return one, short-circuiting the hunt. */
static int __init hdaps_dmi_match(const struct dmi_system_id *id)
{
- printk(KERN_INFO "hdaps: %s detected.\n", id->ident);
+ pr_info("%s detected\n", id->ident);
return 1;
}

@@ -488,8 +490,7 @@ static int __init hdaps_dmi_match(const struct dmi_system_id *id)
static int __init hdaps_dmi_match_invert(const struct dmi_system_id *id)
{
hdaps_invert = (unsigned long)id->driver_data;
- printk(KERN_INFO "hdaps: inverting axis (%u) readings.\n",
- hdaps_invert);
+ pr_info("inverting axis (%u) readings\n", hdaps_invert);
return hdaps_dmi_match(id);
}

@@ -543,7 +544,7 @@ static int __init hdaps_init(void)
int ret;

if (!dmi_check_system(hdaps_whitelist)) {
- printk(KERN_WARNING "hdaps: supported laptop not found!\n");
+ pr_warn("supported laptop not found!\n");
ret = -ENODEV;
goto out;
}
@@ -595,7 +596,7 @@ static int __init hdaps_init(void)
if (ret)
goto out_idev;

- printk(KERN_INFO "hdaps: driver successfully loaded.\n");
+ pr_info("driver successfully loaded\n");
return 0;

out_idev:
@@ -609,7 +610,7 @@ out_driver:
out_region:
release_region(HDAPS_LOW_PORT, HDAPS_NR_PORTS);
out:
- printk(KERN_WARNING "hdaps: driver init failed (ret=%d)!\n", ret);
+ pr_warn("driver init failed (ret=%d)!\n", ret);
return ret;
}

@@ -622,7 +623,7 @@ static void __exit hdaps_exit(void)
platform_driver_unregister(&hdaps_driver);
release_region(HDAPS_LOW_PORT, HDAPS_NR_PORTS);

- printk(KERN_INFO "hdaps: driver unloaded.\n");
+ pr_info("driver unloaded\n");
}

module_init(hdaps_init);
--
1.7.4.2.g597a6.dirty

2011-03-29 22:22:33

by Joe Perches

[permalink] [raw]
Subject: [PATCH 13/23] intel_menlow: Add pr_fmt and use pr_<level>

Add pr_fmt to prefix the logging messages.
Convert printk to pr_<level>.

Signed-off-by: Joe Perches <[email protected]>
---
drivers/platform/x86/intel_menlow.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/x86/intel_menlow.c b/drivers/platform/x86/intel_menlow.c
index eacd5da..809adea 100644
--- a/drivers/platform/x86/intel_menlow.c
+++ b/drivers/platform/x86/intel_menlow.c
@@ -27,6 +27,8 @@
* to get/set bandwidth.
*/

+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
@@ -135,8 +137,7 @@ static int memory_set_cur_bandwidth(struct thermal_cooling_device *cdev,
acpi_evaluate_integer(handle, MEMORY_SET_BANDWIDTH, &arg_list,
&temp);

- printk(KERN_INFO
- "Bandwidth value was %ld: status is %d\n", state, status);
+ pr_info("Bandwidth value was %ld: status is %d\n", state, status);
if (ACPI_FAILURE(status))
return -EFAULT;

--
1.7.4.2.g597a6.dirty

2011-03-29 22:22:42

by Joe Perches

[permalink] [raw]
Subject: [PATCH 19/23] thinkpad_acpi: Convert printks to pr_<level>

Add pr_fmt.
Removed local TPACPI_<level> #defines, convert to pr_<level>.
Neaten dbg_<foo> macros.
Added a few missing newlines to logging messages.

Signed-off-by: Joe Perches <[email protected]>
---
drivers/platform/x86/thinkpad_acpi.c | 471 ++++++++++++++--------------------
1 files changed, 187 insertions(+), 284 deletions(-)

diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index a08561f..f6e6e0b 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -21,6 +21,8 @@
* 02110-1301, USA.
*/

+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#define TPACPI_VERSION "0.24"
#define TPACPI_SYSFS_VERSION 0x020700

@@ -223,17 +225,6 @@ enum tpacpi_hkey_event_t {

#define TPACPI_MAX_ACPI_ARGS 3

-/* printk headers */
-#define TPACPI_LOG TPACPI_FILE ": "
-#define TPACPI_EMERG KERN_EMERG TPACPI_LOG
-#define TPACPI_ALERT KERN_ALERT TPACPI_LOG
-#define TPACPI_CRIT KERN_CRIT TPACPI_LOG
-#define TPACPI_ERR KERN_ERR TPACPI_LOG
-#define TPACPI_WARN KERN_WARNING TPACPI_LOG
-#define TPACPI_NOTICE KERN_NOTICE TPACPI_LOG
-#define TPACPI_INFO KERN_INFO TPACPI_LOG
-#define TPACPI_DEBUG KERN_DEBUG TPACPI_LOG
-
/* Debugging printk groups */
#define TPACPI_DBG_ALL 0xffff
#define TPACPI_DBG_DISCLOSETASK 0x8000
@@ -388,34 +379,35 @@ static int tpacpi_uwb_emulstate;
* Debugging helpers
*/

-#define dbg_printk(a_dbg_level, format, arg...) \
- do { if (dbg_level & (a_dbg_level)) \
- printk(TPACPI_DEBUG "%s: " format, __func__ , ## arg); \
- } while (0)
+#define dbg_printk(a_dbg_level, format, arg...) \
+do { \
+ if (dbg_level & (a_dbg_level)) \
+ printk(KERN_DEBUG pr_fmt("%s: " format), \
+ __func__, ##arg); \
+} while (0)

#ifdef CONFIG_THINKPAD_ACPI_DEBUG
#define vdbg_printk dbg_printk
static const char *str_supported(int is_supported);
#else
-#define vdbg_printk(a_dbg_level, format, arg...) \
- do { } while (0)
+#define vdbg_printk(a_dbg_level, format, arg...) \
+ no_printk(format, ##arg)
#endif

static void tpacpi_log_usertask(const char * const what)
{
- printk(TPACPI_DEBUG "%s: access by process with PID %d\n",
- what, task_tgid_vnr(current));
+ printk(KERN_DEBUG pr_fmt("%s: access by process with PID %d\n"),
+ what, task_tgid_vnr(current));
}

-#define tpacpi_disclose_usertask(what, format, arg...) \
- do { \
- if (unlikely( \
- (dbg_level & TPACPI_DBG_DISCLOSETASK) && \
- (tpacpi_lifecycle == TPACPI_LIFE_RUNNING))) { \
- printk(TPACPI_DEBUG "%s: PID %d: " format, \
- what, task_tgid_vnr(current), ## arg); \
- } \
- } while (0)
+#define tpacpi_disclose_usertask(what, format, arg...) \
+do { \
+ if (unlikely((dbg_level & TPACPI_DBG_DISCLOSETASK) && \
+ (tpacpi_lifecycle == TPACPI_LIFE_RUNNING))) { \
+ printk(KERN_DEBUG pr_fmt("%s: PID %d: " format), \
+ what, task_tgid_vnr(current), ## arg); \
+ } \
+} while (0)

/*
* Quirk handling helpers
@@ -562,7 +554,7 @@ static int acpi_evalf(acpi_handle handle,
int quiet;

if (!*fmt) {
- printk(TPACPI_ERR "acpi_evalf() called with empty format\n");
+ pr_err("acpi_evalf() called with empty format\n");
return 0;
}

@@ -587,7 +579,7 @@ static int acpi_evalf(acpi_handle handle,
break;
/* add more types as needed */
default:
- printk(TPACPI_ERR "acpi_evalf() called "
+ pr_err("acpi_evalf() called "
"with invalid format character '%c'\n", c);
va_end(ap);
return 0;
@@ -616,13 +608,13 @@ static int acpi_evalf(acpi_handle handle,
break;
/* add more types as needed */
default:
- printk(TPACPI_ERR "acpi_evalf() called "
+ pr_err("acpi_evalf() called "
"with invalid format character '%c'\n", res_type);
return 0;
}

if (!success && !quiet)
- printk(TPACPI_ERR "acpi_evalf(%s, %s, ...) failed: %s\n",
+ pr_err("acpi_evalf(%s, %s, ...) failed: %s\n",
method, fmt0, acpi_format_exception(status));

return success;
@@ -766,8 +758,7 @@ static int __init setup_acpi_notify(struct ibm_struct *ibm)

rc = acpi_bus_get_device(*ibm->acpi->handle, &ibm->acpi->device);
if (rc < 0) {
- printk(TPACPI_ERR "acpi_bus_get_device(%s) failed: %d\n",
- ibm->name, rc);
+ pr_err("acpi_bus_get_device(%s) failed: %d\n", ibm->name, rc);
return -ENODEV;
}

@@ -780,12 +771,10 @@ static int __init setup_acpi_notify(struct ibm_struct *ibm)
ibm->acpi->type, dispatch_acpi_notify, ibm);
if (ACPI_FAILURE(status)) {
if (status == AE_ALREADY_EXISTS) {
- printk(TPACPI_NOTICE
- "another device driver is already "
- "handling %s events\n", ibm->name);
+ pr_notice("another device driver is already "
+ "handling %s events\n", ibm->name);
} else {
- printk(TPACPI_ERR
- "acpi_install_notify_handler(%s) failed: %s\n",
+ pr_err("acpi_install_notify_handler(%s) failed: %s\n",
ibm->name, acpi_format_exception(status));
}
return -ENODEV;
@@ -810,8 +799,7 @@ static int __init register_tpacpi_subdriver(struct ibm_struct *ibm)

ibm->acpi->driver = kzalloc(sizeof(struct acpi_driver), GFP_KERNEL);
if (!ibm->acpi->driver) {
- printk(TPACPI_ERR
- "failed to allocate memory for ibm->acpi->driver\n");
+ pr_err("failed to allocate memory for ibm->acpi->driver\n");
return -ENOMEM;
}

@@ -822,7 +810,7 @@ static int __init register_tpacpi_subdriver(struct ibm_struct *ibm)

rc = acpi_bus_register_driver(ibm->acpi->driver);
if (rc < 0) {
- printk(TPACPI_ERR "acpi_bus_register_driver(%s) failed: %d\n",
+ pr_err("acpi_bus_register_driver(%s) failed: %d\n",
ibm->name, rc);
kfree(ibm->acpi->driver);
ibm->acpi->driver = NULL;
@@ -1080,15 +1068,14 @@ static int parse_strtoul(const char *buf,
static void tpacpi_disable_brightness_delay(void)
{
if (acpi_evalf(hkey_handle, NULL, "PWMS", "qvd", 0))
- printk(TPACPI_NOTICE
- "ACPI backlight control delay disabled\n");
+ pr_notice("ACPI backlight control delay disabled\n");
}

static void printk_deprecated_attribute(const char * const what,
const char * const details)
{
tpacpi_log_usertask("deprecated sysfs attribute");
- printk(TPACPI_WARN "WARNING: sysfs attribute %s is deprecated and "
+ pr_warn("WARNING: sysfs attribute %s is deprecated and "
"will be removed. %s\n",
what, details);
}
@@ -1263,8 +1250,7 @@ static int __init tpacpi_new_rfkill(const enum tpacpi_rfk_id id,
&tpacpi_rfk_rfkill_ops,
atp_rfk);
if (!atp_rfk || !atp_rfk->rfkill) {
- printk(TPACPI_ERR
- "failed to allocate memory for rfkill class\n");
+ pr_err("failed to allocate memory for rfkill class\n");
kfree(atp_rfk);
return -ENOMEM;
}
@@ -1274,9 +1260,8 @@ static int __init tpacpi_new_rfkill(const enum tpacpi_rfk_id id,

sw_status = (tp_rfkops->get_status)();
if (sw_status < 0) {
- printk(TPACPI_ERR
- "failed to read initial state for %s, error %d\n",
- name, sw_status);
+ pr_err("failed to read initial state for %s, error %d\n",
+ name, sw_status);
} else {
sw_state = (sw_status == TPACPI_RFK_RADIO_OFF);
if (set_default) {
@@ -1290,9 +1275,7 @@ static int __init tpacpi_new_rfkill(const enum tpacpi_rfk_id id,

res = rfkill_register(atp_rfk->rfkill);
if (res < 0) {
- printk(TPACPI_ERR
- "failed to register %s rfkill switch: %d\n",
- name, res);
+ pr_err("failed to register %s rfkill switch: %d\n", name, res);
rfkill_destroy(atp_rfk->rfkill);
kfree(atp_rfk);
return res;
@@ -1300,7 +1283,7 @@ static int __init tpacpi_new_rfkill(const enum tpacpi_rfk_id id,

tpacpi_rfkill_switches[id] = atp_rfk;

- printk(TPACPI_INFO "rfkill switch %s: radio is %sblocked\n",
+ pr_info("rfkill switch %s: radio is %sblocked\n",
name, (sw_state || hw_state) ? "" : "un");
return 0;
}
@@ -1824,10 +1807,8 @@ static void __init tpacpi_check_outdated_fw(void)
* broken, or really stable to begin with, so it is
* best if the user upgrades the firmware anyway.
*/
- printk(TPACPI_WARN
- "WARNING: Outdated ThinkPad BIOS/EC firmware\n");
- printk(TPACPI_WARN
- "WARNING: This firmware may be missing critical bug "
+ pr_warn("WARNING: Outdated ThinkPad BIOS/EC firmware\n");
+ pr_warn("WARNING: This firmware may be missing critical bug "
"fixes and/or important features\n");
}
}
@@ -2116,9 +2097,7 @@ void static hotkey_mask_warn_incomplete_mask(void)
(hotkey_all_mask | TPACPI_HKEY_NVRAM_KNOWN_MASK);

if (wantedmask)
- printk(TPACPI_NOTICE
- "required events 0x%08x not enabled!\n",
- wantedmask);
+ pr_notice("required events 0x%08x not enabled!\n", wantedmask);
}

/*
@@ -2156,10 +2135,9 @@ static int hotkey_mask_set(u32 mask)
* a given event.
*/
if (!hotkey_mask_get() && !rc && (fwmask & ~hotkey_acpi_mask)) {
- printk(TPACPI_NOTICE
- "asked for hotkey mask 0x%08x, but "
- "firmware forced it to 0x%08x\n",
- fwmask, hotkey_acpi_mask);
+ pr_notice("asked for hotkey mask 0x%08x, but "
+ "firmware forced it to 0x%08x\n",
+ fwmask, hotkey_acpi_mask);
}

if (tpacpi_lifecycle != TPACPI_LIFE_EXITING)
@@ -2183,13 +2161,11 @@ static int hotkey_user_mask_set(const u32 mask)
(mask == 0xffff || mask == 0xffffff ||
mask == 0xffffffff)) {
tp_warned.hotkey_mask_ff = 1;
- printk(TPACPI_NOTICE
- "setting the hotkey mask to 0x%08x is likely "
- "not the best way to go about it\n", mask);
- printk(TPACPI_NOTICE
- "please consider using the driver defaults, "
- "and refer to up-to-date thinkpad-acpi "
- "documentation\n");
+ pr_notice("setting the hotkey mask to 0x%08x is likely "
+ "not the best way to go about it\n", mask);
+ pr_notice("please consider using the driver defaults, "
+ "and refer to up-to-date thinkpad-acpi "
+ "documentation\n");
}

/* Try to enable what the user asked for, plus whatever we need.
@@ -2573,8 +2549,7 @@ static void hotkey_poll_setup(const bool may_warn)
NULL, TPACPI_NVRAM_KTHREAD_NAME);
if (IS_ERR(tpacpi_hotkey_task)) {
tpacpi_hotkey_task = NULL;
- printk(TPACPI_ERR
- "could not create kernel thread "
+ pr_err("could not create kernel thread "
"for hotkey polling\n");
}
}
@@ -2582,11 +2557,10 @@ static void hotkey_poll_setup(const bool may_warn)
hotkey_poll_stop_sync();
if (may_warn && (poll_driver_mask || poll_user_mask) &&
hotkey_poll_freq == 0) {
- printk(TPACPI_NOTICE
- "hot keys 0x%08x and/or events 0x%08x "
- "require polling, which is currently "
- "disabled\n",
- poll_user_mask, poll_driver_mask);
+ pr_notice("hot keys 0x%08x and/or events 0x%08x "
+ "require polling, which is currently "
+ "disabled\n",
+ poll_user_mask, poll_driver_mask);
}
}
}
@@ -2810,13 +2784,13 @@ static ssize_t hotkey_source_mask_store(struct device *dev,
mutex_unlock(&hotkey_mutex);

if (rc < 0)
- printk(TPACPI_ERR "hotkey_source_mask: failed to update the"
- "firmware event mask!\n");
+ pr_err("hotkey_source_mask: "
+ "failed to update the firmware event mask!\n");

if (r_ev)
- printk(TPACPI_NOTICE "hotkey_source_mask: "
- "some important events were disabled: "
- "0x%04x\n", r_ev);
+ pr_notice("hotkey_source_mask: "
+ "some important events were disabled: 0x%04x\n",
+ r_ev);

tpacpi_disclose_usertask("hotkey_source_mask", "set to 0x%08lx\n", t);

@@ -3047,8 +3021,7 @@ static void hotkey_exit(void)
if (((tp_features.hotkey_mask &&
hotkey_mask_set(hotkey_orig_mask)) |
hotkey_status_set(false)) != 0)
- printk(TPACPI_ERR
- "failed to restore hot key mask "
+ pr_err("failed to restore hot key mask "
"to BIOS defaults\n");
}

@@ -3287,10 +3260,9 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
for HKEY interface version 0x100 */
if (acpi_evalf(hkey_handle, &hkeyv, "MHKV", "qd")) {
if ((hkeyv >> 8) != 1) {
- printk(TPACPI_ERR "unknown version of the "
- "HKEY interface: 0x%x\n", hkeyv);
- printk(TPACPI_ERR "please report this to %s\n",
- TPACPI_MAIL);
+ pr_err("unknown version of the HKEY interface: 0x%x\n",
+ hkeyv);
+ pr_err("please report this to %s\n", TPACPI_MAIL);
} else {
/*
* MHKV 0x100 in A31, R40, R40e,
@@ -3303,8 +3275,7 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
/* Paranoia check AND init hotkey_all_mask */
if (!acpi_evalf(hkey_handle, &hotkey_all_mask,
"MHKA", "qd")) {
- printk(TPACPI_ERR
- "missing MHKA handler, "
+ pr_err("missing MHKA handler, "
"please report this to %s\n",
TPACPI_MAIL);
/* Fallback: pre-init for FN+F3,F4,F12 */
@@ -3342,16 +3313,14 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
if (dbg_wlswemul) {
tp_features.hotkey_wlsw = 1;
radiosw_state = !!tpacpi_wlsw_emulstate;
- printk(TPACPI_INFO
- "radio switch emulation enabled\n");
+ pr_info("radio switch emulation enabled\n");
} else
#endif
/* Not all thinkpads have a hardware radio switch */
if (acpi_evalf(hkey_handle, &status, "WLSW", "qd")) {
tp_features.hotkey_wlsw = 1;
radiosw_state = !!status;
- printk(TPACPI_INFO
- "radio switch found; radios are %s\n",
+ pr_info("radio switch found; radios are %s\n",
enabled(status, 0));
}
if (tp_features.hotkey_wlsw)
@@ -3362,8 +3331,7 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
if (!res && acpi_evalf(hkey_handle, &status, "MHKG", "qd")) {
tp_features.hotkey_tablet = 1;
tabletsw_state = !!(status & TP_HOTKEY_TABLET_MASK);
- printk(TPACPI_INFO
- "possible tablet mode switch found; "
+ pr_info("possible tablet mode switch found; "
"ThinkPad in %s mode\n",
(tabletsw_state) ? "tablet" : "laptop");
res = add_to_attr_set(hotkey_dev_attributes,
@@ -3381,8 +3349,7 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
hotkey_keycode_map = kmalloc(TPACPI_HOTKEY_MAP_SIZE,
GFP_KERNEL);
if (!hotkey_keycode_map) {
- printk(TPACPI_ERR
- "failed to allocate memory for key map\n");
+ pr_err("failed to allocate memory for key map\n");
res = -ENOMEM;
goto err_exit;
}
@@ -3425,13 +3392,11 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
* userspace. tpacpi_detect_brightness_capabilities() must have
* been called before this point */
if (tp_features.bright_acpimode && acpi_video_backlight_support()) {
- printk(TPACPI_INFO
- "This ThinkPad has standard ACPI backlight "
- "brightness control, supported by the ACPI "
- "video driver\n");
- printk(TPACPI_NOTICE
- "Disabling thinkpad-acpi brightness events "
- "by default...\n");
+ pr_info("This ThinkPad has standard ACPI backlight "
+ "brightness control, supported by the ACPI "
+ "video driver\n");
+ pr_notice("Disabling thinkpad-acpi brightness events "
+ "by default...\n");

/* Disable brightness up/down on Lenovo thinkpads when
* ACPI is handling them, otherwise it is plain impossible
@@ -3538,8 +3503,7 @@ static bool hotkey_notify_wakeup(const u32 hkey,

case TP_HKEY_EV_WKUP_S3_BATLOW: /* Battery on critical low level/S3 */
case TP_HKEY_EV_WKUP_S4_BATLOW: /* Battery on critical low level/S4 */
- printk(TPACPI_ALERT
- "EMERGENCY WAKEUP: battery almost empty\n");
+ pr_alert("EMERGENCY WAKEUP: battery almost empty\n");
/* how to auto-heal: */
/* 2313: woke up from S3, go to S4/S5 */
/* 2413: woke up from S4, go to S5 */
@@ -3550,9 +3514,7 @@ static bool hotkey_notify_wakeup(const u32 hkey,
}

if (hotkey_wakeup_reason != TP_ACPI_WAKEUP_NONE) {
- printk(TPACPI_INFO
- "woke up due to a hot-unplug "
- "request...\n");
+ pr_info("woke up due to a hot-unplug request...\n");
hotkey_wakeup_reason_notify_change();
}
return true;
@@ -3604,37 +3566,31 @@ static bool hotkey_notify_thermal(const u32 hkey,

switch (hkey) {
case TP_HKEY_EV_THM_TABLE_CHANGED:
- printk(TPACPI_INFO
- "EC reports that Thermal Table has changed\n");
+ pr_info("EC reports that Thermal Table has changed\n");
/* recommended action: do nothing, we don't have
* Lenovo ATM information */
return true;
case TP_HKEY_EV_ALARM_BAT_HOT:
- printk(TPACPI_CRIT
- "THERMAL ALARM: battery is too hot!\n");
+ pr_crit("THERMAL ALARM: battery is too hot!\n");
/* recommended action: warn user through gui */
break;
case TP_HKEY_EV_ALARM_BAT_XHOT:
- printk(TPACPI_ALERT
- "THERMAL EMERGENCY: battery is extremely hot!\n");
+ pr_alert("THERMAL EMERGENCY: battery is extremely hot!\n");
/* recommended action: immediate sleep/hibernate */
break;
case TP_HKEY_EV_ALARM_SENSOR_HOT:
- printk(TPACPI_CRIT
- "THERMAL ALARM: "
+ pr_crit("THERMAL ALARM: "
"a sensor reports something is too hot!\n");
/* recommended action: warn user through gui, that */
/* some internal component is too hot */
break;
case TP_HKEY_EV_ALARM_SENSOR_XHOT:
- printk(TPACPI_ALERT
- "THERMAL EMERGENCY: "
- "a sensor reports something is extremely hot!\n");
+ pr_alert("THERMAL EMERGENCY: "
+ "a sensor reports something is extremely hot!\n");
/* recommended action: immediate sleep/hibernate */
break;
default:
- printk(TPACPI_ALERT
- "THERMAL ALERT: unknown thermal alarm received\n");
+ pr_alert("THERMAL ALERT: unknown thermal alarm received\n");
known = false;
}

@@ -3651,8 +3607,7 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
bool known_ev;

if (event != 0x80) {
- printk(TPACPI_ERR
- "unknown HKEY notification event %d\n", event);
+ pr_err("unknown HKEY notification event %d\n", event);
/* forward it to userspace, maybe it knows how to handle it */
acpi_bus_generate_netlink_event(
ibm->acpi->device->pnp.device_class,
@@ -3663,7 +3618,7 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)

while (1) {
if (!acpi_evalf(hkey_handle, &hkey, "MHKP", "d")) {
- printk(TPACPI_ERR "failed to retrieve HKEY event\n");
+ pr_err("failed to retrieve HKEY event\n");
return;
}

@@ -3691,8 +3646,7 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
switch (hkey) {
case TP_HKEY_EV_BAYEJ_ACK:
hotkey_autosleep_ack = 1;
- printk(TPACPI_INFO
- "bay ejected\n");
+ pr_info("bay ejected\n");
hotkey_wakeup_hotunplug_complete_notify_change();
known_ev = true;
break;
@@ -3708,8 +3662,7 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
/* 0x4000-0x4FFF: dock-related wakeups */
if (hkey == TP_HKEY_EV_UNDOCK_ACK) {
hotkey_autosleep_ack = 1;
- printk(TPACPI_INFO
- "undocked\n");
+ pr_info("undocked\n");
hotkey_wakeup_hotunplug_complete_notify_change();
known_ev = true;
} else {
@@ -3740,11 +3693,9 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
known_ev = false;
}
if (!known_ev) {
- printk(TPACPI_NOTICE
- "unhandled HKEY event 0x%04x\n", hkey);
- printk(TPACPI_NOTICE
- "please report the conditions when this "
- "event happened to %s\n", TPACPI_MAIL);
+ pr_notice("unhandled HKEY event 0x%04x\n", hkey);
+ pr_notice("please report the conditions when this "
+ "event happened to %s\n", TPACPI_MAIL);
}

/* Legacy events */
@@ -3777,8 +3728,7 @@ static void hotkey_resume(void)

if (hotkey_status_set(true) < 0 ||
hotkey_mask_set(hotkey_acpi_mask) < 0)
- printk(TPACPI_ERR
- "error while attempting to reset the event "
+ pr_err("error while attempting to reset the event "
"firmware interface\n");

tpacpi_send_radiosw_update();
@@ -3823,14 +3773,12 @@ static void hotkey_enabledisable_warn(bool enable)
{
tpacpi_log_usertask("procfs hotkey enable/disable");
if (!WARN((tpacpi_lifecycle == TPACPI_LIFE_RUNNING || !enable),
- TPACPI_WARN
- "hotkey enable/disable functionality has been "
- "removed from the driver. Hotkeys are always "
- "enabled\n"))
- printk(TPACPI_ERR
- "Please remove the hotkey=enable module "
- "parameter, it is deprecated. Hotkeys are always "
- "enabled\n");
+ pr_fmt("hotkey enable/disable functionality has been "
+ "removed from the driver. "
+ "Hotkeys are always enabled.\n")))
+ pr_err("Please remove the hotkey=enable module "
+ "parameter, it is deprecated. "
+ "Hotkeys are always enabled.\n");
}

static int hotkey_write(char *buf)
@@ -4009,8 +3957,7 @@ static void bluetooth_shutdown(void)
/* Order firmware to save current state to NVRAM */
if (!acpi_evalf(NULL, NULL, "\\BLTH", "vd",
TP_ACPI_BLTH_SAVE_STATE))
- printk(TPACPI_NOTICE
- "failed to save bluetooth state to NVRAM\n");
+ pr_notice("failed to save bluetooth state to NVRAM\n");
else
vdbg_printk(TPACPI_DBG_RFKILL,
"bluestooth state saved to NVRAM\n");
@@ -4049,8 +3996,7 @@ static int __init bluetooth_init(struct ibm_init_struct *iibm)
#ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES
if (dbg_bluetoothemul) {
tp_features.bluetooth = 1;
- printk(TPACPI_INFO
- "bluetooth switch emulation enabled\n");
+ pr_info("bluetooth switch emulation enabled\n");
} else
#endif
if (tp_features.bluetooth &&
@@ -4201,8 +4147,7 @@ static void wan_shutdown(void)
/* Order firmware to save current state to NVRAM */
if (!acpi_evalf(NULL, NULL, "\\WGSV", "vd",
TP_ACPI_WGSV_SAVE_STATE))
- printk(TPACPI_NOTICE
- "failed to save WWAN state to NVRAM\n");
+ pr_notice("failed to save WWAN state to NVRAM\n");
else
vdbg_printk(TPACPI_DBG_RFKILL,
"WWAN state saved to NVRAM\n");
@@ -4239,8 +4184,7 @@ static int __init wan_init(struct ibm_init_struct *iibm)
#ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES
if (dbg_wwanemul) {
tp_features.wan = 1;
- printk(TPACPI_INFO
- "wwan switch emulation enabled\n");
+ pr_info("wwan switch emulation enabled\n");
} else
#endif
if (tp_features.wan &&
@@ -4380,8 +4324,7 @@ static int __init uwb_init(struct ibm_init_struct *iibm)
#ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES
if (dbg_uwbemul) {
tp_features.uwb = 1;
- printk(TPACPI_INFO
- "uwb switch emulation enabled\n");
+ pr_info("uwb switch emulation enabled\n");
} else
#endif
if (tp_features.uwb &&
@@ -4485,7 +4428,7 @@ static void video_exit(void)
dbg_printk(TPACPI_DBG_EXIT,
"restoring original video autoswitch mode\n");
if (video_autosw_set(video_orig_autosw))
- printk(TPACPI_ERR "error while trying to restore original "
+ pr_err("error while trying to restore original "
"video autoswitch mode\n");
}

@@ -4558,8 +4501,7 @@ static int video_outputsw_set(int status)
res = acpi_evalf(vid_handle, NULL,
"ASWT", "vdd", status * 0x100, 0);
if (!autosw && video_autosw_set(autosw)) {
- printk(TPACPI_ERR
- "video auto-switch left enabled due to error\n");
+ pr_err("video auto-switch left enabled due to error\n");
return -EIO;
}
break;
@@ -4628,8 +4570,7 @@ static int video_outputsw_cycle(void)
return -ENOSYS;
}
if (!autosw && video_autosw_set(autosw)) {
- printk(TPACPI_ERR
- "video auto-switch left enabled due to error\n");
+ pr_err("video auto-switch left enabled due to error\n");
return -EIO;
}

@@ -5346,7 +5287,7 @@ static int __init led_init(struct ibm_init_struct *iibm)
tpacpi_leds = kzalloc(sizeof(*tpacpi_leds) * TPACPI_LED_NUMLEDS,
GFP_KERNEL);
if (!tpacpi_leds) {
- printk(TPACPI_ERR "Out of memory for LED data\n");
+ pr_err("Out of memory for LED data\n");
return -ENOMEM;
}

@@ -5365,9 +5306,8 @@ static int __init led_init(struct ibm_init_struct *iibm)
}

#ifdef CONFIG_THINKPAD_ACPI_UNSAFE_LEDS
- printk(TPACPI_NOTICE
- "warning: userspace override of important "
- "firmware LEDs is enabled\n");
+ pr_notice("warning: userspace override of important "
+ "firmware LEDs is enabled\n");
#endif
return 0;
}
@@ -5637,17 +5577,16 @@ static void thermal_dump_all_sensors(void)
if (n <= 0)
return;

- printk(TPACPI_NOTICE
- "temperatures (Celsius):");
+ pr_notice("temperatures (Celsius):");

for (i = 0; i < n; i++) {
if (t.temp[i] != TPACPI_THERMAL_SENSOR_NA)
- printk(KERN_CONT " %d", (int)(t.temp[i] / 1000));
+ pr_cont(" %d", (int)(t.temp[i] / 1000));
else
- printk(KERN_CONT " N/A");
+ pr_cont(" N/A");
}

- printk(KERN_CONT "\n");
+ pr_cont("\n");
}

/* sysfs temp##_input -------------------------------------------------- */
@@ -5767,14 +5706,12 @@ static int __init thermal_init(struct ibm_init_struct *iibm)
if (ta1 == 0) {
/* This is sheer paranoia, but we handle it anyway */
if (acpi_tmp7) {
- printk(TPACPI_ERR
- "ThinkPad ACPI EC access misbehaving, "
+ pr_err("ThinkPad ACPI EC access misbehaving, "
"falling back to ACPI TMPx access "
"mode\n");
thermal_read_mode = TPACPI_THERMAL_ACPI_TMP07;
} else {
- printk(TPACPI_ERR
- "ThinkPad ACPI EC access misbehaving, "
+ pr_err("ThinkPad ACPI EC access misbehaving, "
"disabling thermal sensors access\n");
thermal_read_mode = TPACPI_THERMAL_NONE;
}
@@ -6127,8 +6064,8 @@ static int __init tpacpi_query_bcl_levels(acpi_handle handle)
if (ACPI_SUCCESS(acpi_evaluate_object(handle, "_BCL", NULL, &buffer))) {
obj = (union acpi_object *)buffer.pointer;
if (!obj || (obj->type != ACPI_TYPE_PACKAGE)) {
- printk(TPACPI_ERR "Unknown _BCL data, "
- "please report this to %s\n", TPACPI_MAIL);
+ pr_err("Unknown _BCL data, please report this to %s\n",
+ TPACPI_MAIL);
rc = 0;
} else {
rc = obj->package.count;
@@ -6212,18 +6149,15 @@ static void __init tpacpi_detect_brightness_capabilities(void)
switch (b) {
case 16:
bright_maxlvl = 15;
- printk(TPACPI_INFO
- "detected a 16-level brightness capable ThinkPad\n");
+ pr_info("detected a 16-level brightness capable ThinkPad\n");
break;
case 8:
case 0:
bright_maxlvl = 7;
- printk(TPACPI_INFO
- "detected a 8-level brightness capable ThinkPad\n");
+ pr_info("detected a 8-level brightness capable ThinkPad\n");
break;
default:
- printk(TPACPI_ERR
- "Unsupported brightness interface, "
+ pr_err("Unsupported brightness interface, "
"please contact %s\n", TPACPI_MAIL);
tp_features.bright_unkfw = 1;
bright_maxlvl = b - 1;
@@ -6258,22 +6192,19 @@ static int __init brightness_init(struct ibm_init_struct *iibm)

if (acpi_video_backlight_support()) {
if (brightness_enable > 1) {
- printk(TPACPI_INFO
- "Standard ACPI backlight interface "
- "available, not loading native one.\n");
+ pr_info("Standard ACPI backlight interface "
+ "available, not loading native one\n");
return 1;
} else if (brightness_enable == 1) {
- printk(TPACPI_WARN
- "Cannot enable backlight brightness support, "
+ pr_warn("Cannot enable backlight brightness support, "
"ACPI is already handling it. Refer to the "
- "acpi_backlight kernel parameter\n");
+ "acpi_backlight kernel parameter.\n");
return 1;
}
} else if (tp_features.bright_acpimode && brightness_enable > 1) {
- printk(TPACPI_NOTICE
- "Standard ACPI backlight interface not "
- "available, thinkpad_acpi native "
- "brightness control enabled\n");
+ pr_notice("Standard ACPI backlight interface not "
+ "available, thinkpad_acpi native "
+ "brightness control enabled\n");
}

/*
@@ -6317,19 +6248,17 @@ static int __init brightness_init(struct ibm_init_struct *iibm)
if (IS_ERR(ibm_backlight_device)) {
int rc = PTR_ERR(ibm_backlight_device);
ibm_backlight_device = NULL;
- printk(TPACPI_ERR "Could not register backlight device\n");
+ pr_err("Could not register backlight device\n");
return rc;
}
vdbg_printk(TPACPI_DBG_INIT | TPACPI_DBG_BRGHT,
"brightness is supported\n");

if (quirks & TPACPI_BRGHT_Q_ASK) {
- printk(TPACPI_NOTICE
- "brightness: will use unverified default: "
- "brightness_mode=%d\n", brightness_mode);
- printk(TPACPI_NOTICE
- "brightness: please report to %s whether it works well "
- "or not on your ThinkPad\n", TPACPI_MAIL);
+ pr_notice("brightness: will use unverified default: "
+ "brightness_mode=%d\n", brightness_mode);
+ pr_notice("brightness: please report to %s whether it works well "
+ "or not on your ThinkPad\n", TPACPI_MAIL);
}

/* Added by mistake in early 2007. Probably useless, but it could
@@ -6802,8 +6731,7 @@ static int __init volume_create_alsa_mixer(void)
rc = snd_card_create(alsa_index, alsa_id, THIS_MODULE,
sizeof(struct tpacpi_alsa_data), &card);
if (rc < 0 || !card) {
- printk(TPACPI_ERR
- "Failed to create ALSA card structures: %d\n", rc);
+ pr_err("Failed to create ALSA card structures: %d\n", rc);
return 1;
}

@@ -6837,9 +6765,8 @@ static int __init volume_create_alsa_mixer(void)
ctl_vol = snd_ctl_new1(&volume_alsa_control_vol, NULL);
rc = snd_ctl_add(card, ctl_vol);
if (rc < 0) {
- printk(TPACPI_ERR
- "Failed to create ALSA volume control: %d\n",
- rc);
+ pr_err("Failed to create ALSA volume control: %d\n",
+ rc);
goto err_exit;
}
data->ctl_vol_id = &ctl_vol->id;
@@ -6848,8 +6775,7 @@ static int __init volume_create_alsa_mixer(void)
ctl_mute = snd_ctl_new1(&volume_alsa_control_mute, NULL);
rc = snd_ctl_add(card, ctl_mute);
if (rc < 0) {
- printk(TPACPI_ERR "Failed to create ALSA mute control: %d\n",
- rc);
+ pr_err("Failed to create ALSA mute control: %d\n", rc);
goto err_exit;
}
data->ctl_mute_id = &ctl_mute->id;
@@ -6857,7 +6783,7 @@ static int __init volume_create_alsa_mixer(void)
snd_card_set_dev(card, &tpacpi_pdev->dev);
rc = snd_card_register(card);
if (rc < 0) {
- printk(TPACPI_ERR "Failed to register ALSA card: %d\n", rc);
+ pr_err("Failed to register ALSA card: %d\n", rc);
goto err_exit;
}

@@ -6913,9 +6839,8 @@ static int __init volume_init(struct ibm_init_struct *iibm)
return -EINVAL;

if (volume_mode == TPACPI_VOL_MODE_UCMS_STEP) {
- printk(TPACPI_ERR
- "UCMS step volume mode not implemented, "
- "please contact %s\n", TPACPI_MAIL);
+ pr_err("UCMS step volume mode not implemented, "
+ "please contact %s\n", TPACPI_MAIL);
return 1;
}

@@ -6979,13 +6904,11 @@ static int __init volume_init(struct ibm_init_struct *iibm)

rc = volume_create_alsa_mixer();
if (rc) {
- printk(TPACPI_ERR
- "Could not create the ALSA mixer interface\n");
+ pr_err("Could not create the ALSA mixer interface\n");
return rc;
}

- printk(TPACPI_INFO
- "Console audio control enabled, mode: %s\n",
+ pr_info("Console audio control enabled, mode: %s\n",
(volume_control_allowed) ?
"override (read/write)" :
"monitor (read only)");
@@ -7047,12 +6970,10 @@ static int volume_write(char *buf)
if (!volume_control_allowed && tpacpi_lifecycle != TPACPI_LIFE_INIT) {
if (unlikely(!tp_warned.volume_ctrl_forbidden)) {
tp_warned.volume_ctrl_forbidden = 1;
- printk(TPACPI_NOTICE
- "Console audio control in monitor mode, "
- "changes are not allowed.\n");
- printk(TPACPI_NOTICE
- "Use the volume_control=1 module parameter "
- "to enable volume control\n");
+ pr_notice("Console audio control in monitor mode, "
+ "changes are not allowed\n");
+ pr_notice("Use the volume_control=1 module parameter "
+ "to enable volume control\n");
}
return -EPERM;
}
@@ -7127,8 +7048,7 @@ static void inline volume_alsa_notify_change(void)

static int __init volume_init(struct ibm_init_struct *iibm)
{
- printk(TPACPI_INFO
- "volume: disabled as there is no ALSA support in this kernel\n");
+ pr_info("volume: disabled as there is no ALSA support in this kernel\n");

return 1;
}
@@ -7335,9 +7255,8 @@ TPACPI_HANDLE(sfan, ec, "SFAN", /* 570 */
static void fan_quirk1_setup(void)
{
if (fan_control_initial_status == 0x07) {
- printk(TPACPI_NOTICE
- "fan_init: initial fan status is unknown, "
- "assuming it is in auto mode\n");
+ pr_notice("fan_init: initial fan status is unknown, "
+ "assuming it is in auto mode\n");
tp_features.fan_ctrl_status_undef = 1;
}
}
@@ -7724,8 +7643,7 @@ static void fan_watchdog_reset(void)
if (!queue_delayed_work(tpacpi_wq, &fan_watchdog_task,
msecs_to_jiffies(fan_watchdog_maxinterval
* 1000))) {
- printk(TPACPI_ERR
- "failed to queue the fan watchdog, "
+ pr_err("failed to queue the fan watchdog, "
"watchdog will not trigger\n");
}
} else
@@ -7739,11 +7657,11 @@ static void fan_watchdog_fire(struct work_struct *ignored)
if (tpacpi_lifecycle != TPACPI_LIFE_RUNNING)
return;

- printk(TPACPI_NOTICE "fan watchdog: enabling fan\n");
+ pr_notice("fan watchdog: enabling fan\n");
rc = fan_set_enable();
if (rc < 0) {
- printk(TPACPI_ERR "fan watchdog: error %d while enabling fan, "
- "will try again later...\n", -rc);
+ pr_err("fan watchdog: error %d while enabling fan, "
+ "will try again later...\n", -rc);
/* reschedule for later */
fan_watchdog_reset();
}
@@ -8047,8 +7965,7 @@ static int __init fan_init(struct ibm_init_struct *iibm)
"secondary fan support enabled\n");
}
} else {
- printk(TPACPI_ERR
- "ThinkPad ACPI EC access misbehaving, "
+ pr_err("ThinkPad ACPI EC access misbehaving, "
"fan status and control unavailable\n");
return 1;
}
@@ -8148,9 +8065,8 @@ static void fan_suspend(pm_message_t state)
fan_control_resume_level = 0;
rc = fan_get_status_safe(&fan_control_resume_level);
if (rc < 0)
- printk(TPACPI_NOTICE
- "failed to read fan level for later "
- "restore during resume: %d\n", rc);
+ pr_notice("failed to read fan level for later "
+ "restore during resume: %d\n", rc);

/* if it is undefined, don't attempt to restore it.
* KEEP THIS LAST */
@@ -8205,13 +8121,11 @@ static void fan_resume(void)
return;
}
if (do_set) {
- printk(TPACPI_NOTICE
- "restoring fan level to 0x%02x\n",
- fan_control_resume_level);
+ pr_notice("restoring fan level to 0x%02x\n",
+ fan_control_resume_level);
rc = fan_set_level_safe(fan_control_resume_level);
if (rc < 0)
- printk(TPACPI_NOTICE
- "failed to restore fan level: %d\n", rc);
+ pr_notice("failed to restore fan level: %d\n", rc);
}
}

@@ -8303,8 +8217,8 @@ static int fan_write_cmd_level(const char *cmd, int *rc)

*rc = fan_set_level_safe(level);
if (*rc == -ENXIO)
- printk(TPACPI_ERR "level command accepted for unsupported "
- "access mode %d", fan_control_access_mode);
+ pr_err("level command accepted for unsupported access mode %d\n",
+ fan_control_access_mode);
else if (!*rc)
tpacpi_disclose_usertask("procfs fan",
"set level to %d\n", level);
@@ -8319,8 +8233,8 @@ static int fan_write_cmd_enable(const char *cmd, int *rc)

*rc = fan_set_enable();
if (*rc == -ENXIO)
- printk(TPACPI_ERR "enable command accepted for unsupported "
- "access mode %d", fan_control_access_mode);
+ pr_err("enable command accepted for unsupported access mode %d\n",
+ fan_control_access_mode);
else if (!*rc)
tpacpi_disclose_usertask("procfs fan", "enable\n");

@@ -8334,8 +8248,8 @@ static int fan_write_cmd_disable(const char *cmd, int *rc)

*rc = fan_set_disable();
if (*rc == -ENXIO)
- printk(TPACPI_ERR "disable command accepted for unsupported "
- "access mode %d", fan_control_access_mode);
+ pr_err("disable command accepted for unsupported access mode %d\n",
+ fan_control_access_mode);
else if (!*rc)
tpacpi_disclose_usertask("procfs fan", "disable\n");

@@ -8354,8 +8268,8 @@ static int fan_write_cmd_speed(const char *cmd, int *rc)

*rc = fan_set_speed(speed);
if (*rc == -ENXIO)
- printk(TPACPI_ERR "speed command accepted for unsupported "
- "access mode %d", fan_control_access_mode);
+ pr_err("speed command accepted for unsupported access mode %d\n",
+ fan_control_access_mode);
else if (!*rc)
tpacpi_disclose_usertask("procfs fan",
"set speed to %d\n", speed);
@@ -8558,8 +8472,8 @@ static int __init ibm_init(struct ibm_init_struct *iibm)
if (ibm->acpi->notify) {
ret = setup_acpi_notify(ibm);
if (ret == -ENODEV) {
- printk(TPACPI_NOTICE "disabling subdriver %s\n",
- ibm->name);
+ pr_notice("disabling subdriver %s\n",
+ ibm->name);
ret = 0;
goto err_out;
}
@@ -8581,8 +8495,7 @@ static int __init ibm_init(struct ibm_init_struct *iibm)
entry = proc_create_data(ibm->name, mode, proc_dir,
&dispatch_proc_fops, ibm);
if (!entry) {
- printk(TPACPI_ERR "unable to create proc entry %s\n",
- ibm->name);
+ pr_err("unable to create proc entry %s\n", ibm->name);
ret = -ENODEV;
goto err_out;
}
@@ -8682,13 +8595,11 @@ static int __must_check __init get_thinkpad_model_data(
tp->ec_release = (ec_fw_string[4] << 8)
| ec_fw_string[5];
} else {
- printk(TPACPI_NOTICE
- "ThinkPad firmware release %s "
- "doesn't match the known patterns\n",
- ec_fw_string);
- printk(TPACPI_NOTICE
- "please report this to %s\n",
- TPACPI_MAIL);
+ pr_notice("ThinkPad firmware release %s "
+ "doesn't match the known patterns\n",
+ ec_fw_string);
+ pr_notice("please report this to %s\n",
+ TPACPI_MAIL);
}
break;
}
@@ -8732,8 +8643,7 @@ static int __init probe_for_thinkpad(void)
tpacpi_acpi_handle_locate("ec", TPACPI_ACPI_EC_HID, &ec_handle);
if (!ec_handle) {
if (is_thinkpad)
- printk(TPACPI_ERR
- "Not yet supported ThinkPad detected!\n");
+ pr_err("Not yet supported ThinkPad detected!\n");
return -ENODEV;
}

@@ -8745,10 +8655,10 @@ static int __init probe_for_thinkpad(void)

static void __init thinkpad_acpi_init_banner(void)
{
- printk(TPACPI_INFO "%s v%s\n", TPACPI_DESC, TPACPI_VERSION);
- printk(TPACPI_INFO "%s\n", TPACPI_URL);
+ pr_info("%s v%s\n", TPACPI_DESC, TPACPI_VERSION);
+ pr_info("%s\n", TPACPI_URL);

- printk(TPACPI_INFO "ThinkPad BIOS %s, EC %s\n",
+ pr_info("ThinkPad BIOS %s, EC %s\n",
(thinkpad_id.bios_version_str) ?
thinkpad_id.bios_version_str : "unknown",
(thinkpad_id.ec_version_str) ?
@@ -8757,7 +8667,7 @@ static void __init thinkpad_acpi_init_banner(void)
BUG_ON(!thinkpad_id.vendor);

if (thinkpad_id.model_str)
- printk(TPACPI_INFO "%s %s, model %s\n",
+ pr_info("%s %s, model %s\n",
(thinkpad_id.vendor == PCI_VENDOR_ID_IBM) ?
"IBM" : ((thinkpad_id.vendor ==
PCI_VENDOR_ID_LENOVO) ?
@@ -9023,8 +8933,7 @@ static int __init thinkpad_acpi_module_init(void)

ret = get_thinkpad_model_data(&thinkpad_id);
if (ret) {
- printk(TPACPI_ERR
- "unable to get DMI data: %d\n", ret);
+ pr_err("unable to get DMI data: %d\n", ret);
thinkpad_acpi_module_exit();
return ret;
}
@@ -9050,16 +8959,14 @@ static int __init thinkpad_acpi_module_init(void)

proc_dir = proc_mkdir(TPACPI_PROC_DIR, acpi_root_dir);
if (!proc_dir) {
- printk(TPACPI_ERR
- "unable to create proc dir " TPACPI_PROC_DIR);
+ pr_err("unable to create proc dir " TPACPI_PROC_DIR "\n");
thinkpad_acpi_module_exit();
return -ENODEV;
}

ret = platform_driver_register(&tpacpi_pdriver);
if (ret) {
- printk(TPACPI_ERR
- "unable to register main platform driver\n");
+ pr_err("unable to register main platform driver\n");
thinkpad_acpi_module_exit();
return ret;
}
@@ -9067,8 +8974,7 @@ static int __init thinkpad_acpi_module_init(void)

ret = platform_driver_register(&tpacpi_hwmon_pdriver);
if (ret) {
- printk(TPACPI_ERR
- "unable to register hwmon platform driver\n");
+ pr_err("unable to register hwmon platform driver\n");
thinkpad_acpi_module_exit();
return ret;
}
@@ -9081,8 +8987,7 @@ static int __init thinkpad_acpi_module_init(void)
&tpacpi_hwmon_pdriver.driver);
}
if (ret) {
- printk(TPACPI_ERR
- "unable to create sysfs driver attributes\n");
+ pr_err("unable to create sysfs driver attributes\n");
thinkpad_acpi_module_exit();
return ret;
}
@@ -9095,7 +9000,7 @@ static int __init thinkpad_acpi_module_init(void)
if (IS_ERR(tpacpi_pdev)) {
ret = PTR_ERR(tpacpi_pdev);
tpacpi_pdev = NULL;
- printk(TPACPI_ERR "unable to register platform device\n");
+ pr_err("unable to register platform device\n");
thinkpad_acpi_module_exit();
return ret;
}
@@ -9105,16 +9010,14 @@ static int __init thinkpad_acpi_module_init(void)
if (IS_ERR(tpacpi_sensors_pdev)) {
ret = PTR_ERR(tpacpi_sensors_pdev);
tpacpi_sensors_pdev = NULL;
- printk(TPACPI_ERR
- "unable to register hwmon platform device\n");
+ pr_err("unable to register hwmon platform device\n");
thinkpad_acpi_module_exit();
return ret;
}
ret = device_create_file(&tpacpi_sensors_pdev->dev,
&dev_attr_thinkpad_acpi_pdev_name);
if (ret) {
- printk(TPACPI_ERR
- "unable to create sysfs hwmon device attributes\n");
+ pr_err("unable to create sysfs hwmon device attributes\n");
thinkpad_acpi_module_exit();
return ret;
}
@@ -9123,14 +9026,14 @@ static int __init thinkpad_acpi_module_init(void)
if (IS_ERR(tpacpi_hwmon)) {
ret = PTR_ERR(tpacpi_hwmon);
tpacpi_hwmon = NULL;
- printk(TPACPI_ERR "unable to register hwmon device\n");
+ pr_err("unable to register hwmon device\n");
thinkpad_acpi_module_exit();
return ret;
}
mutex_init(&tpacpi_inputdev_send_mutex);
tpacpi_inputdev = input_allocate_device();
if (!tpacpi_inputdev) {
- printk(TPACPI_ERR "unable to allocate input device\n");
+ pr_err("unable to allocate input device\n");
thinkpad_acpi_module_exit();
return -ENOMEM;
} else {
@@ -9162,7 +9065,7 @@ static int __init thinkpad_acpi_module_init(void)

ret = input_register_device(tpacpi_inputdev);
if (ret < 0) {
- printk(TPACPI_ERR "unable to register input device\n");
+ pr_err("unable to register input device\n");
thinkpad_acpi_module_exit();
return ret;
} else {
--
1.7.4.2.g597a6.dirty

2011-03-29 22:22:50

by Joe Perches

[permalink] [raw]
Subject: [PATCH 22/23] wmi: Removed trailing whitespace from logging message.

Just neatening.

Signed-off-by: Joe Perches <[email protected]>
---
drivers/platform/x86/wmi.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
index 05cc796..f23d5a8 100644
--- a/drivers/platform/x86/wmi.c
+++ b/drivers/platform/x86/wmi.c
@@ -486,16 +486,16 @@ static void wmi_dump_wdg(const struct guid_block *g)
pr_info("\tnotify_id: %02X\n", g->notify_id);
pr_info("\treserved: %02X\n", g->reserved);
pr_info("\tinstance_count: %d\n", g->instance_count);
- pr_info("\tflags: %#x ", g->flags);
+ pr_info("\tflags: %#x", g->flags);
if (g->flags) {
if (g->flags & ACPI_WMI_EXPENSIVE)
- pr_cont("ACPI_WMI_EXPENSIVE ");
+ pr_cont(" ACPI_WMI_EXPENSIVE");
if (g->flags & ACPI_WMI_METHOD)
- pr_cont("ACPI_WMI_METHOD ");
+ pr_cont(" ACPI_WMI_METHOD");
if (g->flags & ACPI_WMI_STRING)
- pr_cont("ACPI_WMI_STRING ");
+ pr_cont(" ACPI_WMI_STRING");
if (g->flags & ACPI_WMI_EVENT)
- pr_cont("ACPI_WMI_EVENT ");
+ pr_cont(" ACPI_WMI_EVENT");
}
pr_cont("\n");

--
1.7.4.2.g597a6.dirty

2011-03-29 22:22:26

by Joe Perches

[permalink] [raw]
Subject: [PATCH 07/23] eeepc: Use pr_warn

Just a trivial pr_warning to pr_warn conversion
while adding a few missing newlines.

Signed-off-by: Joe Perches <[email protected]>
---
drivers/platform/x86/eeepc-laptop.c | 20 ++++++++++----------
drivers/platform/x86/eeepc-wmi.c | 14 +++++++-------
2 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c
index 5f2dd38..e5feadd 100644
--- a/drivers/platform/x86/eeepc-laptop.c
+++ b/drivers/platform/x86/eeepc-laptop.c
@@ -228,7 +228,7 @@ static int set_acpi(struct eeepc_laptop *eeepc, int cm, int value)
return -ENODEV;

if (write_acpi_int(eeepc->handle, method, value))
- pr_warning("Error writing %s\n", method);
+ pr_warn("Error writing %s\n", method);
return 0;
}

@@ -243,7 +243,7 @@ static int get_acpi(struct eeepc_laptop *eeepc, int cm)
return -ENODEV;

if (read_acpi_int(eeepc->handle, method, &value))
- pr_warning("Error reading %s\n", method);
+ pr_warn("Error reading %s\n", method);
return value;
}

@@ -261,7 +261,7 @@ static int acpi_setter_handle(struct eeepc_laptop *eeepc, int cm,
status = acpi_get_handle(eeepc->handle, (char *)method,
handle);
if (status != AE_OK) {
- pr_warning("Error finding %s\n", method);
+ pr_warn("Error finding %s\n", method);
return -ENODEV;
}
return 0;
@@ -417,7 +417,7 @@ static ssize_t store_cpufv_disabled(struct device *dev,
switch (value) {
case 0:
if (eeepc->cpufv_disabled)
- pr_warning("cpufv enabled (not officially supported "
+ pr_warn("cpufv enabled (not officially supported "
"on this model)\n");
eeepc->cpufv_disabled = false;
return rv;
@@ -601,7 +601,7 @@ static void eeepc_rfkill_hotplug(struct eeepc_laptop *eeepc)
if (eeepc->hotplug_slot) {
bus = pci_find_bus(0, 1);
if (!bus) {
- pr_warning("Unable to find PCI bus 1?\n");
+ pr_warn("Unable to find PCI bus 1?\n");
goto out_unlock;
}

@@ -612,12 +612,12 @@ static void eeepc_rfkill_hotplug(struct eeepc_laptop *eeepc)
absent = (l == 0xffffffff);

if (blocked != absent) {
- pr_warning("BIOS says wireless lan is %s, "
- "but the pci device is %s\n",
+ pr_warn("BIOS says wireless lan is %s, "
+ "but the pci device is %s\n",
blocked ? "blocked" : "unblocked",
absent ? "absent" : "present");
- pr_warning("skipped wireless hotplug as probably "
- "inappropriate for this model\n");
+ pr_warn("skipped wireless hotplug as probably "
+ "inappropriate for this model\n");
goto out_unlock;
}

@@ -671,7 +671,7 @@ static int eeepc_register_rfkill_notifier(struct eeepc_laptop *eeepc,
eeepc_rfkill_notify,
eeepc);
if (ACPI_FAILURE(status))
- pr_warning("Failed to register notify on %s\n", node);
+ pr_warn("Failed to register notify on %s\n", node);
} else
return -ENODEV;

diff --git a/drivers/platform/x86/eeepc-wmi.c b/drivers/platform/x86/eeepc-wmi.c
index 0ddc434..4155884 100644
--- a/drivers/platform/x86/eeepc-wmi.c
+++ b/drivers/platform/x86/eeepc-wmi.c
@@ -82,7 +82,7 @@ static const struct key_entry eeepc_wmi_keymap[] = {
static acpi_status eeepc_wmi_parse_device(acpi_handle handle, u32 level,
void *context, void **retval)
{
- pr_warning("Found legacy ATKD device (%s)", EEEPC_ACPI_HID);
+ pr_warn("Found legacy ATKD device (%s)\n", EEEPC_ACPI_HID);
*(bool *)context = true;
return AE_CTRL_TERMINATE;
}
@@ -103,12 +103,12 @@ static int eeepc_wmi_check_atkd(void)
static int eeepc_wmi_probe(struct platform_device *pdev)
{
if (eeepc_wmi_check_atkd()) {
- pr_warning("WMI device present, but legacy ATKD device is also "
- "present and enabled.");
- pr_warning("You probably booted with acpi_osi=\"Linux\" or "
- "acpi_osi=\"!Windows 2009\"");
- pr_warning("Can't load eeepc-wmi, use default acpi_osi "
- "(preferred) or eeepc-laptop");
+ pr_warn("WMI device present, but legacy ATKD device is also "
+ "present and enabled\n");
+ pr_warn("You probably booted with acpi_osi=\"Linux\" or "
+ "acpi_osi=\"!Windows 2009\"\n");
+ pr_warn("Can't load eeepc-wmi, use default acpi_osi "
+ "(preferred) or eeepc-laptop\n");
return -EBUSY;
}
return 0;
--
1.7.4.2.g597a6.dirty

2011-03-29 22:22:39

by Joe Perches

[permalink] [raw]
Subject: [PATCH 15/23] msi-laptop: pr_<level> neatening

Just making it a bit more like other logging message uses.

Signed-off-by: Joe Perches <[email protected]>
---
drivers/platform/x86/msi-laptop.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/platform/x86/msi-laptop.c b/drivers/platform/x86/msi-laptop.c
index 23fb2af..f89c0b6 100644
--- a/drivers/platform/x86/msi-laptop.c
+++ b/drivers/platform/x86/msi-laptop.c
@@ -447,7 +447,7 @@ static struct platform_device *msipf_device;

static int dmi_check_cb(const struct dmi_system_id *id)
{
- pr_info("Identified laptop model '%s'.\n", id->ident);
+ pr_info("Identified laptop model '%s'\n", id->ident);
return 1;
}

@@ -875,8 +875,7 @@ static int __init msi_init(void)
/* Register backlight stuff */

if (acpi_video_backlight_support()) {
- pr_info("Brightness ignored, must be controlled "
- "by ACPI video driver\n");
+ pr_info("Brightness ignored, must be controlled by ACPI video driver\n");
} else {
struct backlight_properties props;
memset(&props, 0, sizeof(struct backlight_properties));
@@ -930,7 +929,7 @@ static int __init msi_init(void)
if (auto_brightness != 2)
set_auto_brightness(auto_brightness);

- pr_info("driver "MSI_DRIVER_VERSION" successfully loaded.\n");
+ pr_info("driver " MSI_DRIVER_VERSION " successfully loaded\n");

return 0;

@@ -978,7 +977,7 @@ static void __exit msi_cleanup(void)
if (auto_brightness != 2)
set_auto_brightness(1);

- pr_info("driver unloaded.\n");
+ pr_info("driver unloaded\n");
}

module_init(msi_init);
--
1.7.4.2.g597a6.dirty

2011-03-29 22:22:51

by Joe Perches

[permalink] [raw]
Subject: [PATCH 21/23] toshiba: Convert printks to pr_<level>

Add pr_fmt.
Remove local MY_<foo> #defines.
Convert printks to pr_<level>.

Signed-off-by: Joe Perches <[email protected]>
---
drivers/platform/x86/toshiba_acpi.c | 59 ++++++++++++++----------------
drivers/platform/x86/toshiba_bluetooth.c | 11 +++---
2 files changed, 34 insertions(+), 36 deletions(-)

diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c
index 63f42a2..cb009b2 100644
--- a/drivers/platform/x86/toshiba_acpi.c
+++ b/drivers/platform/x86/toshiba_acpi.c
@@ -35,6 +35,8 @@
*
*/

+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#define TOSHIBA_ACPI_VERSION "0.19"
#define PROC_INTERFACE_VERSION 1

@@ -60,11 +62,6 @@ MODULE_AUTHOR("John Belmonte");
MODULE_DESCRIPTION("Toshiba Laptop ACPI Extras Driver");
MODULE_LICENSE("GPL");

-#define MY_LOGPREFIX "toshiba_acpi: "
-#define MY_ERR KERN_ERR MY_LOGPREFIX
-#define MY_NOTICE KERN_NOTICE MY_LOGPREFIX
-#define MY_INFO KERN_INFO MY_LOGPREFIX
-
/* Toshiba ACPI method paths */
#define METHOD_LCD_BRIGHTNESS "\\_SB_.PCI0.VGA_.LCD_._BCM"
#define TOSH_INTERFACE_1 "\\_SB_.VALD"
@@ -301,7 +298,7 @@ static int toshiba_illumination_available(void)
in[0] = 0xf100;
status = hci_raw(in, out);
if (ACPI_FAILURE(status)) {
- printk(MY_INFO "Illumination device not available\n");
+ pr_info("Illumination device not available\n");
return 0;
}
in[0] = 0xf400;
@@ -320,7 +317,7 @@ static void toshiba_illumination_set(struct led_classdev *cdev,
in[0] = 0xf100;
status = hci_raw(in, out);
if (ACPI_FAILURE(status)) {
- printk(MY_INFO "Illumination device not available\n");
+ pr_info("Illumination device not available\n");
return;
}

@@ -331,7 +328,7 @@ static void toshiba_illumination_set(struct led_classdev *cdev,
in[2] = 1;
status = hci_raw(in, out);
if (ACPI_FAILURE(status)) {
- printk(MY_INFO "ACPI call for illumination failed.\n");
+ pr_info("ACPI call for illumination failed\n");
return;
}
} else {
@@ -341,7 +338,7 @@ static void toshiba_illumination_set(struct led_classdev *cdev,
in[2] = 0;
status = hci_raw(in, out);
if (ACPI_FAILURE(status)) {
- printk(MY_INFO "ACPI call for illumination failed.\n");
+ pr_info("ACPI call for illumination failed.\n");
return;
}
}
@@ -364,7 +361,7 @@ static enum led_brightness toshiba_illumination_get(struct led_classdev *cdev)
in[0] = 0xf100;
status = hci_raw(in, out);
if (ACPI_FAILURE(status)) {
- printk(MY_INFO "Illumination device not available\n");
+ pr_info("Illumination device not available\n");
return LED_OFF;
}

@@ -373,7 +370,7 @@ static enum led_brightness toshiba_illumination_get(struct led_classdev *cdev)
in[1] = 0x14e;
status = hci_raw(in, out);
if (ACPI_FAILURE(status)) {
- printk(MY_INFO "ACPI call for illumination failed.\n");
+ pr_info("ACPI call for illumination failed.\n");
return LED_OFF;
}

@@ -517,7 +514,7 @@ static int lcd_proc_show(struct seq_file *m, void *v)
seq_printf(m, "brightness_levels: %d\n",
HCI_LCD_BRIGHTNESS_LEVELS);
} else {
- printk(MY_ERR "Error reading LCD brightness\n");
+ pr_err("Error reading LCD brightness\n");
}

return 0;
@@ -592,7 +589,7 @@ static int video_proc_show(struct seq_file *m, void *v)
seq_printf(m, "crt_out: %d\n", is_crt);
seq_printf(m, "tv_out: %d\n", is_tv);
} else {
- printk(MY_ERR "Error reading video out status\n");
+ pr_err("Error reading video out status\n");
}

return 0;
@@ -686,7 +683,7 @@ static int fan_proc_show(struct seq_file *m, void *v)
seq_printf(m, "running: %d\n", (value > 0));
seq_printf(m, "force_on: %d\n", force_fan);
} else {
- printk(MY_ERR "Error reading fan status\n");
+ pr_err("Error reading fan status\n");
}

return 0;
@@ -750,9 +747,9 @@ static int keys_proc_show(struct seq_file *m, void *v)
* some machines where system events sporadically
* become disabled. */
hci_write1(HCI_SYSTEM_EVENT, 1, &hci_result);
- printk(MY_NOTICE "Re-enabled hotkeys\n");
+ pr_notice("Re-enabled hotkeys\n");
} else {
- printk(MY_ERR "Error reading hotkey status\n");
+ pr_err("Error reading hotkey status\n");
goto end;
}
}
@@ -863,7 +860,7 @@ static void toshiba_acpi_notify(acpi_handle handle, u32 event, void *context)

if (!sparse_keymap_report_event(toshiba_acpi.hotkey_dev,
value, 1, true)) {
- printk(MY_INFO "Unknown key %x\n",
+ pr_info("Unknown key %x\n",
value);
}
} else if (hci_result == HCI_NOT_SUPPORTED) {
@@ -871,7 +868,7 @@ static void toshiba_acpi_notify(acpi_handle handle, u32 event, void *context)
* some machines where system events sporadically
* become disabled. */
hci_write1(HCI_SYSTEM_EVENT, 1, &hci_result);
- printk(MY_NOTICE "Re-enabled hotkeys\n");
+ pr_notice("Re-enabled hotkeys\n");
}
} while (hci_result != HCI_EMPTY);
}
@@ -883,13 +880,13 @@ static int __init toshiba_acpi_setup_keyboard(char *device)

status = acpi_get_handle(NULL, device, &toshiba_acpi.handle);
if (ACPI_FAILURE(status)) {
- printk(MY_INFO "Unable to get notification device\n");
+ pr_info("Unable to get notification device\n");
return -ENODEV;
}

toshiba_acpi.hotkey_dev = input_allocate_device();
if (!toshiba_acpi.hotkey_dev) {
- printk(MY_INFO "Unable to register input device\n");
+ pr_info("Unable to register input device\n");
return -ENOMEM;
}

@@ -905,21 +902,21 @@ static int __init toshiba_acpi_setup_keyboard(char *device)
status = acpi_install_notify_handler(toshiba_acpi.handle,
ACPI_DEVICE_NOTIFY, toshiba_acpi_notify, NULL);
if (ACPI_FAILURE(status)) {
- printk(MY_INFO "Unable to install hotkey notification\n");
+ pr_info("Unable to install hotkey notification\n");
error = -ENODEV;
goto err_free_keymap;
}

status = acpi_evaluate_object(toshiba_acpi.handle, "ENAB", NULL, NULL);
if (ACPI_FAILURE(status)) {
- printk(MY_INFO "Unable to enable hotkeys\n");
+ pr_info("Unable to enable hotkeys\n");
error = -ENODEV;
goto err_remove_notify;
}

error = input_register_device(toshiba_acpi.hotkey_dev);
if (error) {
- printk(MY_INFO "Unable to register input device\n");
+ pr_info("Unable to register input device\n");
goto err_remove_notify;
}

@@ -980,17 +977,17 @@ static int __init toshiba_acpi_init(void)
if (is_valid_acpi_path(TOSH_INTERFACE_1 GHCI_METHOD)) {
method_hci = TOSH_INTERFACE_1 GHCI_METHOD;
if (toshiba_acpi_setup_keyboard(TOSH_INTERFACE_1))
- printk(MY_INFO "Unable to activate hotkeys\n");
+ pr_info("Unable to activate hotkeys\n");
} else if (is_valid_acpi_path(TOSH_INTERFACE_2 GHCI_METHOD)) {
method_hci = TOSH_INTERFACE_2 GHCI_METHOD;
if (toshiba_acpi_setup_keyboard(TOSH_INTERFACE_2))
- printk(MY_INFO "Unable to activate hotkeys\n");
+ pr_info("Unable to activate hotkeys\n");
} else
return -ENODEV;

- printk(MY_INFO "Toshiba Laptop ACPI Extras version %s\n",
+ pr_info("Toshiba Laptop ACPI Extras version %s\n",
TOSHIBA_ACPI_VERSION);
- printk(MY_INFO " HCI method: %s\n", method_hci);
+ pr_info(" HCI method: %s\n", method_hci);

mutex_init(&toshiba_acpi.mutex);

@@ -998,7 +995,7 @@ static int __init toshiba_acpi_init(void)
-1, NULL, 0);
if (IS_ERR(toshiba_acpi.p_dev)) {
ret = PTR_ERR(toshiba_acpi.p_dev);
- printk(MY_ERR "unable to register platform device\n");
+ pr_err("unable to register platform device\n");
toshiba_acpi.p_dev = NULL;
toshiba_acpi_exit();
return ret;
@@ -1028,7 +1025,7 @@ static int __init toshiba_acpi_init(void)
if (IS_ERR(toshiba_backlight_device)) {
ret = PTR_ERR(toshiba_backlight_device);

- printk(KERN_ERR "Could not register toshiba backlight device\n");
+ pr_err("Could not register toshiba backlight device\n");
toshiba_backlight_device = NULL;
toshiba_acpi_exit();
return ret;
@@ -1042,14 +1039,14 @@ static int __init toshiba_acpi_init(void)
&toshiba_rfk_ops,
&toshiba_acpi);
if (!toshiba_acpi.bt_rfk) {
- printk(MY_ERR "unable to allocate rfkill device\n");
+ pr_err("unable to allocate rfkill device\n");
toshiba_acpi_exit();
return -ENOMEM;
}

ret = rfkill_register(toshiba_acpi.bt_rfk);
if (ret) {
- printk(MY_ERR "unable to register rfkill device\n");
+ pr_err("unable to register rfkill device\n");
rfkill_destroy(toshiba_acpi.bt_rfk);
toshiba_acpi_exit();
return ret;
diff --git a/drivers/platform/x86/toshiba_bluetooth.c b/drivers/platform/x86/toshiba_bluetooth.c
index 9440686..5fb7186 100644
--- a/drivers/platform/x86/toshiba_bluetooth.c
+++ b/drivers/platform/x86/toshiba_bluetooth.c
@@ -17,6 +17,8 @@
* delivered.
*/

+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
@@ -70,14 +72,13 @@ static int toshiba_bluetooth_enable(acpi_handle handle)
if (!(result & 0x01))
return 0;

- printk(KERN_INFO "toshiba_bluetooth: Re-enabling Toshiba Bluetooth\n");
+ pr_info("Re-enabling Toshiba Bluetooth\n");
res1 = acpi_evaluate_object(handle, "AUSB", NULL, NULL);
res2 = acpi_evaluate_object(handle, "BTPO", NULL, NULL);
if (!ACPI_FAILURE(res1) || !ACPI_FAILURE(res2))
return 0;

- printk(KERN_WARNING "toshiba_bluetooth: Failed to re-enable "
- "Toshiba Bluetooth\n");
+ pr_warn("Failed to re-enable Toshiba Bluetooth\n");

return -ENODEV;
}
@@ -107,8 +108,8 @@ static int toshiba_bt_rfkill_add(struct acpi_device *device)
&bt_present);

if (!ACPI_FAILURE(status) && bt_present) {
- printk(KERN_INFO "Detected Toshiba ACPI Bluetooth device - "
- "installing RFKill handler\n");
+ pr_info("Detected Toshiba ACPI Bluetooth device - "
+ "installing RFKill handler\n");
result = toshiba_bluetooth_enable(device->handle);
}

--
1.7.4.2.g597a6.dirty

2011-03-29 22:22:48

by Joe Perches

[permalink] [raw]
Subject: [PATCH 23/23] xo15-ebook: Use pr_<level>

Use the current logging styles.

Remove local #define PREFIX.
Add pr_fmt.
Convert printk to pr_<level>.

Signed-off-by: Joe Perches <[email protected]>
---
drivers/platform/x86/xo15-ebook.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/x86/xo15-ebook.c b/drivers/platform/x86/xo15-ebook.c
index c1372ed..fad153d 100644
--- a/drivers/platform/x86/xo15-ebook.c
+++ b/drivers/platform/x86/xo15-ebook.c
@@ -11,6 +11,8 @@
* your option) any later version.
*/

+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
@@ -20,7 +22,6 @@
#include <acpi/acpi_drivers.h>

#define MODULE_NAME "xo15-ebook"
-#define PREFIX MODULE_NAME ": "

#define XO15_EBOOK_CLASS MODULE_NAME
#define XO15_EBOOK_TYPE_UNKNOWN 0x00
@@ -105,7 +106,7 @@ static int ebook_switch_add(struct acpi_device *device)
class = acpi_device_class(device);

if (strcmp(hid, XO15_EBOOK_HID)) {
- printk(KERN_ERR PREFIX "Unsupported hid [%s]\n", hid);
+ pr_err("Unsupported hid [%s]\n", hid);
error = -ENODEV;
goto err_free_input;
}
--
1.7.4.2.g597a6.dirty

2011-03-29 22:23:34

by Joe Perches

[permalink] [raw]
Subject: [PATCH 20/23] topstar-laptop: Convert remaining printk to pr_info

To be similar to all other uses.

Signed-off-by: Joe Perches <[email protected]>
---
drivers/platform/x86/topstar-laptop.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/platform/x86/topstar-laptop.c b/drivers/platform/x86/topstar-laptop.c
index 1d07d6d..4c20447 100644
--- a/drivers/platform/x86/topstar-laptop.c
+++ b/drivers/platform/x86/topstar-laptop.c
@@ -194,7 +194,7 @@ static int __init topstar_laptop_init(void)
if (ret < 0)
return ret;

- printk(KERN_INFO "Topstar Laptop ACPI extras driver loaded\n");
+ pr_info("ACPI extras driver loaded\n");

return 0;
}
--
1.7.4.2.g597a6.dirty

2011-03-29 22:23:51

by Joe Perches

[permalink] [raw]
Subject: [PATCH 18/23] tc1100-wmi: Add pr_fmt, use pr_<level>

Use the more normal logging styles.
Removed now unused local logging #defines.

Signed-off-by: Joe Perches <[email protected]>
---
drivers/platform/x86/tc1100-wmi.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/platform/x86/tc1100-wmi.c b/drivers/platform/x86/tc1100-wmi.c
index 865ef78..e24f5ae 100644
--- a/drivers/platform/x86/tc1100-wmi.c
+++ b/drivers/platform/x86/tc1100-wmi.c
@@ -25,6 +25,8 @@
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/slab.h>
@@ -40,9 +42,6 @@
#define TC1100_INSTANCE_WIRELESS 1
#define TC1100_INSTANCE_JOGDIAL 2

-#define TC1100_LOGPREFIX "tc1100-wmi: "
-#define TC1100_INFO KERN_INFO TC1100_LOGPREFIX
-
MODULE_AUTHOR("Jamey Hicks, Carlos Corbacho");
MODULE_DESCRIPTION("HP Compaq TC1100 Tablet WMI Extras");
MODULE_LICENSE("GPL");
@@ -264,7 +263,7 @@ static int __init tc1100_init(void)
if (error)
goto err_device_del;

- printk(TC1100_INFO "HP Compaq TC1100 Tablet WMI Extras loaded\n");
+ pr_info("HP Compaq TC1100 Tablet WMI Extras loaded\n");
return 0;

err_device_del:
--
1.7.4.2.g597a6.dirty

2011-03-29 22:22:38

by Joe Perches

[permalink] [raw]
Subject: [PATCH 16/23] msi-wmi: Use pr_fmt and pr_<level>

Added pr_fmt.
Removed now unused #define DRV_PFX
Convert dprintk to pr_debug.
Convert printks to pr_<level>.

Signed-off-by: Joe Perches <[email protected]>
---
drivers/platform/x86/msi-wmi.c | 45 +++++++++++++++++----------------------
1 files changed, 20 insertions(+), 25 deletions(-)

diff --git a/drivers/platform/x86/msi-wmi.c b/drivers/platform/x86/msi-wmi.c
index d5419c9..c832e33 100644
--- a/drivers/platform/x86/msi-wmi.c
+++ b/drivers/platform/x86/msi-wmi.c
@@ -20,6 +20,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/kernel.h>
#include <linux/input.h>
@@ -36,13 +37,10 @@ MODULE_ALIAS("wmi:551A1F84-FBDD-4125-91DB-3EA8F44F1D45");
MODULE_ALIAS("wmi:B6F3EEF2-3D2F-49DC-9DE3-85BCE18C62F2");

#define DRV_NAME "msi-wmi"
-#define DRV_PFX DRV_NAME ": "

#define MSIWMI_BIOS_GUID "551A1F84-FBDD-4125-91DB-3EA8F44F1D45"
#define MSIWMI_EVENT_GUID "B6F3EEF2-3D2F-49DC-9DE3-85BCE18C62F2"

-#define dprintk(msg...) pr_debug(DRV_PFX msg)
-
#define SCANCODE_BASE 0xD0
#define MSI_WMI_BRIGHTNESSUP SCANCODE_BASE
#define MSI_WMI_BRIGHTNESSDOWN (SCANCODE_BASE + 1)
@@ -78,7 +76,7 @@ static int msi_wmi_query_block(int instance, int *ret)

if (!obj || obj->type != ACPI_TYPE_INTEGER) {
if (obj) {
- printk(KERN_ERR DRV_PFX "query block returned object "
+ pr_err("query block returned object "
"type: %d - buffer length:%d\n", obj->type,
obj->type == ACPI_TYPE_BUFFER ?
obj->buffer.length : 0);
@@ -97,8 +95,8 @@ static int msi_wmi_set_block(int instance, int value)

struct acpi_buffer input = { sizeof(int), &value };

- dprintk("Going to set block of instance: %d - value: %d\n",
- instance, value);
+ pr_debug("Going to set block of instance: %d - value: %d\n",
+ instance, value);

status = wmi_set_block(MSIWMI_BIOS_GUID, instance, &input);

@@ -112,20 +110,19 @@ static int bl_get(struct backlight_device *bd)
/* Instance 1 is "get backlight", cmp with DSDT */
err = msi_wmi_query_block(1, &ret);
if (err) {
- printk(KERN_ERR DRV_PFX "Could not query backlight: %d\n", err);
+ pr_err("Could not query backlight: %d\n", err);
return -EINVAL;
}
- dprintk("Get: Query block returned: %d\n", ret);
+ pr_debug("Get: Query block returned: %d\n", ret);
for (level = 0; level < ARRAY_SIZE(backlight_map); level++) {
if (backlight_map[level] == ret) {
- dprintk("Current backlight level: 0x%X - index: %d\n",
- backlight_map[level], level);
+ pr_debug("Current backlight level: 0x%X - index: %d\n",
+ backlight_map[level], level);
break;
}
}
if (level == ARRAY_SIZE(backlight_map)) {
- printk(KERN_ERR DRV_PFX "get: Invalid brightness value: 0x%X\n",
- ret);
+ pr_err("get: Invalid brightness value: 0x%X\n", ret);
return -EINVAL;
}
return level;
@@ -156,7 +153,7 @@ static void msi_wmi_notify(u32 value, void *context)

status = wmi_get_event_data(value, &response);
if (status != AE_OK) {
- printk(KERN_INFO DRV_PFX "bad event status 0x%x\n", status);
+ pr_info("bad event status 0x%x\n", status);
return;
}

@@ -164,7 +161,7 @@ static void msi_wmi_notify(u32 value, void *context)

if (obj && obj->type == ACPI_TYPE_INTEGER) {
int eventcode = obj->integer.value;
- dprintk("Eventcode: 0x%x\n", eventcode);
+ pr_debug("Eventcode: 0x%x\n", eventcode);
key = sparse_keymap_entry_from_scancode(msi_wmi_input_dev,
eventcode);
if (key) {
@@ -175,8 +172,8 @@ static void msi_wmi_notify(u32 value, void *context)
/* Ignore event if the same event happened in a 50 ms
timeframe -> Key press may result in 10-20 GPEs */
if (ktime_to_us(diff) < 1000 * 50) {
- dprintk("Suppressed key event 0x%X - "
- "Last press was %lld us ago\n",
+ pr_debug("Suppressed key event 0x%X - "
+ "Last press was %lld us ago\n",
key->code, ktime_to_us(diff));
return;
}
@@ -187,17 +184,16 @@ static void msi_wmi_notify(u32 value, void *context)
(!acpi_video_backlight_support() ||
(key->code != MSI_WMI_BRIGHTNESSUP &&
key->code != MSI_WMI_BRIGHTNESSDOWN))) {
- dprintk("Send key: 0x%X - "
- "Input layer keycode: %d\n", key->code,
- key->keycode);
+ pr_debug("Send key: 0x%X - "
+ "Input layer keycode: %d\n",
+ key->code, key->keycode);
sparse_keymap_report_entry(msi_wmi_input_dev,
key, 1, true);
}
} else
- printk(KERN_INFO "Unknown key pressed - %x\n",
- eventcode);
+ pr_info("Unknown key pressed - %x\n", eventcode);
} else
- printk(KERN_INFO DRV_PFX "Unknown event received\n");
+ pr_info("Unknown event received\n");
kfree(response.pointer);
}

@@ -238,8 +234,7 @@ static int __init msi_wmi_init(void)
int err;

if (!wmi_has_guid(MSIWMI_EVENT_GUID)) {
- printk(KERN_ERR
- "This machine doesn't have MSI-hotkeys through WMI\n");
+ pr_err("This machine doesn't have MSI-hotkeys through WMI\n");
return -ENODEV;
}
err = wmi_install_notify_handler(MSIWMI_EVENT_GUID,
@@ -270,7 +265,7 @@ static int __init msi_wmi_init(void)

backlight->props.brightness = err;
}
- dprintk("Event handler installed\n");
+ pr_debug("Event handler installed\n");

return 0;

--
1.7.4.2.g597a6.dirty

2011-03-29 22:24:13

by Joe Perches

[permalink] [raw]
Subject: [PATCH 17/23] sony-laptop: Add and use #define pr_fmt

Add pr_fmt.
Remove now unused #define DRV_PRX.
Neaten dprintk macro.

Signed-off-by: Joe Perches <[email protected]>
---
drivers/platform/x86/sony-laptop.c | 104 +++++++++++++++++-------------------
1 files changed, 49 insertions(+), 55 deletions(-)

diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
index e642f5f..61cbd77 100644
--- a/drivers/platform/x86/sony-laptop.c
+++ b/drivers/platform/x86/sony-laptop.c
@@ -42,6 +42,8 @@
*
*/

+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
@@ -70,10 +72,10 @@
#include <linux/miscdevice.h>
#endif

-#define DRV_PFX "sony-laptop: "
-#define dprintk(msg...) do { \
- if (debug) \
- pr_warn(DRV_PFX msg); \
+#define dprintk(fmt, ...) \
+do { \
+ if (debug) \
+ pr_warn(fmt, ##__VA_ARGS__); \
} while (0)

#define SONY_LAPTOP_DRIVER_VERSION "0.6"
@@ -416,7 +418,7 @@ static int sony_laptop_setup_input(struct acpi_device *acpi_device)
error = kfifo_alloc(&sony_laptop_input.fifo,
SONY_LAPTOP_BUF_SIZE, GFP_KERNEL);
if (error) {
- pr_err(DRV_PFX "kfifo_alloc failed\n");
+ pr_err("kfifo_alloc failed\n");
goto err_dec_users;
}

@@ -700,7 +702,7 @@ static int acpi_callgetfunc(acpi_handle handle, char *name, int *result)
return 0;
}

- pr_warn(DRV_PFX "acpi_callreadfunc failed\n");
+ pr_warn("acpi_callreadfunc failed\n");

return -1;
}
@@ -726,8 +728,7 @@ static int acpi_callsetfunc(acpi_handle handle, char *name, int value,
if (status == AE_OK) {
if (result != NULL) {
if (out_obj.type != ACPI_TYPE_INTEGER) {
- pr_warn(DRV_PFX "acpi_evaluate_object bad "
- "return type\n");
+ pr_warn("acpi_evaluate_object bad return type\n");
return -1;
}
*result = out_obj.integer.value;
@@ -735,7 +736,7 @@ static int acpi_callsetfunc(acpi_handle handle, char *name, int value,
return 0;
}

- pr_warn(DRV_PFX "acpi_evaluate_object failed\n");
+ pr_warn("acpi_evaluate_object failed\n");

return -1;
}
@@ -1083,10 +1084,8 @@ static void sony_nc_notify(struct acpi_device *device, u32 event)
}

if (!key_event->data)
- pr_info(DRV_PFX
- "Unknown event: 0x%x 0x%x\n",
- key_handle,
- ev);
+ pr_info("Unknown event: 0x%x 0x%x\n",
+ key_handle, ev);
else
sony_laptop_report_input_event(ev);
}
@@ -1107,7 +1106,7 @@ static acpi_status sony_walk_callback(acpi_handle handle, u32 level,
struct acpi_device_info *info;

if (ACPI_SUCCESS(acpi_get_object_info(handle, &info))) {
- pr_warn(DRV_PFX "method: name: %4.4s, args %X\n",
+ pr_warn("method: name: %4.4s, args %X\n",
(char *)&info->name, info->param_count);

kfree(info);
@@ -1148,7 +1147,7 @@ static int sony_nc_resume(struct acpi_device *device)
ret = acpi_callsetfunc(sony_nc_acpi_handle, *item->acpiset,
item->value, NULL);
if (ret < 0) {
- pr_err(DRV_PFX "%s: %d\n", __func__, ret);
+ pr_err("%s: %d\n", __func__, ret);
break;
}
}
@@ -1312,12 +1311,12 @@ static void sony_nc_rfkill_setup(struct acpi_device *device)

device_enum = (union acpi_object *) buffer.pointer;
if (!device_enum) {
- pr_err(DRV_PFX "No SN06 return object.");
+ pr_err("No SN06 return object\n");
goto out_no_enum;
}
if (device_enum->type != ACPI_TYPE_BUFFER) {
- pr_err(DRV_PFX "Invalid SN06 return object 0x%.2x\n",
- device_enum->type);
+ pr_err("Invalid SN06 return object 0x%.2x\n",
+ device_enum->type);
goto out_no_enum;
}

@@ -1541,7 +1540,7 @@ static void sony_nc_backlight_setup(void)
ops, &props);

if (IS_ERR(sony_backlight_device)) {
- pr_warning(DRV_PFX "unable to register backlight device\n");
+ pr_warn("unable to register backlight device\n");
sony_backlight_device = NULL;
} else
sony_backlight_device->props.brightness =
@@ -1561,8 +1560,7 @@ static int sony_nc_add(struct acpi_device *device)
acpi_handle handle;
struct sony_nc_value *item;

- pr_info(DRV_PFX "%s v%s.\n", SONY_NC_DRIVER_NAME,
- SONY_LAPTOP_DRIVER_VERSION);
+ pr_info("%s v%s\n", SONY_NC_DRIVER_NAME, SONY_LAPTOP_DRIVER_VERSION);

sony_nc_acpi_device = device;
strcpy(acpi_device_class(device), "sony/hotkey");
@@ -1587,7 +1585,7 @@ static int sony_nc_add(struct acpi_device *device)
sony_nc_acpi_handle, 1, sony_walk_callback,
NULL, NULL, NULL);
if (ACPI_FAILURE(status)) {
- pr_warn(DRV_PFX "unable to walk acpi resources\n");
+ pr_warn("unable to walk acpi resources\n");
result = -ENODEV;
goto outpresent;
}
@@ -1615,13 +1613,12 @@ static int sony_nc_add(struct acpi_device *device)
/* setup input devices and helper fifo */
result = sony_laptop_setup_input(device);
if (result) {
- pr_err(DRV_PFX "Unable to create input devices.\n");
+ pr_err("Unable to create input devices\n");
goto outkbdbacklight;
}

if (acpi_video_backlight_support()) {
- pr_info(DRV_PFX "brightness ignored, must be "
- "controlled by ACPI video driver\n");
+ pr_info("brightness ignored, must be controlled by ACPI video driver\n");
} else {
sony_nc_backlight_setup();
}
@@ -2144,9 +2141,9 @@ out:
if (pcidev)
pci_dev_put(pcidev);

- pr_info(DRV_PFX "detected Type%d model\n",
- dev->model == SONYPI_DEVICE_TYPE1 ? 1 :
- dev->model == SONYPI_DEVICE_TYPE2 ? 2 : 3);
+ pr_info("detected Type%d model\n",
+ dev->model == SONYPI_DEVICE_TYPE1 ? 1 :
+ dev->model == SONYPI_DEVICE_TYPE2 ? 2 : 3);
}

/* camera tests and poweron/poweroff */
@@ -2192,7 +2189,7 @@ static int __sony_pic_camera_ready(void)
static int __sony_pic_camera_off(void)
{
if (!camera) {
- pr_warn(DRV_PFX "camera control not enabled\n");
+ pr_warn("camera control not enabled\n");
return -ENODEV;
}

@@ -2212,7 +2209,7 @@ static int __sony_pic_camera_on(void)
int i, j, x;

if (!camera) {
- pr_warn(DRV_PFX "camera control not enabled\n");
+ pr_warn("camera control not enabled\n");
return -ENODEV;
}

@@ -2235,7 +2232,7 @@ static int __sony_pic_camera_on(void)
}

if (j == 0) {
- pr_warn(DRV_PFX "failed to power on camera\n");
+ pr_warn("failed to power on camera\n");
return -ENODEV;
}

@@ -2291,8 +2288,7 @@ int sony_pic_camera_command(int command, u8 value)
ITERATIONS_SHORT);
break;
default:
- pr_err(DRV_PFX "sony_pic_camera_command invalid: %d\n",
- command);
+ pr_err("sony_pic_camera_command invalid: %d\n", command);
break;
}
mutex_unlock(&spic_dev.lock);
@@ -2698,7 +2694,7 @@ static int sonypi_compat_init(void)
error =
kfifo_alloc(&sonypi_compat.fifo, SONY_LAPTOP_BUF_SIZE, GFP_KERNEL);
if (error) {
- pr_err(DRV_PFX "kfifo_alloc failed\n");
+ pr_err("kfifo_alloc failed\n");
return error;
}

@@ -2708,12 +2704,12 @@ static int sonypi_compat_init(void)
sonypi_misc_device.minor = minor;
error = misc_register(&sonypi_misc_device);
if (error) {
- pr_err(DRV_PFX "misc_register failed\n");
+ pr_err("misc_register failed\n");
goto err_free_kfifo;
}
if (minor == -1)
- pr_info(DRV_PFX "device allocated minor is %d\n",
- sonypi_misc_device.minor);
+ pr_info("device allocated minor is %d\n",
+ sonypi_misc_device.minor);

return 0;

@@ -2772,8 +2768,8 @@ sony_pic_read_possible_resource(struct acpi_resource *resource, void *context)
}
for (i = 0; i < p->interrupt_count; i++) {
if (!p->interrupts[i]) {
- pr_warn(DRV_PFX "Invalid IRQ %d\n",
- p->interrupts[i]);
+ pr_warn("Invalid IRQ %d\n",
+ p->interrupts[i]);
continue;
}
interrupt = kzalloc(sizeof(*interrupt),
@@ -2811,14 +2807,14 @@ sony_pic_read_possible_resource(struct acpi_resource *resource, void *context)
ioport->io2.address_length);
}
else {
- pr_err(DRV_PFX "Unknown SPIC Type, more than 2 IO Ports\n");
+ pr_err("Unknown SPIC Type, more than 2 IO Ports\n");
return AE_ERROR;
}
return AE_OK;
}
default:
dprintk("Resource %d isn't an IRQ nor an IO port\n",
- resource->type);
+ resource->type);

case ACPI_RESOURCE_TYPE_END_TAG:
return AE_OK;
@@ -2839,7 +2835,7 @@ static int sony_pic_possible_resources(struct acpi_device *device)
dprintk("Evaluating _STA\n");
result = acpi_bus_get_status(device);
if (result) {
- pr_warn(DRV_PFX "Unable to read status\n");
+ pr_warn("Unable to read status\n");
goto end;
}

@@ -2855,8 +2851,7 @@ static int sony_pic_possible_resources(struct acpi_device *device)
status = acpi_walk_resources(device->handle, METHOD_NAME__PRS,
sony_pic_read_possible_resource, &spic_dev);
if (ACPI_FAILURE(status)) {
- pr_warn(DRV_PFX "Failure evaluating %s\n",
- METHOD_NAME__PRS);
+ pr_warn("Failure evaluating %s\n", METHOD_NAME__PRS);
result = -ENODEV;
}
end:
@@ -2969,7 +2964,7 @@ static int sony_pic_enable(struct acpi_device *device,

/* check for total failure */
if (ACPI_FAILURE(status)) {
- pr_err(DRV_PFX "Error evaluating _SRS\n");
+ pr_err("Error evaluating _SRS\n");
result = -ENODEV;
goto end;
}
@@ -3061,7 +3056,7 @@ static int sony_pic_remove(struct acpi_device *device, int type)
struct sony_pic_irq *irq, *tmp_irq;

if (sony_pic_disable(device)) {
- pr_err(DRV_PFX "Couldn't disable device.\n");
+ pr_err("Couldn't disable device\n");
return -ENXIO;
}

@@ -3101,8 +3096,7 @@ static int sony_pic_add(struct acpi_device *device)
struct sony_pic_ioport *io, *tmp_io;
struct sony_pic_irq *irq, *tmp_irq;

- pr_info(DRV_PFX "%s v%s.\n", SONY_PIC_DRIVER_NAME,
- SONY_LAPTOP_DRIVER_VERSION);
+ pr_info("%s v%s\n", SONY_PIC_DRIVER_NAME, SONY_LAPTOP_DRIVER_VERSION);

spic_dev.acpi_dev = device;
strcpy(acpi_device_class(device), "sony/hotkey");
@@ -3112,14 +3106,14 @@ static int sony_pic_add(struct acpi_device *device)
/* read _PRS resources */
result = sony_pic_possible_resources(device);
if (result) {
- pr_err(DRV_PFX "Unable to read possible resources.\n");
+ pr_err("Unable to read possible resources\n");
goto err_free_resources;
}

/* setup input devices and helper fifo */
result = sony_laptop_setup_input(device);
if (result) {
- pr_err(DRV_PFX "Unable to create input devices.\n");
+ pr_err("Unable to create input devices\n");
goto err_free_resources;
}

@@ -3160,7 +3154,7 @@ static int sony_pic_add(struct acpi_device *device)
}
}
if (!spic_dev.cur_ioport) {
- pr_err(DRV_PFX "Failed to request_region.\n");
+ pr_err("Failed to request_region\n");
result = -ENODEV;
goto err_remove_compat;
}
@@ -3180,7 +3174,7 @@ static int sony_pic_add(struct acpi_device *device)
}
}
if (!spic_dev.cur_irq) {
- pr_err(DRV_PFX "Failed to request_irq.\n");
+ pr_err("Failed to request_irq\n");
result = -ENODEV;
goto err_release_region;
}
@@ -3188,7 +3182,7 @@ static int sony_pic_add(struct acpi_device *device)
/* set resource status _SRS */
result = sony_pic_enable(device, spic_dev.cur_ioport, spic_dev.cur_irq);
if (result) {
- pr_err(DRV_PFX "Couldn't enable device.\n");
+ pr_err("Couldn't enable device\n");
goto err_free_irq;
}

@@ -3297,7 +3291,7 @@ static int __init sony_laptop_init(void)
if (!no_spic && dmi_check_system(sonypi_dmi_table)) {
result = acpi_bus_register_driver(&sony_pic_driver);
if (result) {
- pr_err(DRV_PFX "Unable to register SPIC driver.");
+ pr_err("Unable to register SPIC driver\n");
goto out;
}
spic_drv_registered = 1;
@@ -3305,7 +3299,7 @@ static int __init sony_laptop_init(void)

result = acpi_bus_register_driver(&sony_nc_driver);
if (result) {
- pr_err(DRV_PFX "Unable to register SNC driver.");
+ pr_err("Unable to register SNC driver\n");
goto out_unregister_pic;
}

--
1.7.4.2.g597a6.dirty

2011-03-29 22:24:43

by Joe Perches

[permalink] [raw]
Subject: [PATCH 14/23] intel_pmic_gpio: Convert printks to pr_<level>

Add #define pr_fmt(fmt) "%s: " fmt, __func__
to prefix function name to each output message.
Convert printks to pr_<level>.

Signed-off-by: Joe Perches <[email protected]>
---
drivers/platform/x86/intel_pmic_gpio.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/platform/x86/intel_pmic_gpio.c b/drivers/platform/x86/intel_pmic_gpio.c
index 61433d4..40b5283 100644
--- a/drivers/platform/x86/intel_pmic_gpio.c
+++ b/drivers/platform/x86/intel_pmic_gpio.c
@@ -19,6 +19,8 @@
* Moorestown platform PMIC chip
*/

+#define pr_fmt(fmt) "%s: " fmt, __func__
+
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/interrupt.h>
@@ -77,8 +79,7 @@ struct pmic_gpio {
static int pmic_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
{
if (offset > 8) {
- printk(KERN_ERR
- "%s: only pin 0-7 support input\n", __func__);
+ pr_err("only pin 0-7 support input\n");
return -1;/* we only have 8 GPIO can use as input */
}
return intel_scu_ipc_update_register(GPIO0 + offset,
@@ -103,8 +104,7 @@ static int pmic_gpio_direction_output(struct gpio_chip *chip,
value ? 1 << (offset - 16) : 0,
1 << (offset - 16));
else {
- printk(KERN_ERR
- "%s: invalid PMIC GPIO pin %d!\n", __func__, offset);
+ pr_err("invalid PMIC GPIO pin %d!\n", offset);
WARN_ON(1);
}

@@ -225,7 +225,7 @@ static int __devinit platform_pmic_gpio_probe(struct platform_device *pdev)
/* setting up SRAM mapping for GPIOINT register */
pg->gpiointr = ioremap_nocache(pdata->gpiointr, 8);
if (!pg->gpiointr) {
- printk(KERN_ERR "%s: Can not map GPIOINT.\n", __func__);
+ pr_err("Can not map GPIOINT\n");
retval = -EINVAL;
goto err2;
}
@@ -246,13 +246,13 @@ static int __devinit platform_pmic_gpio_probe(struct platform_device *pdev)
pg->chip.dev = dev;
retval = gpiochip_add(&pg->chip);
if (retval) {
- printk(KERN_ERR "%s: Can not add pmic gpio chip.\n", __func__);
+ pr_err("Can not add pmic gpio chip\n");
goto err;
}

retval = request_irq(pg->irq, pmic_irq_handler, 0, "pmic", pg);
if (retval) {
- printk(KERN_WARNING "pmic: Interrupt request failed\n");
+ pr_warn("Interrupt request failed\n");
goto err;
}

--
1.7.4.2.g597a6.dirty

2011-03-29 22:25:28

by Joe Perches

[permalink] [raw]
Subject: [PATCH 12/23] ideapad-laptop: Add pr_fmt

Add pr_fmt to prefix logging messages.

Signed-off-by: Joe Perches <[email protected]>
---
drivers/platform/x86/ideapad-laptop.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
index 21b1018..bfdda33 100644
--- a/drivers/platform/x86/ideapad-laptop.c
+++ b/drivers/platform/x86/ideapad-laptop.c
@@ -20,6 +20,8 @@
* 02110-1301, USA.
*/

+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
--
1.7.4.2.g597a6.dirty

2011-03-29 22:22:30

by Joe Perches

[permalink] [raw]
Subject: [PATCH 10/23] hp-wmi: Convert printks to pr_<level>

Added pr_fmt and converted printks to pr_<level>.
Removed now unused PREFIX and UNIMPL #defines.

Signed-off-by: Joe Perches <[email protected]>
---
drivers/platform/x86/hp-wmi.c | 43 ++++++++++++++++------------------------
1 files changed, 17 insertions(+), 26 deletions(-)

diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c
index 1bc4a75..f94017b 100644
--- a/drivers/platform/x86/hp-wmi.c
+++ b/drivers/platform/x86/hp-wmi.c
@@ -24,6 +24,8 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
@@ -54,9 +56,6 @@ MODULE_ALIAS("wmi:5FB7F034-2C63-45e9-BE91-3D44E2C707E4");
#define HPWMI_HOTKEY_QUERY 0xc
#define HPWMI_WIRELESS2_QUERY 0x1b

-#define PREFIX "HP WMI: "
-#define UNIMP "Unimplemented "
-
enum hp_wmi_radio {
HPWMI_WIFI = 0,
HPWMI_BLUETOOTH = 1,
@@ -228,9 +227,8 @@ static int hp_wmi_perform_query(int query, int write, void *buffer,

if (bios_return->return_code) {
if (bios_return->return_code != HPWMI_RET_UNKNOWN_CMDTYPE)
- printk(KERN_WARNING PREFIX "query 0x%x returned "
- "error 0x%x\n",
- query, bios_return->return_code);
+ pr_warn("query 0x%x returned error 0x%x\n",
+ query, bios_return->return_code);
kfree(obj);
return bios_return->return_code;
}
@@ -384,8 +382,7 @@ static int hp_wmi_rfkill2_refresh(void)

if (num >= state.count ||
devstate->rfkill_id != rfkill2[i].id) {
- printk(KERN_WARNING PREFIX "power configuration of "
- "the wireless devices unexpectedly changed\n");
+ pr_warn("power configuration of the wireless devices unexpectedly changed\n");
continue;
}

@@ -471,7 +468,7 @@ static void hp_wmi_notify(u32 value, void *context)

status = wmi_get_event_data(value, &response);
if (status != AE_OK) {
- printk(KERN_INFO PREFIX "bad event status 0x%x\n", status);
+ pr_info("bad event status 0x%x\n", status);
return;
}

@@ -480,8 +477,7 @@ static void hp_wmi_notify(u32 value, void *context)
if (!obj)
return;
if (obj->type != ACPI_TYPE_BUFFER) {
- printk(KERN_INFO "hp-wmi: Unknown response received %d\n",
- obj->type);
+ pr_info("Unknown response received %d\n", obj->type);
kfree(obj);
return;
}
@@ -498,8 +494,7 @@ static void hp_wmi_notify(u32 value, void *context)
event_id = *location;
event_data = *(location + 2);
} else {
- printk(KERN_INFO "hp-wmi: Unknown buffer length %d\n",
- obj->buffer.length);
+ pr_info("Unknown buffer length %d\n", obj->buffer.length);
kfree(obj);
return;
}
@@ -527,8 +522,7 @@ static void hp_wmi_notify(u32 value, void *context)

if (!sparse_keymap_report_event(hp_wmi_input_dev,
key_code, 1, true))
- printk(KERN_INFO PREFIX "Unknown key code - 0x%x\n",
- key_code);
+ pr_info("Unknown key code - 0x%x\n", key_code);
break;
case HPWMI_WIRELESS:
if (rfkill2_count) {
@@ -550,14 +544,12 @@ static void hp_wmi_notify(u32 value, void *context)
hp_wmi_get_hw_state(HPWMI_WWAN));
break;
case HPWMI_CPU_BATTERY_THROTTLE:
- printk(KERN_INFO PREFIX UNIMP "CPU throttle because of 3 Cell"
- " battery event detected\n");
+ pr_info("Unimplemented CPU throttle because of 3 Cell battery event detected\n");
break;
case HPWMI_LOCK_SWITCH:
break;
default:
- printk(KERN_INFO PREFIX "Unknown event_id - %d - 0x%x\n",
- event_id, event_data);
+ pr_info("Unknown event_id - %d - 0x%x\n", event_id, event_data);
break;
}
}
@@ -705,7 +697,7 @@ static int __devinit hp_wmi_rfkill2_setup(struct platform_device *device)
return err;

if (state.count > HPWMI_MAX_RFKILL2_DEVICES) {
- printk(KERN_WARNING PREFIX "unable to parse 0x1b query output\n");
+ pr_warn("unable to parse 0x1b query output\n");
return -EINVAL;
}

@@ -727,14 +719,14 @@ static int __devinit hp_wmi_rfkill2_setup(struct platform_device *device)
name = "hp-wwan";
break;
default:
- printk(KERN_WARNING PREFIX "unknown device type 0x%x\n",
- state.device[i].radio_type);
+ pr_warn("unknown device type 0x%x\n",
+ state.device[i].radio_type);
continue;
}

if (!state.device[i].vendor_id) {
- printk(KERN_WARNING PREFIX "zero device %d while %d "
- "reported\n", i, state.count);
+ pr_warn("zero device %d while %d reported\n",
+ i, state.count);
continue;
}

@@ -755,8 +747,7 @@ static int __devinit hp_wmi_rfkill2_setup(struct platform_device *device)
IS_HWBLOCKED(state.device[i].power));

if (!(state.device[i].power & HPWMI_POWER_BIOS))
- printk(KERN_INFO PREFIX "device %s blocked by BIOS\n",
- name);
+ pr_info("device %s blocked by BIOS\n", name);

err = rfkill_register(rfkill);
if (err) {
--
1.7.4.2.g597a6.dirty

2011-03-29 22:25:50

by Joe Perches

[permalink] [raw]
Subject: [PATCH 11/23] 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: Joe Perches <[email protected]>
---
drivers/platform/x86/ibm_rtl.c | 19 +++++++++++--------
1 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/drivers/platform/x86/ibm_rtl.c b/drivers/platform/x86/ibm_rtl.c
index f0b0683..b9bf63f 100644
--- a/drivers/platform/x86/ibm_rtl.c
+++ b/drivers/platform/x86/ibm_rtl.c
@@ -22,6 +22,8 @@
*
*/

+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/module.h>
@@ -69,9 +71,10 @@ struct ibm_rtl_table {
#define RTL_SIGNATURE 0x0000005f4c54525fULL
#define RTL_MASK 0x000000ffffffffffULL

-#define RTL_DEBUG(A, ...) do { \
- if (debug) \
- pr_info("ibm-rtl: " A, ##__VA_ARGS__ ); \
+#define RTL_DEBUG(fmt, ...) \
+do { \
+ if (debug) \
+ pr_info(fmt, ##__VA_ARGS__); \
} while (0)

static DEFINE_MUTEX(rtl_lock);
@@ -101,7 +104,7 @@ static int ibm_rtl_write(u8 value)
int ret = 0, count = 0;
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;

@@ -131,8 +134,8 @@ static int ibm_rtl_write(u8 value)
while (ioread8(&rtl_table->command)) {
msleep(10);
if (count++ > 500) {
- pr_err("ibm-rtl: Hardware not responding to "
- "mode switch request\n");
+ pr_err("Hardware not responding to "
+ "mode switch request\n");
ret = -EIO;
break;
}
@@ -237,7 +240,7 @@ static int __init ibm_rtl_init(void) {
int ret = -ENODEV, i;

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 */
else if (efi_enabled || !dmi_check_system(ibm_rtl_dmi_table))
return -ENODEV;
@@ -282,7 +285,7 @@ static int __init ibm_rtl_init(void) {
rtl_cmd_width = ioread8(&rtl_table->cmd_granularity);
rtl_cmd_type = ioread8(&rtl_table->cmd_address_type);
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);
RTL_DEBUG("addr = %#llx\n", (unsigned long long)addr);
plen = rtl_cmd_width/sizeof(char);
--
1.7.4.2.g597a6.dirty

2011-03-29 22:26:17

by Joe Perches

[permalink] [raw]
Subject: [PATCH 08/23] fujitsu-laptop: Convert printks to pr_<level>

Added pr_fmt, converted printks and removed
hard coded prefixes.

Signed-off-by: Joe Perches <[email protected]>
---
drivers/platform/x86/fujitsu-laptop.c | 39 ++++++++++++++++-----------------
1 files changed, 19 insertions(+), 20 deletions(-)

diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c
index 493054c..6b26666 100644
--- a/drivers/platform/x86/fujitsu-laptop.c
+++ b/drivers/platform/x86/fujitsu-laptop.c
@@ -56,6 +56,8 @@
*
*/

+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
@@ -585,8 +587,7 @@ static struct platform_driver fujitsupf_driver = {
static void dmi_check_cb_common(const struct dmi_system_id *id)
{
acpi_handle handle;
- printk(KERN_INFO "fujitsu-laptop: Identified laptop model '%s'.\n",
- id->ident);
+ pr_info("Identified laptop model '%s'\n", id->ident);
if (use_alt_lcd_levels == -1) {
if (ACPI_SUCCESS(acpi_get_handle(NULL,
"\\_SB.PCI0.LPCB.FJEX.SBL2", &handle)))
@@ -691,11 +692,11 @@ static int acpi_fujitsu_add(struct acpi_device *device)

result = acpi_bus_update_power(fujitsu->acpi_handle, &state);
if (result) {
- printk(KERN_ERR "Error reading power state\n");
+ pr_err("Error reading power state\n");
goto err_unregister_input_dev;
}

- printk(KERN_INFO "ACPI: %s [%s] (%s)\n",
+ pr_info("ACPI: %s [%s] (%s)\n",
acpi_device_name(device), acpi_device_bid(device),
!device->power.state ? "on" : "off");

@@ -707,7 +708,7 @@ static int acpi_fujitsu_add(struct acpi_device *device)
if (ACPI_FAILURE
(acpi_evaluate_object
(device->handle, METHOD_NAME__INI, NULL, NULL)))
- printk(KERN_ERR "_INI Method failed\n");
+ pr_err("_INI Method failed\n");
}

/* do config (detect defaults) */
@@ -827,7 +828,7 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device)
error = kfifo_alloc(&fujitsu_hotkey->fifo, RINGBUFFERSIZE * sizeof(int),
GFP_KERNEL);
if (error) {
- printk(KERN_ERR "kfifo_alloc failed\n");
+ pr_err("kfifo_alloc failed\n");
goto err_stop;
}

@@ -859,13 +860,13 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device)

result = acpi_bus_update_power(fujitsu_hotkey->acpi_handle, &state);
if (result) {
- printk(KERN_ERR "Error reading power state\n");
+ pr_err("Error reading power state\n");
goto err_unregister_input_dev;
}

- printk(KERN_INFO "ACPI: %s [%s] (%s)\n",
- acpi_device_name(device), acpi_device_bid(device),
- !device->power.state ? "on" : "off");
+ pr_info("ACPI: %s [%s] (%s)\n",
+ acpi_device_name(device), acpi_device_bid(device),
+ !device->power.state ? "on" : "off");

fujitsu_hotkey->dev = device;

@@ -875,7 +876,7 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device)
if (ACPI_FAILURE
(acpi_evaluate_object
(device->handle, METHOD_NAME__INI, NULL, NULL)))
- printk(KERN_ERR "_INI Method failed\n");
+ pr_err("_INI Method failed\n");
}

i = 0;
@@ -897,8 +898,7 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device)
call_fext_func(FUNC_RFKILL, 0x4, 0x0, 0x0);

/* Suspect this is a keymap of the application panel, print it */
- printk(KERN_INFO "fujitsu-laptop: BTNI: [0x%x]\n",
- call_fext_func(FUNC_BUTTONS, 0x0, 0x0, 0x0));
+ pr_info("BTNI: [0x%x]\n", call_fext_func(FUNC_BUTTONS, 0x0, 0x0, 0x0));

#if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE)
if (call_fext_func(FUNC_LEDS, 0x0, 0x0, 0x0) & LOGOLAMP_POWERON) {
@@ -907,8 +907,8 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device)
if (result == 0) {
fujitsu_hotkey->logolamp_registered = 1;
} else {
- printk(KERN_ERR "fujitsu-laptop: Could not register "
- "LED handler for logo lamp, error %i\n", result);
+ pr_err("Could not register LED handler for logo lamp, error %i\n",
+ result);
}
}

@@ -919,8 +919,8 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device)
if (result == 0) {
fujitsu_hotkey->kblamps_registered = 1;
} else {
- printk(KERN_ERR "fujitsu-laptop: Could not register "
- "LED handler for keyboard lamps, error %i\n", result);
+ pr_err("Could not register LED handler for keyboard lamps, error %i\n",
+ result);
}
}
#endif
@@ -1169,8 +1169,7 @@ static int __init fujitsu_init(void)
fujitsu->bl_device->props.power = 0;
}

- printk(KERN_INFO "fujitsu-laptop: driver " FUJITSU_DRIVER_VERSION
- " successfully loaded.\n");
+ pr_info("driver " FUJITSU_DRIVER_VERSION " successfully loaded\n");

return 0;

@@ -1216,7 +1215,7 @@ static void __exit fujitsu_cleanup(void)

kfree(fujitsu);

- printk(KERN_INFO "fujitsu-laptop: driver unloaded.\n");
+ pr_info("driver unloaded\n");
}

module_init(fujitsu_init);
--
1.7.4.2.g597a6.dirty

2011-03-29 22:22:18

by Joe Perches

[permalink] [raw]
Subject: [PATCH 03/23] acer-wmi: pr_<level> cleanups

Convert pr_warning to pr_warn.
Add some missing newlines to pr_<level> uses.

Signed-off-by: Joe Perches <[email protected]>
---
drivers/platform/x86/acer-wmi.c | 32 ++++++++++++++++----------------
1 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
index 5ea6c34..0b23b75 100644
--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -1081,7 +1081,7 @@ static acpi_status wmid3_get_device_status(u32 *value, u16 device)
return AE_ERROR;
}
if (obj->buffer.length != 8) {
- pr_warning("Unknown buffer length %d\n", obj->buffer.length);
+ pr_warn("Unknown buffer length %d\n", obj->buffer.length);
kfree(obj);
return AE_ERROR;
}
@@ -1090,8 +1090,8 @@ static acpi_status wmid3_get_device_status(u32 *value, u16 device)
kfree(obj);

if (return_value.error_code || return_value.ec_return_value)
- pr_warning("Get Device Status failed: "
- "0x%x - 0x%x\n", return_value.error_code,
+ pr_warn("Get Device Status failed: 0x%x - 0x%x\n",
+ return_value.error_code,
return_value.ec_return_value);
else
*value = !!(return_value.devices & device);
@@ -1317,7 +1317,7 @@ static void acer_wmi_notify(u32 value, void *context)

status = wmi_get_event_data(value, &response);
if (status != AE_OK) {
- pr_warning("bad event status 0x%x\n", status);
+ pr_warn("bad event status 0x%x\n", status);
return;
}

@@ -1326,12 +1326,12 @@ static void acer_wmi_notify(u32 value, void *context)
if (!obj)
return;
if (obj->type != ACPI_TYPE_BUFFER) {
- pr_warning("Unknown response received %d\n", obj->type);
+ pr_warn("Unknown response received %d\n", obj->type);
kfree(obj);
return;
}
if (obj->buffer.length != 8) {
- pr_warning("Unknown buffer length %d\n", obj->buffer.length);
+ pr_warn("Unknown buffer length %d\n", obj->buffer.length);
kfree(obj);
return;
}
@@ -1356,11 +1356,11 @@ static void acer_wmi_notify(u32 value, void *context)
}
if (!sparse_keymap_report_event(acer_wmi_input_dev,
return_value.key_num, 1, true))
- pr_warning("Unknown key number - 0x%x\n",
+ pr_warn("Unknown key number - 0x%x\n",
return_value.key_num);
break;
default:
- pr_warning("Unknown function number - %d - %d\n",
+ pr_warn("Unknown function number - %d - %d\n",
return_value.function, return_value.key_num);
break;
}
@@ -1389,7 +1389,7 @@ wmid3_set_lm_mode(struct lm_input_params *params,
return AE_ERROR;
}
if (obj->buffer.length != 4) {
- pr_warning("Unknown buffer length %d\n", obj->buffer.length);
+ pr_warn("Unknown buffer length %d\n", obj->buffer.length);
kfree(obj);
return AE_ERROR;
}
@@ -1414,11 +1414,11 @@ static int acer_wmi_enable_ec_raw(void)
status = wmid3_set_lm_mode(&params, &return_value);

if (return_value.error_code || return_value.ec_return_value)
- pr_warning("Enabling EC raw mode failed: "
- "0x%x - 0x%x\n", return_value.error_code,
- return_value.ec_return_value);
+ pr_warn("Enabling EC raw mode failed: 0x%x - 0x%x\n",
+ return_value.error_code,
+ return_value.ec_return_value);
else
- pr_info("Enabled EC raw mode");
+ pr_info("Enabled EC raw mode\n");

return status;
}
@@ -1437,9 +1437,9 @@ static int acer_wmi_enable_lm(void)
status = wmid3_set_lm_mode(&params, &return_value);

if (return_value.error_code || return_value.ec_return_value)
- pr_warning("Enabling Launch Manager failed: "
- "0x%x - 0x%x\n", return_value.error_code,
- return_value.ec_return_value);
+ pr_warn("Enabling Launch Manager failed: 0x%x - 0x%x\n",
+ return_value.error_code,
+ return_value.ec_return_value);

return status;
}
--
1.7.4.2.g597a6.dirty

2011-03-29 22:26:52

by Joe Perches

[permalink] [raw]
Subject: [PATCH 04/23] asus: Add pr_fmt and convert printks to pr_<level>

Add pr_fmt, prefixes each log message.
Convert printks to pr_<level>.
Convert pr_warning to pr_warn.

Signed-off-by: Joe Perches <[email protected]>
---
drivers/platform/x86/asus-laptop.c | 34 ++++++++--------
drivers/platform/x86/asus-wmi.c | 20 +++++-----
drivers/platform/x86/asus_acpi.c | 77 +++++++++++++++---------------------
3 files changed, 59 insertions(+), 72 deletions(-)

diff --git a/drivers/platform/x86/asus-laptop.c b/drivers/platform/x86/asus-laptop.c
index c53b3ff..d65df92 100644
--- a/drivers/platform/x86/asus-laptop.c
+++ b/drivers/platform/x86/asus-laptop.c
@@ -318,7 +318,7 @@ static int acpi_check_handle(acpi_handle handle, const char *method,

if (status != AE_OK) {
if (ret)
- pr_warning("Error finding %s\n", method);
+ pr_warn("Error finding %s\n", method);
return -ENODEV;
}
return 0;
@@ -383,7 +383,7 @@ static int asus_kled_lvl(struct asus_laptop *asus)
rv = acpi_evaluate_integer(asus->handle, METHOD_KBD_LIGHT_GET,
&params, &kblv);
if (ACPI_FAILURE(rv)) {
- pr_warning("Error reading kled level\n");
+ pr_warn("Error reading kled level\n");
return -ENODEV;
}
return kblv;
@@ -397,7 +397,7 @@ static int asus_kled_set(struct asus_laptop *asus, int kblv)
kblv = 0;

if (write_acpi_int(asus->handle, METHOD_KBD_LIGHT_SET, kblv)) {
- pr_warning("Keyboard LED display write failed\n");
+ pr_warn("Keyboard LED display write failed\n");
return -EINVAL;
}
return 0;
@@ -531,7 +531,7 @@ static int asus_read_brightness(struct backlight_device *bd)
rv = acpi_evaluate_integer(asus->handle, METHOD_BRIGHTNESS_GET,
NULL, &value);
if (ACPI_FAILURE(rv))
- pr_warning("Error reading brightness\n");
+ pr_warn("Error reading brightness\n");

return value;
}
@@ -541,7 +541,7 @@ static int asus_set_brightness(struct backlight_device *bd, int value)
struct asus_laptop *asus = bl_get_data(bd);

if (write_acpi_int(asus->handle, METHOD_BRIGHTNESS_SET, value)) {
- pr_warning("Error changing brightness\n");
+ pr_warn("Error changing brightness\n");
return -EIO;
}
return 0;
@@ -730,7 +730,7 @@ static ssize_t store_ledd(struct device *dev, struct device_attribute *attr,
rv = parse_arg(buf, count, &value);
if (rv > 0) {
if (write_acpi_int(asus->handle, METHOD_LEDD, value)) {
- pr_warning("LED display write failed\n");
+ pr_warn("LED display write failed\n");
return -ENODEV;
}
asus->ledd_status = (u32) value;
@@ -752,7 +752,7 @@ static int asus_wireless_status(struct asus_laptop *asus, int mask)
rv = acpi_evaluate_integer(asus->handle, METHOD_WL_STATUS,
NULL, &status);
if (ACPI_FAILURE(rv)) {
- pr_warning("Error reading Wireless status\n");
+ pr_warn("Error reading Wireless status\n");
return -EINVAL;
}
return !!(status & mask);
@@ -764,7 +764,7 @@ static int asus_wireless_status(struct asus_laptop *asus, int mask)
static int asus_wlan_set(struct asus_laptop *asus, int status)
{
if (write_acpi_int(asus->handle, METHOD_WLAN, !!status)) {
- pr_warning("Error setting wlan status to %d", status);
+ pr_warn("Error setting wlan status to %d\n", status);
return -EIO;
}
return 0;
@@ -792,7 +792,7 @@ static ssize_t store_wlan(struct device *dev, struct device_attribute *attr,
static int asus_bluetooth_set(struct asus_laptop *asus, int status)
{
if (write_acpi_int(asus->handle, METHOD_BLUETOOTH, !!status)) {
- pr_warning("Error setting bluetooth status to %d", status);
+ pr_warn("Error setting bluetooth status to %d\n", status);
return -EIO;
}
return 0;
@@ -821,7 +821,7 @@ static ssize_t store_bluetooth(struct device *dev,
static int asus_wimax_set(struct asus_laptop *asus, int status)
{
if (write_acpi_int(asus->handle, METHOD_WIMAX, !!status)) {
- pr_warning("Error setting wimax status to %d", status);
+ pr_warn("Error setting wimax status to %d\n", status);
return -EIO;
}
return 0;
@@ -850,7 +850,7 @@ static ssize_t store_wimax(struct device *dev,
static int asus_wwan_set(struct asus_laptop *asus, int status)
{
if (write_acpi_int(asus->handle, METHOD_WWAN, !!status)) {
- pr_warning("Error setting wwan status to %d", status);
+ pr_warn("Error setting wwan status to %d\n", status);
return -EIO;
}
return 0;
@@ -880,7 +880,7 @@ static void asus_set_display(struct asus_laptop *asus, int value)
{
/* no sanity check needed for now */
if (write_acpi_int(asus->handle, METHOD_SWITCH_DISPLAY, value))
- pr_warning("Error setting display\n");
+ pr_warn("Error setting display\n");
return;
}

@@ -909,7 +909,7 @@ static ssize_t store_disp(struct device *dev, struct device_attribute *attr,
static void asus_als_switch(struct asus_laptop *asus, int value)
{
if (write_acpi_int(asus->handle, METHOD_ALS_CONTROL, value))
- pr_warning("Error setting light sensor switch\n");
+ pr_warn("Error setting light sensor switch\n");
asus->light_switch = value;
}

@@ -937,7 +937,7 @@ static ssize_t store_lssw(struct device *dev, struct device_attribute *attr,
static void asus_als_level(struct asus_laptop *asus, int value)
{
if (write_acpi_int(asus->handle, METHOD_ALS_LEVEL, value))
- pr_warning("Error setting light sensor level\n");
+ pr_warn("Error setting light sensor level\n");
asus->light_level = value;
}

@@ -976,7 +976,7 @@ static int asus_gps_status(struct asus_laptop *asus)
rv = acpi_evaluate_integer(asus->handle, METHOD_GPS_STATUS,
NULL, &status);
if (ACPI_FAILURE(rv)) {
- pr_warning("Error reading GPS status\n");
+ pr_warn("Error reading GPS status\n");
return -ENODEV;
}
return !!status;
@@ -1284,7 +1284,7 @@ static int asus_laptop_get_info(struct asus_laptop *asus)
*/
status = acpi_get_table(ACPI_SIG_DSDT, 1, &asus->dsdt_info);
if (ACPI_FAILURE(status))
- pr_warning("Couldn't get the DSDT table header\n");
+ pr_warn("Couldn't get the DSDT table header\n");

/* We have to write 0 on init this far for all ASUS models */
if (write_acpi_int_ret(asus->handle, "INIT", 0, &buffer)) {
@@ -1296,7 +1296,7 @@ static int asus_laptop_get_info(struct asus_laptop *asus)
status =
acpi_evaluate_integer(asus->handle, "BSTS", NULL, &bsts_result);
if (ACPI_FAILURE(status))
- pr_warning("Error calling BSTS\n");
+ pr_warn("Error calling BSTS\n");
else if (bsts_result)
pr_notice("BSTS called, 0x%02x returned\n",
(uint) bsts_result);
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index c382af6..8edc882 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -425,7 +425,7 @@ static void asus_rfkill_hotplug(struct asus_wmi *asus)
if (asus->hotplug_slot) {
bus = pci_find_bus(0, 1);
if (!bus) {
- pr_warning("Unable to find PCI bus 1?\n");
+ pr_warn("Unable to find PCI bus 1?\n");
goto out_unlock;
}

@@ -436,12 +436,12 @@ static void asus_rfkill_hotplug(struct asus_wmi *asus)
absent = (l == 0xffffffff);

if (blocked != absent) {
- pr_warning("BIOS says wireless lan is %s, "
- "but the pci device is %s\n",
- blocked ? "blocked" : "unblocked",
- absent ? "absent" : "present");
- pr_warning("skipped wireless hotplug as probably "
- "inappropriate for this model\n");
+ pr_warn("BIOS says wireless lan is %s, "
+ "but the pci device is %s\n",
+ blocked ? "blocked" : "unblocked",
+ absent ? "absent" : "present");
+ pr_warn("skipped wireless hotplug as probably "
+ "inappropriate for this model\n");
goto out_unlock;
}

@@ -500,7 +500,7 @@ static int asus_register_rfkill_notifier(struct asus_wmi *asus, char *node)
ACPI_SYSTEM_NOTIFY,
asus_rfkill_notify, asus);
if (ACPI_FAILURE(status))
- pr_warning("Failed to register notify on %s\n", node);
+ pr_warn("Failed to register notify on %s\n", node);
} else
return -ENODEV;

@@ -1583,12 +1583,12 @@ static int asus_wmi_probe(struct platform_device *pdev)
int ret;

if (!wmi_has_guid(ASUS_WMI_MGMT_GUID)) {
- pr_warning("Management GUID not found\n");
+ pr_warn("Management GUID not found\n");
return -ENODEV;
}

if (wdrv->event_guid && !wmi_has_guid(wdrv->event_guid)) {
- pr_warning("Event GUID not found\n");
+ pr_warn("Event GUID not found\n");
return -ENODEV;
}

diff --git a/drivers/platform/x86/asus_acpi.c b/drivers/platform/x86/asus_acpi.c
index f503607..d9312b3 100644
--- a/drivers/platform/x86/asus_acpi.c
+++ b/drivers/platform/x86/asus_acpi.c
@@ -30,6 +30,8 @@
*
*/

+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/slab.h>
@@ -581,8 +583,7 @@ static int read_led(const char *ledname, int ledmask)
if (read_acpi_int(NULL, ledname, &led_status))
return led_status;
else
- printk(KERN_WARNING "Asus ACPI: Error reading LED "
- "status\n");
+ pr_warn("Error reading LED status\n");
}
return (hotk->status & ledmask) ? 1 : 0;
}
@@ -621,8 +622,7 @@ write_led(const char __user *buffer, unsigned long count,
led_out = !led_out;

if (!write_acpi_int(hotk->handle, ledname, led_out, NULL))
- printk(KERN_WARNING "Asus ACPI: LED (%s) write failed\n",
- ledname);
+ pr_warn("LED (%s) write failed\n", ledname);

return rv;
}
@@ -679,8 +679,7 @@ static ssize_t ledd_proc_write(struct file *file, const char __user *buffer,
if (rv > 0) {
if (!write_acpi_int
(hotk->handle, hotk->methods->mt_ledd, value, NULL))
- printk(KERN_WARNING
- "Asus ACPI: LED display write failed\n");
+ pr_warn("LED display write failed\n");
else
hotk->ledd_status = (u32) value;
}
@@ -838,8 +837,7 @@ static int get_lcd_state(void)
} else {
/* We don't have to check anything if we are here */
if (!read_acpi_int(NULL, hotk->methods->lcd_status, &lcd))
- printk(KERN_WARNING
- "Asus ACPI: Error reading LCD status\n");
+ pr_warn("Error reading LCD status\n");

if (hotk->model == L2D)
lcd = ~lcd;
@@ -871,7 +869,7 @@ static int set_lcd_state(int value)
the exact behaviour is simulated here */
}
if (ACPI_FAILURE(status))
- printk(KERN_WARNING "Asus ACPI: Error switching LCD\n");
+ pr_warn("Error switching LCD\n");
}
return 0;

@@ -915,13 +913,11 @@ static int read_brightness(struct backlight_device *bd)
if (hotk->methods->brightness_get) { /* SPLV/GPLV laptop */
if (!read_acpi_int(hotk->handle, hotk->methods->brightness_get,
&value))
- printk(KERN_WARNING
- "Asus ACPI: Error reading brightness\n");
+ pr_warn("Error reading brightness\n");
} else if (hotk->methods->brightness_status) { /* For D1 for example */
if (!read_acpi_int(NULL, hotk->methods->brightness_status,
&value))
- printk(KERN_WARNING
- "Asus ACPI: Error reading brightness\n");
+ pr_warn("Error reading brightness\n");
} else /* No GPLV method */
value = hotk->brightness;
return value;
@@ -939,8 +935,7 @@ static int set_brightness(int value)
if (hotk->methods->brightness_set) {
if (!write_acpi_int(hotk->handle, hotk->methods->brightness_set,
value, NULL)) {
- printk(KERN_WARNING
- "Asus ACPI: Error changing brightness\n");
+ pr_warn("Error changing brightness\n");
ret = -EIO;
}
goto out;
@@ -955,8 +950,7 @@ static int set_brightness(int value)
NULL, NULL);
(value > 0) ? value-- : value++;
if (ACPI_FAILURE(status)) {
- printk(KERN_WARNING
- "Asus ACPI: Error changing brightness\n");
+ pr_warn("Error changing brightness\n");
ret = -EIO;
}
}
@@ -1008,7 +1002,7 @@ static void set_display(int value)
/* no sanity check needed for now */
if (!write_acpi_int(hotk->handle, hotk->methods->display_set,
value, NULL))
- printk(KERN_WARNING "Asus ACPI: Error setting display\n");
+ pr_warn("Error setting display\n");
return;
}

@@ -1021,8 +1015,7 @@ static int disp_proc_show(struct seq_file *m, void *v)
int value = 0;

if (!read_acpi_int(hotk->handle, hotk->methods->display_get, &value))
- printk(KERN_WARNING
- "Asus ACPI: Error reading display status\n");
+ pr_warn("Error reading display status\n");
value &= 0x07; /* needed for some models, shouldn't hurt others */
seq_printf(m, "%d\n", value);
return 0;
@@ -1068,7 +1061,7 @@ asus_proc_add(char *name, const struct file_operations *proc_fops, mode_t mode,
proc = proc_create_data(name, mode, acpi_device_dir(device),
proc_fops, acpi_driver_data(device));
if (!proc) {
- printk(KERN_WARNING " Unable to create %s fs entry\n", name);
+ pr_warn(" Unable to create %s fs entry\n", name);
return -1;
}
proc->uid = asus_uid;
@@ -1085,8 +1078,8 @@ static int asus_hotk_add_fs(struct acpi_device *device)
mode = S_IFREG | S_IRUGO | S_IWUSR | S_IWGRP;
} else {
mode = S_IFREG | S_IRUSR | S_IRGRP | S_IWUSR | S_IWGRP;
- printk(KERN_WARNING " asus_uid and asus_gid parameters are "
- "deprecated, use chown and chmod instead!\n");
+ pr_warn(" asus_uid and asus_gid parameters are "
+ "deprecated, use chown and chmod instead!\n");
}

acpi_device_dir(device) = asus_proc_dir;
@@ -1099,8 +1092,7 @@ static int asus_hotk_add_fs(struct acpi_device *device)
proc->uid = asus_uid;
proc->gid = asus_gid;
} else {
- printk(KERN_WARNING " Unable to create " PROC_INFO
- " fs entry\n");
+ pr_warn(" Unable to create " PROC_INFO " fs entry\n");
}

if (hotk->methods->mt_wled) {
@@ -1283,20 +1275,19 @@ static int asus_hotk_get_info(void)
*/
status = acpi_get_table(ACPI_SIG_DSDT, 1, &asus_info);
if (ACPI_FAILURE(status))
- printk(KERN_WARNING " Couldn't get the DSDT table header\n");
+ pr_warn(" Couldn't get the DSDT table header\n");

/* We have to write 0 on init this far for all ASUS models */
if (!write_acpi_int(hotk->handle, "INIT", 0, &buffer)) {
- printk(KERN_ERR " Hotkey initialization failed\n");
+ pr_err(" Hotkey initialization failed\n");
return -ENODEV;
}

/* This needs to be called for some laptops to init properly */
if (!read_acpi_int(hotk->handle, "BSTS", &bsts_result))
- printk(KERN_WARNING " Error calling BSTS\n");
+ pr_warn(" Error calling BSTS\n");
else if (bsts_result)
- printk(KERN_NOTICE " BSTS called, 0x%02x returned\n",
- bsts_result);
+ pr_notice(" BSTS called, 0x%02x returned\n", bsts_result);

/*
* Try to match the object returned by INIT to the specific model.
@@ -1324,23 +1315,21 @@ static int asus_hotk_get_info(void)
if (asus_info &&
strncmp(asus_info->oem_table_id, "ODEM", 4) == 0) {
hotk->model = P30;
- printk(KERN_NOTICE
- " Samsung P30 detected, supported\n");
+ pr_notice(" Samsung P30 detected, supported\n");
hotk->methods = &model_conf[hotk->model];
kfree(model);
return 0;
} else {
hotk->model = M2E;
- printk(KERN_NOTICE " unsupported model %s, trying "
- "default values\n", string);
- printk(KERN_NOTICE
- " send /proc/acpi/dsdt to the developers\n");
+ pr_notice(" unsupported model %s, trying default values\n",
+ string);
+ pr_notice(" send /proc/acpi/dsdt to the developers\n");
kfree(model);
return -ENODEV;
}
}
hotk->methods = &model_conf[hotk->model];
- printk(KERN_NOTICE " %s model detected, supported\n", string);
+ pr_notice(" %s model detected, supported\n", string);

/* Sort of per-model blacklist */
if (strncmp(string, "L2B", 3) == 0)
@@ -1385,7 +1374,7 @@ static int asus_hotk_check(void)
if (hotk->device->status.present) {
result = asus_hotk_get_info();
} else {
- printk(KERN_ERR " Hotkey device not present, aborting\n");
+ pr_err(" Hotkey device not present, aborting\n");
return -EINVAL;
}

@@ -1399,8 +1388,7 @@ static int asus_hotk_add(struct acpi_device *device)
acpi_status status = AE_OK;
int result;

- printk(KERN_NOTICE "Asus Laptop ACPI Extras version %s\n",
- ASUS_ACPI_VERSION);
+ pr_notice("Asus Laptop ACPI Extras version %s\n", ASUS_ACPI_VERSION);

hotk = kzalloc(sizeof(struct asus_hotk), GFP_KERNEL);
if (!hotk)
@@ -1428,15 +1416,14 @@ static int asus_hotk_add(struct acpi_device *device)
acpi_evaluate_object(NULL, hotk->methods->brightness_down,
NULL, NULL);
if (ACPI_FAILURE(status))
- printk(KERN_WARNING " Error changing brightness\n");
+ pr_warn(" Error changing brightness\n");
else {
status =
acpi_evaluate_object(NULL,
hotk->methods->brightness_up,
NULL, NULL);
if (ACPI_FAILURE(status))
- printk(KERN_WARNING " Strange, error changing"
- " brightness\n");
+ pr_warn(" Strange, error changing brightness\n");
}
}

@@ -1488,7 +1475,7 @@ static int __init asus_acpi_init(void)

asus_proc_dir = proc_mkdir(PROC_ASUS, acpi_root_dir);
if (!asus_proc_dir) {
- printk(KERN_ERR "Asus ACPI: Unable to create /proc entry\n");
+ pr_err("Unable to create /proc entry\n");
acpi_bus_unregister_driver(&asus_hotk_driver);
return -ENODEV;
}
@@ -1513,7 +1500,7 @@ static int __init asus_acpi_init(void)
&asus_backlight_data,
&props);
if (IS_ERR(asus_backlight_device)) {
- printk(KERN_ERR "Could not register asus backlight device\n");
+ pr_err("Could not register asus backlight device\n");
asus_backlight_device = NULL;
asus_acpi_exit();
return -ENODEV;
--
1.7.4.2.g597a6.dirty

2011-03-29 22:27:18

by Joe Perches

[permalink] [raw]
Subject: [PATCH 02/23] ibm_rtl: Remove warnings from casts of pointer to int

Just print them as %p.

Signed-off-by: Joe Perches <[email protected]>
---
drivers/platform/x86/ibm_rtl.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/x86/ibm_rtl.c b/drivers/platform/x86/ibm_rtl.c
index 94a114a..f0b0683 100644
--- a/drivers/platform/x86/ibm_rtl.c
+++ b/drivers/platform/x86/ibm_rtl.c
@@ -275,7 +275,7 @@ static int __init ibm_rtl_init(void) {
if ((readq(&tmp->signature) & RTL_MASK) == RTL_SIGNATURE) {
phys_addr_t addr;
unsigned int plen;
- RTL_DEBUG("found RTL_SIGNATURE at %#llx\n", (u64)tmp);
+ RTL_DEBUG("found RTL_SIGNATURE at %p\n", tmp);
rtl_table = tmp;
/* The address, value, width and offset are platform
* dependent and found in the ibm_rtl_table */
@@ -287,7 +287,7 @@ static int __init ibm_rtl_init(void) {
RTL_DEBUG("addr = %#llx\n", (unsigned long long)addr);
plen = rtl_cmd_width/sizeof(char);
rtl_cmd_addr = rtl_port_map(addr, plen);
- RTL_DEBUG("rtl_cmd_addr = %#llx\n", (u64)rtl_cmd_addr);
+ RTL_DEBUG("rtl_cmd_addr = %p\n", rtl_cmd_addr);
if (!rtl_cmd_addr) {
ret = -ENOMEM;
break;
--
1.7.4.2.g597a6.dirty

2011-03-29 22:47:32

by Jonathan Woithe

[permalink] [raw]
Subject: Re: [PATCH 08/23] fujitsu-laptop: Convert printks to pr_<level>

> Added pr_fmt, converted printks and removed hard coded prefixes.
>
> Signed-off-by: Joe Perches <[email protected]>

Acked-by: Jonathan Woithe <[email protected]>

But see comment below.

OOI, what does pr_*() give us over printk()? I presume it makes it easier
to selectively remove certain printk levels from the kernel image in the
name of size reduction.

> diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c
> index 493054c..6b26666 100644
> --- a/drivers/platform/x86/fujitsu-laptop.c
> +++ b/drivers/platform/x86/fujitsu-laptop.c
> :
> @@ -907,8 +907,8 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device)
> if (result == 0) {
> fujitsu_hotkey->logolamp_registered = 1;
> } else {
> - printk(KERN_ERR "fujitsu-laptop: Could not register "
> - "LED handler for logo lamp, error %i\n", result);
> + pr_err("Could not register LED handler for logo lamp, error %i\n",
> + result);
> }
> }
>
> @@ -919,8 +919,8 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device)
> if (result == 0) {
> fujitsu_hotkey->kblamps_registered = 1;
> } else {
> - printk(KERN_ERR "fujitsu-laptop: Could not register "
> - "LED handler for keyboard lamps, error %i\n", result);
> + pr_err("Could not register LED handler for keyboard lamps, error %i\n",
> + result);
> }
> }
> #endif

Some people *may* insist that these long (>80 character) pr_err() lines be
split so they remain <80 in length. This was the reason why the original
printk() call was split like it was.

Regards
jonathan

2011-03-29 22:50:17

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH 08/23] fujitsu-laptop: Convert printks to pr_<level>

On Wed, 2011-03-30 at 08:12 +0930, Jonathan Woithe wrote:
> what does pr_*() give us over printk()?

Consistency in use of prefix.

> I presume it makes it easier to selectively remove certain
> printk levels from the kernel image in the
> name of size reduction.

That's the goal, but there's no support in the
standard kernel for that yet.

It should also in the future make the prefix a
singleton and remove it from the format string
making the image text a bit smaller.

> Some people *may* insist that these long (>80 character) pr_err() lines be
> split so they remain <80 in length. This was the reason why the original
> printk() call was split like it was.

I don't.
It makes grepping source for strings easier.

cheers, Joe

Subject: Re: [PATCH 20/23] topstar-laptop: Convert remaining printk to pr_info

On Tue, Mar 29, 2011 at 03:21:51PM -0700, Joe Perches wrote:
> To be similar to all other uses.
>
> Signed-off-by: Joe Perches <[email protected]>
> ---
> drivers/platform/x86/topstar-laptop.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/platform/x86/topstar-laptop.c b/drivers/platform/x86/topstar-laptop.c
> index 1d07d6d..4c20447 100644
> --- a/drivers/platform/x86/topstar-laptop.c
> +++ b/drivers/platform/x86/topstar-laptop.c
> @@ -194,7 +194,7 @@ static int __init topstar_laptop_init(void)
> if (ret < 0)
> return ret;
>
> - printk(KERN_INFO "Topstar Laptop ACPI extras driver loaded\n");
> + pr_info("ACPI extras driver loaded\n");
>
> return 0;
> }
> --
> 1.7.4.2.g597a6.dirty
>

Acked-by: Herton Ronaldo Krzesinski <[email protected]>

--
[]'s
Herton

2011-03-30 01:54:43

by Lucas De Marchi

[permalink] [raw]
Subject: Re: [PATCH 09/23] hdaps: Convert printks to pr_<level>

On Tue, Mar 29, 2011 at 19:21, Joe Perches <[email protected]> wrote:
> Added pr_fmt, converted printks and removed
> hard coded prefixes.
>
> Signed-off-by: Joe Perches <[email protected]>
> ---
> ?drivers/platform/x86/hdaps.c | ? 19 ++++++++++---------
> ?1 files changed, 10 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/platform/x86/hdaps.c b/drivers/platform/x86/hdaps.c
> index 067bf36..5a34973 100644
> --- a/drivers/platform/x86/hdaps.c
> +++ b/drivers/platform/x86/hdaps.c
> @@ -26,6 +26,8 @@
> ?* 51 Franklin Street, Fifth Floor, Boston, MA ?02110-1301, USA
> ?*/
>
> +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> +
> ?#include <linux/delay.h>
> ?#include <linux/platform_device.h>
> ?#include <linux/input-polldev.h>
> @@ -238,7 +240,7 @@ static int hdaps_device_init(void)
> ? ? ? ? ? ? ? ? ? ? __check_latch(0x1611, 0x01))
> ? ? ? ? ? ? ? ?goto out;
>
> - ? ? ? printk(KERN_DEBUG "hdaps: initial latch check good (0x%02x).\n",
> + ? ? ? printk(KERN_DEBUG "hdaps: initial latch check good (0x%02x)\n",

Shouldn't this be pr_debug() or pr_devel() ?



Lucas De Marchi

2011-03-30 02:00:34

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH 09/23] hdaps: Convert printks to pr_<level>

On Tue, 2011-03-29 at 22:54 -0300, Lucas De Marchi wrote:
> > diff --git a/drivers/platform/x86/hdaps.c b/drivers/platform/x86/hdaps.c
> > @@ -238,7 +240,7 @@ static int hdaps_device_init(void)
> > __check_latch(0x1611, 0x01))
> > goto out;
> >
> > - printk(KERN_DEBUG "hdaps: initial latch check good (0x%02x).\n",
> > + printk(KERN_DEBUG "hdaps: initial latch check good (0x%02x)\n",
>
> Shouldn't this be pr_debug() or pr_devel() ?

Hi Lucas.

Using pr_debug changes behavior unless
CONFIG_DYNAMIC_DEBUG or #define DEBUG is used.

I prefer not to change those unless there's
agreement.

cheers, Joe

2011-03-30 14:20:26

by Anisse Astier

[permalink] [raw]
Subject: Re: [PATCH 16/23] msi-wmi: Use pr_fmt and pr_<level>

Hi Joe,

On Tue, 29 Mar 2011 15:21:47 -0700, Joe Perches <[email protected]> wrote :

> Added pr_fmt.
> Removed now unused #define DRV_PFX
> Convert dprintk to pr_debug.
> Convert printks to pr_<level>.
>
> Signed-off-by: Joe Perches <[email protected]>

Acked-by: Anisse Astier <[email protected]>

I've been wanting to do that since I replaced original dprintk
implementation with pr_debug. I just didn't know you could use the
pr_fmt() macro to manipulate prefixes.

Regards,

Anisse

> ---
> drivers/platform/x86/msi-wmi.c | 45 +++++++++++++++++----------------------
> 1 files changed, 20 insertions(+), 25 deletions(-)
>

2011-03-30 14:30:57

by Corentin Chary

[permalink] [raw]
Subject: Re: [PATCH 00/23] drivers/platform/x86: Remove warnings and use pr_<level>

On Tue, Mar 29, 2011 at 10:21 PM, Joe Perches <[email protected]> wrote:
> Removed a couple of compilation warnings.
> Use pr_<level> consistently.

Did you do that using coccinelle or by hand ?
If you used coccinelle, is the .cocci file available ?
If not, you should try it :).

> Joe Perches (23):
>  asus-wmi: Remove __init from asus_wmi_platform_init
>  ibm_rtl: Remove warnings from casts of pointer to int
>  acer-wmi: pr_<level> cleanups
>  asus: Add pr_fmt and convert printks to pr_<level>
>  compal-laptop: Convert printks to pr_<level>
>  dell: Convert printks to pr_<level>
>  eeepc: Use pr_warn
>  fujitsu-laptop: Convert printks to pr_<level>
>  hdaps: Convert printks to pr_<level>
>  hp-wmi: Convert printks to pr_<level>
>  ibm_rtl: Use pr_fmt and pr_<level>
>  ideapad-laptop: Add pr_fmt
>  intel_menlow: Add pr_fmt and use pr_<level>
>  intel_pmic_gpio: Convert printks to pr_<level>
>  msi-laptop: pr_<level> neatening
>  msi-wmi: Use pr_fmt and pr_<level>
>  sony-laptop: Add and use #define pr_fmt
>  tc1100-wmi: Add pr_fmt, use pr_<level>
>  thinkpad_acpi: Convert printks to pr_<level>
>  topstar-laptop: Convert remaining printk to pr_info
>  toshiba: Convert printks to pr_<level>
>  wmi: Removed trailing whitespace from logging message.
>  xo15-ebook: Use pr_<level>
>
>  drivers/platform/x86/acer-wmi.c          |   32 +-
>  drivers/platform/x86/asus-laptop.c       |   34 +-
>  drivers/platform/x86/asus-wmi.c          |   22 +-
>  drivers/platform/x86/asus_acpi.c         |   77 ++---
>  drivers/platform/x86/compal-laptop.c     |   22 +-
>  drivers/platform/x86/dell-laptop.c       |   12 +-
>  drivers/platform/x86/dell-wmi-aio.c      |    3 +-
>  drivers/platform/x86/dell-wmi.c          |   17 +-
>  drivers/platform/x86/eeepc-laptop.c      |   20 +-
>  drivers/platform/x86/eeepc-wmi.c         |   14 +-
>  drivers/platform/x86/fujitsu-laptop.c    |   39 ++--
>  drivers/platform/x86/hdaps.c             |   19 +-
>  drivers/platform/x86/hp-wmi.c            |   43 +--
>  drivers/platform/x86/ibm_rtl.c           |   23 +-
>  drivers/platform/x86/ideapad-laptop.c    |    2 +
>  drivers/platform/x86/intel_menlow.c      |    5 +-
>  drivers/platform/x86/intel_pmic_gpio.c   |   14 +-
>  drivers/platform/x86/msi-laptop.c        |    9 +-
>  drivers/platform/x86/msi-wmi.c           |   45 ++--
>  drivers/platform/x86/sony-laptop.c       |  104 +++----
>  drivers/platform/x86/tc1100-wmi.c        |    7 +-
>  drivers/platform/x86/thinkpad_acpi.c     |  471 ++++++++++++------------------
>  drivers/platform/x86/topstar-laptop.c    |    2 +-
>  drivers/platform/x86/toshiba_acpi.c      |   59 ++--
>  drivers/platform/x86/toshiba_bluetooth.c |   11 +-
>  drivers/platform/x86/wmi.c               |   10 +-
>  drivers/platform/x86/xo15-ebook.c        |    5 +-
>  27 files changed, 495 insertions(+), 626 deletions(-)
>
> --
> 1.7.4.2.g597a6.dirty
>
> --
> To unsubscribe from this list: send the line "unsubscribe platform-driver-x86" in
> the body of a message to [email protected]
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>



--
Corentin Chary
http://xf.iksaif.net

2011-03-30 15:02:47

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH 00/23] drivers/platform/x86: Remove warnings and use pr_<level>

On Wed, 2011-03-30 at 14:30 +0000, Corentin Chary wrote:
> On Tue, Mar 29, 2011 at 10:21 PM, Joe Perches <[email protected]> wrote:
> > Removed a couple of compilation warnings.
> > Use pr_<level> consistently.
> Did you do that using coccinelle or by hand ?
> If you used coccinelle, is the .cocci file available ?
> If not, you should try it :).

Coccinelle is a fine tool, not appropriate for everything.

I used a newer version of a different script, posted a couple of times.
http://lwn.net/Articles/380161/

$ cvt_style.pl -o --convert=printk_to_pr_level drivers/platform/x86/*.c

2011-03-31 06:41:39

by Joey Lee

[permalink] [raw]
Subject: Re: [PATCH 15/23] msi-laptop: pr_<level> neatening

於 二,2011-03-29 於 15:21 -0700,Joe Perches 提到:
> Just making it a bit more like other logging message uses.
>
> Signed-off-by: Joe Perches <[email protected]>
> ---
> drivers/platform/x86/msi-laptop.c | 9 ++++-----
> 1 files changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/platform/x86/msi-laptop.c b/drivers/platform/x86/msi-laptop.c
> index 23fb2af..f89c0b6 100644
> --- a/drivers/platform/x86/msi-laptop.c
> +++ b/drivers/platform/x86/msi-laptop.c
> @@ -447,7 +447,7 @@ static struct platform_device *msipf_device;
>
> static int dmi_check_cb(const struct dmi_system_id *id)
> {
> - pr_info("Identified laptop model '%s'.\n", id->ident);
> + pr_info("Identified laptop model '%s'\n", id->ident);
> return 1;
> }
>
> @@ -875,8 +875,7 @@ static int __init msi_init(void)
> /* Register backlight stuff */
>
> if (acpi_video_backlight_support()) {
> - pr_info("Brightness ignored, must be controlled "
> - "by ACPI video driver\n");
> + pr_info("Brightness ignored, must be controlled by ACPI video driver\n");
> } else {
> struct backlight_properties props;
> memset(&props, 0, sizeof(struct backlight_properties));
> @@ -930,7 +929,7 @@ static int __init msi_init(void)
> if (auto_brightness != 2)
> set_auto_brightness(auto_brightness);
>
> - pr_info("driver "MSI_DRIVER_VERSION" successfully loaded.\n");
> + pr_info("driver " MSI_DRIVER_VERSION " successfully loaded\n");
>
> return 0;
>
> @@ -978,7 +977,7 @@ static void __exit msi_cleanup(void)
> if (auto_brightness != 2)
> set_auto_brightness(1);
>
> - pr_info("driver unloaded.\n");
> + pr_info("driver unloaded\n");
> }
>
> module_init(msi_init);

Thank's, it's ok to me.

Acked-by: Lee, Chun-Yi <[email protected]>

2011-03-31 06:41:47

by Joey Lee

[permalink] [raw]
Subject: Re: [PATCH 03/23] acer-wmi: pr_<level> cleanups

於 二,2011-03-29 於 15:21 -0700,Joe Perches 提到:
> Convert pr_warning to pr_warn.
> Add some missing newlines to pr_<level> uses.
>
> Signed-off-by: Joe Perches <[email protected]>
> ---
> drivers/platform/x86/acer-wmi.c | 32 ++++++++++++++++----------------
> 1 files changed, 16 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
> index 5ea6c34..0b23b75 100644
> --- a/drivers/platform/x86/acer-wmi.c
> +++ b/drivers/platform/x86/acer-wmi.c
> @@ -1081,7 +1081,7 @@ static acpi_status wmid3_get_device_status(u32 *value, u16 device)
> return AE_ERROR;
> }
> if (obj->buffer.length != 8) {
> - pr_warning("Unknown buffer length %d\n", obj->buffer.length);
> + pr_warn("Unknown buffer length %d\n", obj->buffer.length);
> kfree(obj);
> return AE_ERROR;
> }
> @@ -1090,8 +1090,8 @@ static acpi_status wmid3_get_device_status(u32 *value, u16 device)
> kfree(obj);
>
> if (return_value.error_code || return_value.ec_return_value)
> - pr_warning("Get Device Status failed: "
> - "0x%x - 0x%x\n", return_value.error_code,
> + pr_warn("Get Device Status failed: 0x%x - 0x%x\n",
> + return_value.error_code,
> return_value.ec_return_value);
> else
> *value = !!(return_value.devices & device);
> @@ -1317,7 +1317,7 @@ static void acer_wmi_notify(u32 value, void *context)
>
> status = wmi_get_event_data(value, &response);
> if (status != AE_OK) {
> - pr_warning("bad event status 0x%x\n", status);
> + pr_warn("bad event status 0x%x\n", status);
> return;
> }
>
> @@ -1326,12 +1326,12 @@ static void acer_wmi_notify(u32 value, void *context)
> if (!obj)
> return;
> if (obj->type != ACPI_TYPE_BUFFER) {
> - pr_warning("Unknown response received %d\n", obj->type);
> + pr_warn("Unknown response received %d\n", obj->type);
> kfree(obj);
> return;
> }
> if (obj->buffer.length != 8) {
> - pr_warning("Unknown buffer length %d\n", obj->buffer.length);
> + pr_warn("Unknown buffer length %d\n", obj->buffer.length);
> kfree(obj);
> return;
> }
> @@ -1356,11 +1356,11 @@ static void acer_wmi_notify(u32 value, void *context)
> }
> if (!sparse_keymap_report_event(acer_wmi_input_dev,
> return_value.key_num, 1, true))
> - pr_warning("Unknown key number - 0x%x\n",
> + pr_warn("Unknown key number - 0x%x\n",
> return_value.key_num);
> break;
> default:
> - pr_warning("Unknown function number - %d - %d\n",
> + pr_warn("Unknown function number - %d - %d\n",
> return_value.function, return_value.key_num);
> break;
> }
> @@ -1389,7 +1389,7 @@ wmid3_set_lm_mode(struct lm_input_params *params,
> return AE_ERROR;
> }
> if (obj->buffer.length != 4) {
> - pr_warning("Unknown buffer length %d\n", obj->buffer.length);
> + pr_warn("Unknown buffer length %d\n", obj->buffer.length);
> kfree(obj);
> return AE_ERROR;
> }
> @@ -1414,11 +1414,11 @@ static int acer_wmi_enable_ec_raw(void)
> status = wmid3_set_lm_mode(&params, &return_value);
>
> if (return_value.error_code || return_value.ec_return_value)
> - pr_warning("Enabling EC raw mode failed: "
> - "0x%x - 0x%x\n", return_value.error_code,
> - return_value.ec_return_value);
> + pr_warn("Enabling EC raw mode failed: 0x%x - 0x%x\n",
> + return_value.error_code,
> + return_value.ec_return_value);
> else
> - pr_info("Enabled EC raw mode");
> + pr_info("Enabled EC raw mode\n");
>
> return status;
> }
> @@ -1437,9 +1437,9 @@ static int acer_wmi_enable_lm(void)
> status = wmid3_set_lm_mode(&params, &return_value);
>
> if (return_value.error_code || return_value.ec_return_value)
> - pr_warning("Enabling Launch Manager failed: "
> - "0x%x - 0x%x\n", return_value.error_code,
> - return_value.ec_return_value);
> + pr_warn("Enabling Launch Manager failed: 0x%x - 0x%x\n",
> + return_value.error_code,
> + return_value.ec_return_value);
>
> return status;
> }

OK to me.

Acked-by: Lee, Chun-Yi <[email protected]>

2011-03-31 07:17:52

by Corentin Chary

[permalink] [raw]
Subject: Re: [PATCH 01/23] asus-wmi: Remove __init from asus_wmi_platform_init

On Wed, Mar 30, 2011 at 12:21 AM, Joe Perches <[email protected]> wrote:
> It's used by a non-init function.
>
> Signed-off-by: Joe Perches <[email protected]>

Acked-by: Corentin Chary <[email protected]>

> ---
>  drivers/platform/x86/asus-wmi.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
> index efc776c..c382af6 100644
> --- a/drivers/platform/x86/asus-wmi.c
> +++ b/drivers/platform/x86/asus-wmi.c
> @@ -1223,7 +1223,7 @@ static int asus_wmi_sysfs_init(struct platform_device *device)
>  /*
>  * Platform device
>  */
> -static int __init asus_wmi_platform_init(struct asus_wmi *asus)
> +static int asus_wmi_platform_init(struct asus_wmi *asus)
>  {
>        int rv;
>
> --
> 1.7.4.2.g597a6.dirty
>
>



--
Corentin Chary
http://xf.iksaif.net

2011-03-31 07:18:31

by Corentin Chary

[permalink] [raw]
Subject: Re: [PATCH 04/23] asus: Add pr_fmt and convert printks to pr_<level>

On Wed, Mar 30, 2011 at 12:21 AM, Joe Perches <[email protected]> wrote:
> Add pr_fmt, prefixes each log message.
> Convert printks to pr_<level>.
> Convert pr_warning to pr_warn.
>
> Signed-off-by: Joe Perches <[email protected]>

Acked-by: Corentin Chary <[email protected]>

> ---
>  drivers/platform/x86/asus-laptop.c |   34 ++++++++--------
>  drivers/platform/x86/asus-wmi.c    |   20 +++++-----
>  drivers/platform/x86/asus_acpi.c   |   77 +++++++++++++++---------------------
>  3 files changed, 59 insertions(+), 72 deletions(-)
>
> diff --git a/drivers/platform/x86/asus-laptop.c b/drivers/platform/x86/asus-laptop.c
> index c53b3ff..d65df92 100644
> --- a/drivers/platform/x86/asus-laptop.c
> +++ b/drivers/platform/x86/asus-laptop.c
> @@ -318,7 +318,7 @@ static int acpi_check_handle(acpi_handle handle, const char *method,
>
>        if (status != AE_OK) {
>                if (ret)
> -                       pr_warning("Error finding %s\n", method);
> +                       pr_warn("Error finding %s\n", method);
>                return -ENODEV;
>        }
>        return 0;
> @@ -383,7 +383,7 @@ static int asus_kled_lvl(struct asus_laptop *asus)
>        rv = acpi_evaluate_integer(asus->handle, METHOD_KBD_LIGHT_GET,
>                                   &params, &kblv);
>        if (ACPI_FAILURE(rv)) {
> -               pr_warning("Error reading kled level\n");
> +               pr_warn("Error reading kled level\n");
>                return -ENODEV;
>        }
>        return kblv;
> @@ -397,7 +397,7 @@ static int asus_kled_set(struct asus_laptop *asus, int kblv)
>                kblv = 0;
>
>        if (write_acpi_int(asus->handle, METHOD_KBD_LIGHT_SET, kblv)) {
> -               pr_warning("Keyboard LED display write failed\n");
> +               pr_warn("Keyboard LED display write failed\n");
>                return -EINVAL;
>        }
>        return 0;
> @@ -531,7 +531,7 @@ static int asus_read_brightness(struct backlight_device *bd)
>        rv = acpi_evaluate_integer(asus->handle, METHOD_BRIGHTNESS_GET,
>                                   NULL, &value);
>        if (ACPI_FAILURE(rv))
> -               pr_warning("Error reading brightness\n");
> +               pr_warn("Error reading brightness\n");
>
>        return value;
>  }
> @@ -541,7 +541,7 @@ static int asus_set_brightness(struct backlight_device *bd, int value)
>        struct asus_laptop *asus = bl_get_data(bd);
>
>        if (write_acpi_int(asus->handle, METHOD_BRIGHTNESS_SET, value)) {
> -               pr_warning("Error changing brightness\n");
> +               pr_warn("Error changing brightness\n");
>                return -EIO;
>        }
>        return 0;
> @@ -730,7 +730,7 @@ static ssize_t store_ledd(struct device *dev, struct device_attribute *attr,
>        rv = parse_arg(buf, count, &value);
>        if (rv > 0) {
>                if (write_acpi_int(asus->handle, METHOD_LEDD, value)) {
> -                       pr_warning("LED display write failed\n");
> +                       pr_warn("LED display write failed\n");
>                        return -ENODEV;
>                }
>                asus->ledd_status = (u32) value;
> @@ -752,7 +752,7 @@ static int asus_wireless_status(struct asus_laptop *asus, int mask)
>        rv = acpi_evaluate_integer(asus->handle, METHOD_WL_STATUS,
>                                   NULL, &status);
>        if (ACPI_FAILURE(rv)) {
> -               pr_warning("Error reading Wireless status\n");
> +               pr_warn("Error reading Wireless status\n");
>                return -EINVAL;
>        }
>        return !!(status & mask);
> @@ -764,7 +764,7 @@ static int asus_wireless_status(struct asus_laptop *asus, int mask)
>  static int asus_wlan_set(struct asus_laptop *asus, int status)
>  {
>        if (write_acpi_int(asus->handle, METHOD_WLAN, !!status)) {
> -               pr_warning("Error setting wlan status to %d", status);
> +               pr_warn("Error setting wlan status to %d\n", status);
>                return -EIO;
>        }
>        return 0;
> @@ -792,7 +792,7 @@ static ssize_t store_wlan(struct device *dev, struct device_attribute *attr,
>  static int asus_bluetooth_set(struct asus_laptop *asus, int status)
>  {
>        if (write_acpi_int(asus->handle, METHOD_BLUETOOTH, !!status)) {
> -               pr_warning("Error setting bluetooth status to %d", status);
> +               pr_warn("Error setting bluetooth status to %d\n", status);
>                return -EIO;
>        }
>        return 0;
> @@ -821,7 +821,7 @@ static ssize_t store_bluetooth(struct device *dev,
>  static int asus_wimax_set(struct asus_laptop *asus, int status)
>  {
>        if (write_acpi_int(asus->handle, METHOD_WIMAX, !!status)) {
> -               pr_warning("Error setting wimax status to %d", status);
> +               pr_warn("Error setting wimax status to %d\n", status);
>                return -EIO;
>        }
>        return 0;
> @@ -850,7 +850,7 @@ static ssize_t store_wimax(struct device *dev,
>  static int asus_wwan_set(struct asus_laptop *asus, int status)
>  {
>        if (write_acpi_int(asus->handle, METHOD_WWAN, !!status)) {
> -               pr_warning("Error setting wwan status to %d", status);
> +               pr_warn("Error setting wwan status to %d\n", status);
>                return -EIO;
>        }
>        return 0;
> @@ -880,7 +880,7 @@ static void asus_set_display(struct asus_laptop *asus, int value)
>  {
>        /* no sanity check needed for now */
>        if (write_acpi_int(asus->handle, METHOD_SWITCH_DISPLAY, value))
> -               pr_warning("Error setting display\n");
> +               pr_warn("Error setting display\n");
>        return;
>  }
>
> @@ -909,7 +909,7 @@ static ssize_t store_disp(struct device *dev, struct device_attribute *attr,
>  static void asus_als_switch(struct asus_laptop *asus, int value)
>  {
>        if (write_acpi_int(asus->handle, METHOD_ALS_CONTROL, value))
> -               pr_warning("Error setting light sensor switch\n");
> +               pr_warn("Error setting light sensor switch\n");
>        asus->light_switch = value;
>  }
>
> @@ -937,7 +937,7 @@ static ssize_t store_lssw(struct device *dev, struct device_attribute *attr,
>  static void asus_als_level(struct asus_laptop *asus, int value)
>  {
>        if (write_acpi_int(asus->handle, METHOD_ALS_LEVEL, value))
> -               pr_warning("Error setting light sensor level\n");
> +               pr_warn("Error setting light sensor level\n");
>        asus->light_level = value;
>  }
>
> @@ -976,7 +976,7 @@ static int asus_gps_status(struct asus_laptop *asus)
>        rv = acpi_evaluate_integer(asus->handle, METHOD_GPS_STATUS,
>                                   NULL, &status);
>        if (ACPI_FAILURE(rv)) {
> -               pr_warning("Error reading GPS status\n");
> +               pr_warn("Error reading GPS status\n");
>                return -ENODEV;
>        }
>        return !!status;
> @@ -1284,7 +1284,7 @@ static int asus_laptop_get_info(struct asus_laptop *asus)
>         */
>        status = acpi_get_table(ACPI_SIG_DSDT, 1, &asus->dsdt_info);
>        if (ACPI_FAILURE(status))
> -               pr_warning("Couldn't get the DSDT table header\n");
> +               pr_warn("Couldn't get the DSDT table header\n");
>
>        /* We have to write 0 on init this far for all ASUS models */
>        if (write_acpi_int_ret(asus->handle, "INIT", 0, &buffer)) {
> @@ -1296,7 +1296,7 @@ static int asus_laptop_get_info(struct asus_laptop *asus)
>        status =
>            acpi_evaluate_integer(asus->handle, "BSTS", NULL, &bsts_result);
>        if (ACPI_FAILURE(status))
> -               pr_warning("Error calling BSTS\n");
> +               pr_warn("Error calling BSTS\n");
>        else if (bsts_result)
>                pr_notice("BSTS called, 0x%02x returned\n",
>                       (uint) bsts_result);
> diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
> index c382af6..8edc882 100644
> --- a/drivers/platform/x86/asus-wmi.c
> +++ b/drivers/platform/x86/asus-wmi.c
> @@ -425,7 +425,7 @@ static void asus_rfkill_hotplug(struct asus_wmi *asus)
>        if (asus->hotplug_slot) {
>                bus = pci_find_bus(0, 1);
>                if (!bus) {
> -                       pr_warning("Unable to find PCI bus 1?\n");
> +                       pr_warn("Unable to find PCI bus 1?\n");
>                        goto out_unlock;
>                }
>
> @@ -436,12 +436,12 @@ static void asus_rfkill_hotplug(struct asus_wmi *asus)
>                absent = (l == 0xffffffff);
>
>                if (blocked != absent) {
> -                       pr_warning("BIOS says wireless lan is %s, "
> -                                  "but the pci device is %s\n",
> -                                  blocked ? "blocked" : "unblocked",
> -                                  absent ? "absent" : "present");
> -                       pr_warning("skipped wireless hotplug as probably "
> -                                  "inappropriate for this model\n");
> +                       pr_warn("BIOS says wireless lan is %s, "
> +                               "but the pci device is %s\n",
> +                               blocked ? "blocked" : "unblocked",
> +                               absent ? "absent" : "present");
> +                       pr_warn("skipped wireless hotplug as probably "
> +                               "inappropriate for this model\n");
>                        goto out_unlock;
>                }
>
> @@ -500,7 +500,7 @@ static int asus_register_rfkill_notifier(struct asus_wmi *asus, char *node)
>                                                     ACPI_SYSTEM_NOTIFY,
>                                                     asus_rfkill_notify, asus);
>                if (ACPI_FAILURE(status))
> -                       pr_warning("Failed to register notify on %s\n", node);
> +                       pr_warn("Failed to register notify on %s\n", node);
>        } else
>                return -ENODEV;
>
> @@ -1583,12 +1583,12 @@ static int asus_wmi_probe(struct platform_device *pdev)
>        int ret;
>
>        if (!wmi_has_guid(ASUS_WMI_MGMT_GUID)) {
> -               pr_warning("Management GUID not found\n");
> +               pr_warn("Management GUID not found\n");
>                return -ENODEV;
>        }
>
>        if (wdrv->event_guid && !wmi_has_guid(wdrv->event_guid)) {
> -               pr_warning("Event GUID not found\n");
> +               pr_warn("Event GUID not found\n");
>                return -ENODEV;
>        }
>
> diff --git a/drivers/platform/x86/asus_acpi.c b/drivers/platform/x86/asus_acpi.c
> index f503607..d9312b3 100644
> --- a/drivers/platform/x86/asus_acpi.c
> +++ b/drivers/platform/x86/asus_acpi.c
> @@ -30,6 +30,8 @@
>  *
>  */
>
> +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> +
>  #include <linux/kernel.h>
>  #include <linux/module.h>
>  #include <linux/slab.h>
> @@ -581,8 +583,7 @@ static int read_led(const char *ledname, int ledmask)
>                if (read_acpi_int(NULL, ledname, &led_status))
>                        return led_status;
>                else
> -                       printk(KERN_WARNING "Asus ACPI: Error reading LED "
> -                              "status\n");
> +                       pr_warn("Error reading LED status\n");
>        }
>        return (hotk->status & ledmask) ? 1 : 0;
>  }
> @@ -621,8 +622,7 @@ write_led(const char __user *buffer, unsigned long count,
>                led_out = !led_out;
>
>        if (!write_acpi_int(hotk->handle, ledname, led_out, NULL))
> -               printk(KERN_WARNING "Asus ACPI: LED (%s) write failed\n",
> -                      ledname);
> +               pr_warn("LED (%s) write failed\n", ledname);
>
>        return rv;
>  }
> @@ -679,8 +679,7 @@ static ssize_t ledd_proc_write(struct file *file, const char __user *buffer,
>        if (rv > 0) {
>                if (!write_acpi_int
>                    (hotk->handle, hotk->methods->mt_ledd, value, NULL))
> -                       printk(KERN_WARNING
> -                              "Asus ACPI: LED display write failed\n");
> +                       pr_warn("LED display write failed\n");
>                else
>                        hotk->ledd_status = (u32) value;
>        }
> @@ -838,8 +837,7 @@ static int get_lcd_state(void)
>        } else {
>                /* We don't have to check anything if we are here */
>                if (!read_acpi_int(NULL, hotk->methods->lcd_status, &lcd))
> -                       printk(KERN_WARNING
> -                              "Asus ACPI: Error reading LCD status\n");
> +                       pr_warn("Error reading LCD status\n");
>
>                if (hotk->model == L2D)
>                        lcd = ~lcd;
> @@ -871,7 +869,7 @@ static int set_lcd_state(int value)
>                           the exact behaviour is simulated here */
>                }
>                if (ACPI_FAILURE(status))
> -                       printk(KERN_WARNING "Asus ACPI: Error switching LCD\n");
> +                       pr_warn("Error switching LCD\n");
>        }
>        return 0;
>
> @@ -915,13 +913,11 @@ static int read_brightness(struct backlight_device *bd)
>        if (hotk->methods->brightness_get) {    /* SPLV/GPLV laptop */
>                if (!read_acpi_int(hotk->handle, hotk->methods->brightness_get,
>                                   &value))
> -                       printk(KERN_WARNING
> -                              "Asus ACPI: Error reading brightness\n");
> +                       pr_warn("Error reading brightness\n");
>        } else if (hotk->methods->brightness_status) {  /* For D1 for example */
>                if (!read_acpi_int(NULL, hotk->methods->brightness_status,
>                                   &value))
> -                       printk(KERN_WARNING
> -                              "Asus ACPI: Error reading brightness\n");
> +                       pr_warn("Error reading brightness\n");
>        } else                  /* No GPLV method */
>                value = hotk->brightness;
>        return value;
> @@ -939,8 +935,7 @@ static int set_brightness(int value)
>        if (hotk->methods->brightness_set) {
>                if (!write_acpi_int(hotk->handle, hotk->methods->brightness_set,
>                                    value, NULL)) {
> -                       printk(KERN_WARNING
> -                              "Asus ACPI: Error changing brightness\n");
> +                       pr_warn("Error changing brightness\n");
>                        ret = -EIO;
>                }
>                goto out;
> @@ -955,8 +950,7 @@ static int set_brightness(int value)
>                                              NULL, NULL);
>                (value > 0) ? value-- : value++;
>                if (ACPI_FAILURE(status)) {
> -                       printk(KERN_WARNING
> -                              "Asus ACPI: Error changing brightness\n");
> +                       pr_warn("Error changing brightness\n");
>                        ret = -EIO;
>                }
>        }
> @@ -1008,7 +1002,7 @@ static void set_display(int value)
>        /* no sanity check needed for now */
>        if (!write_acpi_int(hotk->handle, hotk->methods->display_set,
>                            value, NULL))
> -               printk(KERN_WARNING "Asus ACPI: Error setting display\n");
> +               pr_warn("Error setting display\n");
>        return;
>  }
>
> @@ -1021,8 +1015,7 @@ static int disp_proc_show(struct seq_file *m, void *v)
>        int value = 0;
>
>        if (!read_acpi_int(hotk->handle, hotk->methods->display_get, &value))
> -               printk(KERN_WARNING
> -                      "Asus ACPI: Error reading display status\n");
> +               pr_warn("Error reading display status\n");
>        value &= 0x07;  /* needed for some models, shouldn't hurt others */
>        seq_printf(m, "%d\n", value);
>        return 0;
> @@ -1068,7 +1061,7 @@ asus_proc_add(char *name, const struct file_operations *proc_fops, mode_t mode,
>        proc = proc_create_data(name, mode, acpi_device_dir(device),
>                                proc_fops, acpi_driver_data(device));
>        if (!proc) {
> -               printk(KERN_WARNING "  Unable to create %s fs entry\n", name);
> +               pr_warn("  Unable to create %s fs entry\n", name);
>                return -1;
>        }
>        proc->uid = asus_uid;
> @@ -1085,8 +1078,8 @@ static int asus_hotk_add_fs(struct acpi_device *device)
>                mode = S_IFREG | S_IRUGO | S_IWUSR | S_IWGRP;
>        } else {
>                mode = S_IFREG | S_IRUSR | S_IRGRP | S_IWUSR | S_IWGRP;
> -               printk(KERN_WARNING "  asus_uid and asus_gid parameters are "
> -                      "deprecated, use chown and chmod instead!\n");
> +               pr_warn("  asus_uid and asus_gid parameters are "
> +                       "deprecated, use chown and chmod instead!\n");
>        }
>
>        acpi_device_dir(device) = asus_proc_dir;
> @@ -1099,8 +1092,7 @@ static int asus_hotk_add_fs(struct acpi_device *device)
>                proc->uid = asus_uid;
>                proc->gid = asus_gid;
>        } else {
> -               printk(KERN_WARNING "  Unable to create " PROC_INFO
> -                      " fs entry\n");
> +               pr_warn("  Unable to create " PROC_INFO " fs entry\n");
>        }
>
>        if (hotk->methods->mt_wled) {
> @@ -1283,20 +1275,19 @@ static int asus_hotk_get_info(void)
>         */
>        status = acpi_get_table(ACPI_SIG_DSDT, 1, &asus_info);
>        if (ACPI_FAILURE(status))
> -               printk(KERN_WARNING "  Couldn't get the DSDT table header\n");
> +               pr_warn("  Couldn't get the DSDT table header\n");
>
>        /* We have to write 0 on init this far for all ASUS models */
>        if (!write_acpi_int(hotk->handle, "INIT", 0, &buffer)) {
> -               printk(KERN_ERR "  Hotkey initialization failed\n");
> +               pr_err("  Hotkey initialization failed\n");
>                return -ENODEV;
>        }
>
>        /* This needs to be called for some laptops to init properly */
>        if (!read_acpi_int(hotk->handle, "BSTS", &bsts_result))
> -               printk(KERN_WARNING "  Error calling BSTS\n");
> +               pr_warn("  Error calling BSTS\n");
>        else if (bsts_result)
> -               printk(KERN_NOTICE "  BSTS called, 0x%02x returned\n",
> -                      bsts_result);
> +               pr_notice("  BSTS called, 0x%02x returned\n", bsts_result);
>
>        /*
>         * Try to match the object returned by INIT to the specific model.
> @@ -1324,23 +1315,21 @@ static int asus_hotk_get_info(void)
>                if (asus_info &&
>                    strncmp(asus_info->oem_table_id, "ODEM", 4) == 0) {
>                        hotk->model = P30;
> -                       printk(KERN_NOTICE
> -                              "  Samsung P30 detected, supported\n");
> +                       pr_notice("  Samsung P30 detected, supported\n");
>                        hotk->methods = &model_conf[hotk->model];
>                        kfree(model);
>                        return 0;
>                } else {
>                        hotk->model = M2E;
> -                       printk(KERN_NOTICE "  unsupported model %s, trying "
> -                              "default values\n", string);
> -                       printk(KERN_NOTICE
> -                              "  send /proc/acpi/dsdt to the developers\n");
> +                       pr_notice("  unsupported model %s, trying default values\n",
> +                                 string);
> +                       pr_notice("  send /proc/acpi/dsdt to the developers\n");
>                        kfree(model);
>                        return -ENODEV;
>                }
>        }
>        hotk->methods = &model_conf[hotk->model];
> -       printk(KERN_NOTICE "  %s model detected, supported\n", string);
> +       pr_notice("  %s model detected, supported\n", string);
>
>        /* Sort of per-model blacklist */
>        if (strncmp(string, "L2B", 3) == 0)
> @@ -1385,7 +1374,7 @@ static int asus_hotk_check(void)
>        if (hotk->device->status.present) {
>                result = asus_hotk_get_info();
>        } else {
> -               printk(KERN_ERR "  Hotkey device not present, aborting\n");
> +               pr_err("  Hotkey device not present, aborting\n");
>                return -EINVAL;
>        }
>
> @@ -1399,8 +1388,7 @@ static int asus_hotk_add(struct acpi_device *device)
>        acpi_status status = AE_OK;
>        int result;
>
> -       printk(KERN_NOTICE "Asus Laptop ACPI Extras version %s\n",
> -              ASUS_ACPI_VERSION);
> +       pr_notice("Asus Laptop ACPI Extras version %s\n", ASUS_ACPI_VERSION);
>
>        hotk = kzalloc(sizeof(struct asus_hotk), GFP_KERNEL);
>        if (!hotk)
> @@ -1428,15 +1416,14 @@ static int asus_hotk_add(struct acpi_device *device)
>                    acpi_evaluate_object(NULL, hotk->methods->brightness_down,
>                                         NULL, NULL);
>                if (ACPI_FAILURE(status))
> -                       printk(KERN_WARNING "  Error changing brightness\n");
> +                       pr_warn("  Error changing brightness\n");
>                else {
>                        status =
>                            acpi_evaluate_object(NULL,
>                                                 hotk->methods->brightness_up,
>                                                 NULL, NULL);
>                        if (ACPI_FAILURE(status))
> -                               printk(KERN_WARNING "  Strange, error changing"
> -                                      " brightness\n");
> +                               pr_warn("  Strange, error changing brightness\n");
>                }
>        }
>
> @@ -1488,7 +1475,7 @@ static int __init asus_acpi_init(void)
>
>        asus_proc_dir = proc_mkdir(PROC_ASUS, acpi_root_dir);
>        if (!asus_proc_dir) {
> -               printk(KERN_ERR "Asus ACPI: Unable to create /proc entry\n");
> +               pr_err("Unable to create /proc entry\n");
>                acpi_bus_unregister_driver(&asus_hotk_driver);
>                return -ENODEV;
>        }
> @@ -1513,7 +1500,7 @@ static int __init asus_acpi_init(void)
>                                                          &asus_backlight_data,
>                                                          &props);
>        if (IS_ERR(asus_backlight_device)) {
> -               printk(KERN_ERR "Could not register asus backlight device\n");
> +               pr_err("Could not register asus backlight device\n");
>                asus_backlight_device = NULL;
>                asus_acpi_exit();
>                return -ENODEV;
> --
> 1.7.4.2.g597a6.dirty
>
>



--
Corentin Chary
http://xf.iksaif.net
????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?

2011-03-31 07:19:07

by Corentin Chary

[permalink] [raw]
Subject: Re: [PATCH 07/23] eeepc: Use pr_warn

On Wed, Mar 30, 2011 at 12:21 AM, Joe Perches <[email protected]> wrote:
> Just a trivial pr_warning to pr_warn conversion
> while adding a few missing newlines.
>
> Signed-off-by: Joe Perches <[email protected]>

Acked-by: Corentin Chary <[email protected]>

> ---
>  drivers/platform/x86/eeepc-laptop.c |   20 ++++++++++----------
>  drivers/platform/x86/eeepc-wmi.c    |   14 +++++++-------
>  2 files changed, 17 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c
> index 5f2dd38..e5feadd 100644
> --- a/drivers/platform/x86/eeepc-laptop.c
> +++ b/drivers/platform/x86/eeepc-laptop.c
> @@ -228,7 +228,7 @@ static int set_acpi(struct eeepc_laptop *eeepc, int cm, int value)
>                return -ENODEV;
>
>        if (write_acpi_int(eeepc->handle, method, value))
> -               pr_warning("Error writing %s\n", method);
> +               pr_warn("Error writing %s\n", method);
>        return 0;
>  }
>
> @@ -243,7 +243,7 @@ static int get_acpi(struct eeepc_laptop *eeepc, int cm)
>                return -ENODEV;
>
>        if (read_acpi_int(eeepc->handle, method, &value))
> -               pr_warning("Error reading %s\n", method);
> +               pr_warn("Error reading %s\n", method);
>        return value;
>  }
>
> @@ -261,7 +261,7 @@ static int acpi_setter_handle(struct eeepc_laptop *eeepc, int cm,
>        status = acpi_get_handle(eeepc->handle, (char *)method,
>                                 handle);
>        if (status != AE_OK) {
> -               pr_warning("Error finding %s\n", method);
> +               pr_warn("Error finding %s\n", method);
>                return -ENODEV;
>        }
>        return 0;
> @@ -417,7 +417,7 @@ static ssize_t store_cpufv_disabled(struct device *dev,
>        switch (value) {
>        case 0:
>                if (eeepc->cpufv_disabled)
> -                       pr_warning("cpufv enabled (not officially supported "
> +                       pr_warn("cpufv enabled (not officially supported "
>                                "on this model)\n");
>                eeepc->cpufv_disabled = false;
>                return rv;
> @@ -601,7 +601,7 @@ static void eeepc_rfkill_hotplug(struct eeepc_laptop *eeepc)
>        if (eeepc->hotplug_slot) {
>                bus = pci_find_bus(0, 1);
>                if (!bus) {
> -                       pr_warning("Unable to find PCI bus 1?\n");
> +                       pr_warn("Unable to find PCI bus 1?\n");
>                        goto out_unlock;
>                }
>
> @@ -612,12 +612,12 @@ static void eeepc_rfkill_hotplug(struct eeepc_laptop *eeepc)
>                absent = (l == 0xffffffff);
>
>                if (blocked != absent) {
> -                       pr_warning("BIOS says wireless lan is %s, "
> -                                       "but the pci device is %s\n",
> +                       pr_warn("BIOS says wireless lan is %s, "
> +                               "but the pci device is %s\n",
>                                blocked ? "blocked" : "unblocked",
>                                absent ? "absent" : "present");
> -                       pr_warning("skipped wireless hotplug as probably "
> -                                       "inappropriate for this model\n");
> +                       pr_warn("skipped wireless hotplug as probably "
> +                               "inappropriate for this model\n");
>                        goto out_unlock;
>                }
>
> @@ -671,7 +671,7 @@ static int eeepc_register_rfkill_notifier(struct eeepc_laptop *eeepc,
>                                                     eeepc_rfkill_notify,
>                                                     eeepc);
>                if (ACPI_FAILURE(status))
> -                       pr_warning("Failed to register notify on %s\n", node);
> +                       pr_warn("Failed to register notify on %s\n", node);
>        } else
>                return -ENODEV;
>
> diff --git a/drivers/platform/x86/eeepc-wmi.c b/drivers/platform/x86/eeepc-wmi.c
> index 0ddc434..4155884 100644
> --- a/drivers/platform/x86/eeepc-wmi.c
> +++ b/drivers/platform/x86/eeepc-wmi.c
> @@ -82,7 +82,7 @@ static const struct key_entry eeepc_wmi_keymap[] = {
>  static acpi_status eeepc_wmi_parse_device(acpi_handle handle, u32 level,
>                                                 void *context, void **retval)
>  {
> -       pr_warning("Found legacy ATKD device (%s)", EEEPC_ACPI_HID);
> +       pr_warn("Found legacy ATKD device (%s)\n", EEEPC_ACPI_HID);
>        *(bool *)context = true;
>        return AE_CTRL_TERMINATE;
>  }
> @@ -103,12 +103,12 @@ static int eeepc_wmi_check_atkd(void)
>  static int eeepc_wmi_probe(struct platform_device *pdev)
>  {
>        if (eeepc_wmi_check_atkd()) {
> -               pr_warning("WMI device present, but legacy ATKD device is also "
> -                          "present and enabled.");
> -               pr_warning("You probably booted with acpi_osi=\"Linux\" or "
> -                          "acpi_osi=\"!Windows 2009\"");
> -               pr_warning("Can't load eeepc-wmi, use default acpi_osi "
> -                          "(preferred) or eeepc-laptop");
> +               pr_warn("WMI device present, but legacy ATKD device is also "
> +                       "present and enabled\n");
> +               pr_warn("You probably booted with acpi_osi=\"Linux\" or "
> +                       "acpi_osi=\"!Windows 2009\"\n");
> +               pr_warn("Can't load eeepc-wmi, use default acpi_osi "
> +                       "(preferred) or eeepc-laptop\n");
>                return -EBUSY;
>        }
>        return 0;
> --
> 1.7.4.2.g597a6.dirty
>
>



--
Corentin Chary
http://xf.iksaif.net
????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?

2011-04-01 18:21:56

by Matthew Garrett

[permalink] [raw]