asus-laptop: use pr_fmt and pr_<level>

Convert the unusual printk(ASUS_<level> uses to
the more standard pr_fmt and pr_<level>(.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>

authored by

Corentin Chary and committed by
Len Brown
2fcc23da b31d0fde

+26 -24
+26 -24
drivers/platform/x86/asus-laptop.c
··· 33 * Sam Lin - GPS support 34 */ 35 36 #include <linux/kernel.h> 37 #include <linux/module.h> 38 #include <linux/init.h> ··· 55 #define ASUS_HOTK_NAME "Asus Laptop Support" 56 #define ASUS_HOTK_CLASS "hotkey" 57 #define ASUS_HOTK_DEVICE_NAME "Hotkey" 58 - #define ASUS_HOTK_FILE "asus-laptop" 59 #define ASUS_HOTK_PREFIX "\\_SB.ATKD." 60 61 /* 62 * Some events we use, same for all Asus ··· 330 331 rv = acpi_evaluate_integer(wireless_status_handle, NULL, NULL, &status); 332 if (ACPI_FAILURE(rv)) 333 - printk(ASUS_WARNING "Error reading Wireless status\n"); 334 else 335 return (status & mask) ? 1 : 0; 336 ··· 344 345 rv = acpi_evaluate_integer(gps_status_handle, NULL, NULL, &status); 346 if (ACPI_FAILURE(rv)) 347 - printk(ASUS_WARNING "Error reading GPS status\n"); 348 else 349 return status ? 1 : 0; 350 ··· 384 } 385 386 if (write_acpi_int(handle, NULL, out, NULL)) 387 - printk(ASUS_WARNING " write failed %x\n", mask); 388 } 389 390 /* /sys/class/led handlers */ ··· 427 NULL, NULL, NULL); 428 429 if (ACPI_FAILURE(status)) 430 - printk(ASUS_WARNING "Error switching LCD\n"); 431 } 432 433 write_status(NULL, lcd, LCD_ON); ··· 451 452 rv = acpi_evaluate_integer(brightness_get_handle, NULL, NULL, &value); 453 if (ACPI_FAILURE(rv)) 454 - printk(ASUS_WARNING "Error reading brightness\n"); 455 456 return value; 457 } ··· 464 /* 0 <= value <= 15 */ 465 466 if (write_acpi_int(brightness_set_handle, NULL, value, NULL)) { 467 - printk(ASUS_WARNING "Error changing brightness\n"); 468 ret = -EIO; 469 } 470 ··· 594 rv = parse_arg(buf, count, &value); 595 if (rv > 0) { 596 if (write_acpi_int(ledd_set_handle, NULL, value, NULL)) 597 - printk(ASUS_WARNING "LED display write failed\n"); 598 else 599 hotk->ledd_status = (u32) value; 600 } ··· 639 { 640 /* no sanity check needed for now */ 641 if (write_acpi_int(display_set_handle, NULL, value, NULL)) 642 - printk(ASUS_WARNING "Error setting display\n"); 643 return; 644 } 645 ··· 654 rv = acpi_evaluate_integer(display_get_handle, NULL, 655 NULL, &value); 656 if (ACPI_FAILURE(rv)) 657 - printk(ASUS_WARNING "Error reading display status\n"); 658 } 659 660 value &= 0x0F; /* needed for some models, shouldn't hurt others */ ··· 696 static void set_light_sens_switch(int value) 697 { 698 if (write_acpi_int(ls_switch_handle, NULL, value, NULL)) 699 - printk(ASUS_WARNING "Error setting light sensor switch\n"); 700 hotk->light_switch = value; 701 } 702 ··· 721 static void set_light_sens_level(int value) 722 { 723 if (write_acpi_int(ls_level_handle, NULL, value, NULL)) 724 - printk(ASUS_WARNING "Error setting light sensor level\n"); 725 hotk->light_level = value; 726 } 727 ··· 982 */ 983 status = acpi_get_table(ACPI_SIG_DSDT, 1, &asus_info); 984 if (ACPI_FAILURE(status)) 985 - printk(ASUS_WARNING "Couldn't get the DSDT table header\n"); 986 987 /* We have to write 0 on init this far for all ASUS models */ 988 if (write_acpi_int(hotk->handle, "INIT", 0, &buffer)) { 989 - printk(ASUS_ERR "Hotkey initialization failed\n"); 990 return -ENODEV; 991 } 992 ··· 994 status = 995 acpi_evaluate_integer(hotk->handle, "BSTS", NULL, &bsts_result); 996 if (ACPI_FAILURE(status)) 997 - printk(ASUS_WARNING "Error calling BSTS\n"); 998 else if (bsts_result) 999 - printk(ASUS_NOTICE "BSTS called, 0x%02x returned\n", 1000 (uint) bsts_result); 1001 1002 /* This too ... */ ··· 1027 return -ENOMEM; 1028 1029 if (*string) 1030 - printk(ASUS_NOTICE " %s model detected\n", string); 1031 1032 ASUS_HANDLE_INIT(mled_set); 1033 ASUS_HANDLE_INIT(tled_set); ··· 1084 1085 hotk->inputdev = input_allocate_device(); 1086 if (!hotk->inputdev) { 1087 - printk(ASUS_INFO "Unable to allocate input device\n"); 1088 return 0; 1089 } 1090 hotk->inputdev->name = "Asus Laptop extra buttons"; ··· 1103 } 1104 result = input_register_device(hotk->inputdev); 1105 if (result) { 1106 - printk(ASUS_INFO "Unable to register input device\n"); 1107 input_free_device(hotk->inputdev); 1108 } 1109 return result; ··· 1120 if (hotk->device->status.present) { 1121 result = asus_hotk_get_info(); 1122 } else { 1123 - printk(ASUS_ERR "Hotkey device not present, aborting\n"); 1124 return -EINVAL; 1125 } 1126 ··· 1136 if (!device) 1137 return -EINVAL; 1138 1139 - printk(ASUS_NOTICE "Asus Laptop Support version %s\n", 1140 ASUS_LAPTOP_VERSION); 1141 1142 hotk = kzalloc(sizeof(struct asus_hotk), GFP_KERNEL); ··· 1250 bd = backlight_device_register(ASUS_HOTK_FILE, dev, 1251 NULL, &asusbl_ops); 1252 if (IS_ERR(bd)) { 1253 - printk(ASUS_ERR 1254 - "Could not register asus backlight device\n"); 1255 asus_backlight_device = NULL; 1256 return PTR_ERR(bd); 1257 } ··· 1377 if (result) 1378 goto fail_backlight; 1379 } else 1380 - printk(ASUS_INFO "Brightness ignored, must be controlled by " 1381 "ACPI video driver\n"); 1382 1383 return 0;
··· 33 * Sam Lin - GPS support 34 */ 35 36 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 37 + 38 #include <linux/kernel.h> 39 #include <linux/module.h> 40 #include <linux/init.h> ··· 53 #define ASUS_HOTK_NAME "Asus Laptop Support" 54 #define ASUS_HOTK_CLASS "hotkey" 55 #define ASUS_HOTK_DEVICE_NAME "Hotkey" 56 + #define ASUS_HOTK_FILE KBUILD_MODNAME 57 #define ASUS_HOTK_PREFIX "\\_SB.ATKD." 58 + 59 60 /* 61 * Some events we use, same for all Asus ··· 327 328 rv = acpi_evaluate_integer(wireless_status_handle, NULL, NULL, &status); 329 if (ACPI_FAILURE(rv)) 330 + pr_warning("Error reading Wireless status\n"); 331 else 332 return (status & mask) ? 1 : 0; 333 ··· 341 342 rv = acpi_evaluate_integer(gps_status_handle, NULL, NULL, &status); 343 if (ACPI_FAILURE(rv)) 344 + pr_warning("Error reading GPS status\n"); 345 else 346 return status ? 1 : 0; 347 ··· 381 } 382 383 if (write_acpi_int(handle, NULL, out, NULL)) 384 + pr_warning(" write failed %x\n", mask); 385 } 386 387 /* /sys/class/led handlers */ ··· 424 NULL, NULL, NULL); 425 426 if (ACPI_FAILURE(status)) 427 + pr_warning("Error switching LCD\n"); 428 } 429 430 write_status(NULL, lcd, LCD_ON); ··· 448 449 rv = acpi_evaluate_integer(brightness_get_handle, NULL, NULL, &value); 450 if (ACPI_FAILURE(rv)) 451 + pr_warning("Error reading brightness\n"); 452 453 return value; 454 } ··· 461 /* 0 <= value <= 15 */ 462 463 if (write_acpi_int(brightness_set_handle, NULL, value, NULL)) { 464 + pr_warning("Error changing brightness\n"); 465 ret = -EIO; 466 } 467 ··· 591 rv = parse_arg(buf, count, &value); 592 if (rv > 0) { 593 if (write_acpi_int(ledd_set_handle, NULL, value, NULL)) 594 + pr_warning("LED display write failed\n"); 595 else 596 hotk->ledd_status = (u32) value; 597 } ··· 636 { 637 /* no sanity check needed for now */ 638 if (write_acpi_int(display_set_handle, NULL, value, NULL)) 639 + pr_warning("Error setting display\n"); 640 return; 641 } 642 ··· 651 rv = acpi_evaluate_integer(display_get_handle, NULL, 652 NULL, &value); 653 if (ACPI_FAILURE(rv)) 654 + pr_warning("Error reading display status\n"); 655 } 656 657 value &= 0x0F; /* needed for some models, shouldn't hurt others */ ··· 693 static void set_light_sens_switch(int value) 694 { 695 if (write_acpi_int(ls_switch_handle, NULL, value, NULL)) 696 + pr_warning("Error setting light sensor switch\n"); 697 hotk->light_switch = value; 698 } 699 ··· 718 static void set_light_sens_level(int value) 719 { 720 if (write_acpi_int(ls_level_handle, NULL, value, NULL)) 721 + pr_warning("Error setting light sensor level\n"); 722 hotk->light_level = value; 723 } 724 ··· 979 */ 980 status = acpi_get_table(ACPI_SIG_DSDT, 1, &asus_info); 981 if (ACPI_FAILURE(status)) 982 + pr_warning("Couldn't get the DSDT table header\n"); 983 984 /* We have to write 0 on init this far for all ASUS models */ 985 if (write_acpi_int(hotk->handle, "INIT", 0, &buffer)) { 986 + pr_err("Hotkey initialization failed\n"); 987 return -ENODEV; 988 } 989 ··· 991 status = 992 acpi_evaluate_integer(hotk->handle, "BSTS", NULL, &bsts_result); 993 if (ACPI_FAILURE(status)) 994 + pr_warning("Error calling BSTS\n"); 995 else if (bsts_result) 996 + pr_notice("BSTS called, 0x%02x returned\n", 997 (uint) bsts_result); 998 999 /* This too ... */ ··· 1024 return -ENOMEM; 1025 1026 if (*string) 1027 + pr_notice(" %s model detected\n", string); 1028 1029 ASUS_HANDLE_INIT(mled_set); 1030 ASUS_HANDLE_INIT(tled_set); ··· 1081 1082 hotk->inputdev = input_allocate_device(); 1083 if (!hotk->inputdev) { 1084 + pr_info("Unable to allocate input device\n"); 1085 return 0; 1086 } 1087 hotk->inputdev->name = "Asus Laptop extra buttons"; ··· 1100 } 1101 result = input_register_device(hotk->inputdev); 1102 if (result) { 1103 + pr_info("Unable to register input device\n"); 1104 input_free_device(hotk->inputdev); 1105 } 1106 return result; ··· 1117 if (hotk->device->status.present) { 1118 result = asus_hotk_get_info(); 1119 } else { 1120 + pr_err("Hotkey device not present, aborting\n"); 1121 return -EINVAL; 1122 } 1123 ··· 1133 if (!device) 1134 return -EINVAL; 1135 1136 + pr_notice("Asus Laptop Support version %s\n", 1137 ASUS_LAPTOP_VERSION); 1138 1139 hotk = kzalloc(sizeof(struct asus_hotk), GFP_KERNEL); ··· 1247 bd = backlight_device_register(ASUS_HOTK_FILE, dev, 1248 NULL, &asusbl_ops); 1249 if (IS_ERR(bd)) { 1250 + pr_err("Could not register asus backlight device\n"); 1251 asus_backlight_device = NULL; 1252 return PTR_ERR(bd); 1253 } ··· 1375 if (result) 1376 goto fail_backlight; 1377 } else 1378 + pr_info("Brightness ignored, must be controlled by " 1379 "ACPI video driver\n"); 1380 1381 return 0;