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

From: Corentin Chary
Date: Thu Mar 31 2011 - 03:18:34 EST


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

Acked-by: Corentin Chary <corentincj@xxxxxxxxxx>

> ---
> Â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
¢éì®&Þ~º&¶¬–+-±éÝ¥Šw®žË±Êâmébžìdz¹Þ)í…æèw*jg¬±¨¶‰šŽŠÝj/êäz¹ÞŠà2ŠÞ¨è­Ú&¢)ß«a¶Úþø®G«éh®æj:+v‰¨Šwè†Ù>Wš±êÞiÛaxPjØm¶Ÿÿà -»+ƒùdš_