Commit f7e02c8d authored by Hanjun Guo's avatar Hanjun Guo Committed by Rafael J. Wysocki

ACPI: sbs: Unify the message printing

Using pr_fmt() and pr_*() macros to unify the message printing.

While at it, fix the obvious coding style issue when scanning
the code.
Signed-off-by: default avatarHanjun Guo <guohanjun@huawei.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 8acf4108
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
* Copyright (c) 2005 Rich Townsend <rhdt@bartol.udel.edu> * Copyright (c) 2005 Rich Townsend <rhdt@bartol.udel.edu>
*/ */
#define pr_fmt(fmt) "ACPI: " fmt
#include <linux/init.h> #include <linux/init.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/module.h> #include <linux/module.h>
...@@ -23,8 +25,6 @@ ...@@ -23,8 +25,6 @@
#include "sbshc.h" #include "sbshc.h"
#define PREFIX "ACPI: "
#define ACPI_SBS_CLASS "sbs" #define ACPI_SBS_CLASS "sbs"
#define ACPI_AC_CLASS "ac_adapter" #define ACPI_AC_CLASS "ac_adapter"
#define ACPI_SBS_DEVICE_NAME "Smart Battery System" #define ACPI_SBS_DEVICE_NAME "Smart Battery System"
...@@ -544,7 +544,7 @@ static int acpi_battery_add(struct acpi_sbs *sbs, int id) ...@@ -544,7 +544,7 @@ static int acpi_battery_add(struct acpi_sbs *sbs, int id)
goto end; goto end;
battery->have_sysfs_alarm = 1; battery->have_sysfs_alarm = 1;
end: end:
printk(KERN_INFO PREFIX "%s [%s]: Battery Slot [%s] (battery %s)\n", pr_info("%s [%s]: Battery Slot [%s] (battery %s)\n",
ACPI_SBS_DEVICE_NAME, acpi_device_bid(sbs->device), ACPI_SBS_DEVICE_NAME, acpi_device_bid(sbs->device),
battery->name, battery->present ? "present" : "absent"); battery->name, battery->present ? "present" : "absent");
return result; return result;
...@@ -577,10 +577,10 @@ static int acpi_charger_add(struct acpi_sbs *sbs) ...@@ -577,10 +577,10 @@ static int acpi_charger_add(struct acpi_sbs *sbs)
result = PTR_ERR(sbs->charger); result = PTR_ERR(sbs->charger);
sbs->charger = NULL; sbs->charger = NULL;
} }
printk(KERN_INFO PREFIX "%s [%s]: AC Adapter [%s] (%s)\n", pr_info("%s [%s]: AC Adapter [%s] (%s)\n",
ACPI_SBS_DEVICE_NAME, acpi_device_bid(sbs->device), ACPI_SBS_DEVICE_NAME, acpi_device_bid(sbs->device),
ACPI_AC_DIR_NAME, sbs->charger_present ? "on-line" : "off-line"); ACPI_AC_DIR_NAME, sbs->charger_present ? "on-line" : "off-line");
end: end:
return result; return result;
} }
...@@ -658,7 +658,7 @@ static int acpi_sbs_add(struct acpi_device *device) ...@@ -658,7 +658,7 @@ static int acpi_sbs_add(struct acpi_device *device)
acpi_battery_add(sbs, 0); acpi_battery_add(sbs, 0);
acpi_smbus_register_callback(sbs->hc, acpi_sbs_callback, sbs); acpi_smbus_register_callback(sbs->hc, acpi_sbs_callback, sbs);
end: end:
if (result) if (result)
acpi_sbs_remove(device); acpi_sbs_remove(device);
return result; return result;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment