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