diff options
author | Lee, Chun-Yi <joeyli.kernel@gmail.com> | 2011-03-16 06:52:36 -0400 |
---|---|---|
committer | Matthew Garrett <mjg@redhat.com> | 2011-03-28 06:46:09 -0400 |
commit | cae157026491d2e9a789b876a367dee7b17235cb (patch) | |
tree | c65dbdca254c143b03b4824b4e51dd1b067b8f81 /drivers | |
parent | a1d6086739c5b8f23a48e02e62b0e495321a2122 (diff) |
acer-wmi: use pr_<level> for messages
acer-wmi: use pr_<level> for messages
Cc: Carlos Corbacho <carlos@strangeworlds.co.uk>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Corentin Chary <corentincj@iksaif.net>
Cc: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Lee, Chun-Yi <jlee@novell.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/platform/x86/acer-wmi.c | 68 |
1 files changed, 28 insertions, 40 deletions
diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c index c1036d288f19..d798314b81fe 100644 --- a/drivers/platform/x86/acer-wmi.c +++ b/drivers/platform/x86/acer-wmi.c | |||
@@ -22,6 +22,8 @@ | |||
22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
26 | |||
25 | #include <linux/kernel.h> | 27 | #include <linux/kernel.h> |
26 | #include <linux/module.h> | 28 | #include <linux/module.h> |
27 | #include <linux/init.h> | 29 | #include <linux/init.h> |
@@ -46,12 +48,6 @@ MODULE_AUTHOR("Carlos Corbacho"); | |||
46 | MODULE_DESCRIPTION("Acer Laptop WMI Extras Driver"); | 48 | MODULE_DESCRIPTION("Acer Laptop WMI Extras Driver"); |
47 | MODULE_LICENSE("GPL"); | 49 | MODULE_LICENSE("GPL"); |
48 | 50 | ||
49 | #define ACER_LOGPREFIX "acer-wmi: " | ||
50 | #define ACER_ERR KERN_ERR ACER_LOGPREFIX | ||
51 | #define ACER_NOTICE KERN_NOTICE ACER_LOGPREFIX | ||
52 | #define ACER_INFO KERN_INFO ACER_LOGPREFIX | ||
53 | #define ACER_WARNING KERN_WARNING ACER_LOGPREFIX | ||
54 | |||
55 | /* | 51 | /* |
56 | * Magic Number | 52 | * Magic Number |
57 | * Meaning is unknown - this number is required for writing to ACPI for AMW0 | 53 | * Meaning is unknown - this number is required for writing to ACPI for AMW0 |
@@ -845,7 +841,7 @@ static void type_aa_dmi_decode(const struct dmi_header *header, void *dummy) | |||
845 | has_type_aa = true; | 841 | has_type_aa = true; |
846 | type_aa = (struct hotkey_function_type_aa *) header; | 842 | type_aa = (struct hotkey_function_type_aa *) header; |
847 | 843 | ||
848 | printk(ACER_INFO "Function bitmap for Communication Button: 0x%x\n", | 844 | pr_info("Function bitmap for Communication Button: 0x%x\n", |
849 | type_aa->commun_func_bitmap); | 845 | type_aa->commun_func_bitmap); |
850 | 846 | ||
851 | if (type_aa->commun_func_bitmap & ACER_WMID3_GDS_WIRELESS) | 847 | if (type_aa->commun_func_bitmap & ACER_WMID3_GDS_WIRELESS) |
@@ -1037,7 +1033,7 @@ static int __devinit acer_backlight_init(struct device *dev) | |||
1037 | bd = backlight_device_register("acer-wmi", dev, NULL, &acer_bl_ops, | 1033 | bd = backlight_device_register("acer-wmi", dev, NULL, &acer_bl_ops, |
1038 | &props); | 1034 | &props); |
1039 | if (IS_ERR(bd)) { | 1035 | if (IS_ERR(bd)) { |
1040 | printk(ACER_ERR "Could not register Acer backlight device\n"); | 1036 | pr_err("Could not register Acer backlight device\n"); |
1041 | acer_backlight_device = NULL; | 1037 | acer_backlight_device = NULL; |
1042 | return PTR_ERR(bd); | 1038 | return PTR_ERR(bd); |
1043 | } | 1039 | } |
@@ -1084,8 +1080,7 @@ static acpi_status wmid3_get_device_status(u32 *value, u16 device) | |||
1084 | return AE_ERROR; | 1080 | return AE_ERROR; |
1085 | } | 1081 | } |
1086 | if (obj->buffer.length != 8) { | 1082 | if (obj->buffer.length != 8) { |
1087 | printk(ACER_WARNING "Unknown buffer length %d\n", | 1083 | pr_warning("Unknown buffer length %d\n", obj->buffer.length); |
1088 | obj->buffer.length); | ||
1089 | kfree(obj); | 1084 | kfree(obj); |
1090 | return AE_ERROR; | 1085 | return AE_ERROR; |
1091 | } | 1086 | } |
@@ -1094,7 +1089,7 @@ static acpi_status wmid3_get_device_status(u32 *value, u16 device) | |||
1094 | kfree(obj); | 1089 | kfree(obj); |
1095 | 1090 | ||
1096 | if (return_value.error_code || return_value.ec_return_value) | 1091 | if (return_value.error_code || return_value.ec_return_value) |
1097 | printk(ACER_WARNING "Get Device Status failed: " | 1092 | pr_warning("Get Device Status failed: " |
1098 | "0x%x - 0x%x\n", return_value.error_code, | 1093 | "0x%x - 0x%x\n", return_value.error_code, |
1099 | return_value.ec_return_value); | 1094 | return_value.ec_return_value); |
1100 | else | 1095 | else |
@@ -1310,7 +1305,7 @@ static void acer_wmi_notify(u32 value, void *context) | |||
1310 | 1305 | ||
1311 | status = wmi_get_event_data(value, &response); | 1306 | status = wmi_get_event_data(value, &response); |
1312 | if (status != AE_OK) { | 1307 | if (status != AE_OK) { |
1313 | printk(ACER_WARNING "bad event status 0x%x\n", status); | 1308 | pr_warning("bad event status 0x%x\n", status); |
1314 | return; | 1309 | return; |
1315 | } | 1310 | } |
1316 | 1311 | ||
@@ -1319,14 +1314,12 @@ static void acer_wmi_notify(u32 value, void *context) | |||
1319 | if (!obj) | 1314 | if (!obj) |
1320 | return; | 1315 | return; |
1321 | if (obj->type != ACPI_TYPE_BUFFER) { | 1316 | if (obj->type != ACPI_TYPE_BUFFER) { |
1322 | printk(ACER_WARNING "Unknown response received %d\n", | 1317 | pr_warning("Unknown response received %d\n", obj->type); |
1323 | obj->type); | ||
1324 | kfree(obj); | 1318 | kfree(obj); |
1325 | return; | 1319 | return; |
1326 | } | 1320 | } |
1327 | if (obj->buffer.length != 8) { | 1321 | if (obj->buffer.length != 8) { |
1328 | printk(ACER_WARNING "Unknown buffer length %d\n", | 1322 | pr_warning("Unknown buffer length %d\n", obj->buffer.length); |
1329 | obj->buffer.length); | ||
1330 | kfree(obj); | 1323 | kfree(obj); |
1331 | return; | 1324 | return; |
1332 | } | 1325 | } |
@@ -1338,11 +1331,11 @@ static void acer_wmi_notify(u32 value, void *context) | |||
1338 | case WMID_HOTKEY_EVENT: | 1331 | case WMID_HOTKEY_EVENT: |
1339 | if (!sparse_keymap_report_event(acer_wmi_input_dev, | 1332 | if (!sparse_keymap_report_event(acer_wmi_input_dev, |
1340 | return_value.key_num, 1, true)) | 1333 | return_value.key_num, 1, true)) |
1341 | printk(ACER_WARNING "Unknown key number - 0x%x\n", | 1334 | pr_warning("Unknown key number - 0x%x\n", |
1342 | return_value.key_num); | 1335 | return_value.key_num); |
1343 | break; | 1336 | break; |
1344 | default: | 1337 | default: |
1345 | printk(ACER_WARNING "Unknown function number - %d - %d\n", | 1338 | pr_warning("Unknown function number - %d - %d\n", |
1346 | return_value.function, return_value.key_num); | 1339 | return_value.function, return_value.key_num); |
1347 | break; | 1340 | break; |
1348 | } | 1341 | } |
@@ -1371,8 +1364,7 @@ wmid3_set_lm_mode(struct lm_input_params *params, | |||
1371 | return AE_ERROR; | 1364 | return AE_ERROR; |
1372 | } | 1365 | } |
1373 | if (obj->buffer.length != 4) { | 1366 | if (obj->buffer.length != 4) { |
1374 | printk(ACER_WARNING "Unknown buffer length %d\n", | 1367 | pr_warning("Unknown buffer length %d\n", obj->buffer.length); |
1375 | obj->buffer.length); | ||
1376 | kfree(obj); | 1368 | kfree(obj); |
1377 | return AE_ERROR; | 1369 | return AE_ERROR; |
1378 | } | 1370 | } |
@@ -1397,11 +1389,11 @@ static int acer_wmi_enable_ec_raw(void) | |||
1397 | status = wmid3_set_lm_mode(¶ms, &return_value); | 1389 | status = wmid3_set_lm_mode(¶ms, &return_value); |
1398 | 1390 | ||
1399 | if (return_value.error_code || return_value.ec_return_value) | 1391 | if (return_value.error_code || return_value.ec_return_value) |
1400 | printk(ACER_WARNING "Enabling EC raw mode failed: " | 1392 | pr_warning("Enabling EC raw mode failed: " |
1401 | "0x%x - 0x%x\n", return_value.error_code, | 1393 | "0x%x - 0x%x\n", return_value.error_code, |
1402 | return_value.ec_return_value); | 1394 | return_value.ec_return_value); |
1403 | else | 1395 | else |
1404 | printk(ACER_INFO "Enabled EC raw mode"); | 1396 | pr_info("Enabled EC raw mode"); |
1405 | 1397 | ||
1406 | return status; | 1398 | return status; |
1407 | } | 1399 | } |
@@ -1420,7 +1412,7 @@ static int acer_wmi_enable_lm(void) | |||
1420 | status = wmid3_set_lm_mode(¶ms, &return_value); | 1412 | status = wmid3_set_lm_mode(¶ms, &return_value); |
1421 | 1413 | ||
1422 | if (return_value.error_code || return_value.ec_return_value) | 1414 | if (return_value.error_code || return_value.ec_return_value) |
1423 | printk(ACER_WARNING "Enabling Launch Manager failed: " | 1415 | pr_warning("Enabling Launch Manager failed: " |
1424 | "0x%x - 0x%x\n", return_value.error_code, | 1416 | "0x%x - 0x%x\n", return_value.error_code, |
1425 | return_value.ec_return_value); | 1417 | return_value.ec_return_value); |
1426 | 1418 | ||
@@ -1650,7 +1642,7 @@ static int create_debugfs(void) | |||
1650 | { | 1642 | { |
1651 | interface->debug.root = debugfs_create_dir("acer-wmi", NULL); | 1643 | interface->debug.root = debugfs_create_dir("acer-wmi", NULL); |
1652 | if (!interface->debug.root) { | 1644 | if (!interface->debug.root) { |
1653 | printk(ACER_ERR "Failed to create debugfs directory"); | 1645 | pr_err("Failed to create debugfs directory"); |
1654 | return -ENOMEM; | 1646 | return -ENOMEM; |
1655 | } | 1647 | } |
1656 | 1648 | ||
@@ -1671,11 +1663,10 @@ static int __init acer_wmi_init(void) | |||
1671 | { | 1663 | { |
1672 | int err; | 1664 | int err; |
1673 | 1665 | ||
1674 | printk(ACER_INFO "Acer Laptop ACPI-WMI Extras\n"); | 1666 | pr_info("Acer Laptop ACPI-WMI Extras\n"); |
1675 | 1667 | ||
1676 | if (dmi_check_system(acer_blacklist)) { | 1668 | if (dmi_check_system(acer_blacklist)) { |
1677 | printk(ACER_INFO "Blacklisted hardware detected - " | 1669 | pr_info("Blacklisted hardware detected - not loading\n"); |
1678 | "not loading\n"); | ||
1679 | return -ENODEV; | 1670 | return -ENODEV; |
1680 | } | 1671 | } |
1681 | 1672 | ||
@@ -1692,12 +1683,11 @@ static int __init acer_wmi_init(void) | |||
1692 | 1683 | ||
1693 | if (wmi_has_guid(WMID_GUID2) && interface) { | 1684 | if (wmi_has_guid(WMID_GUID2) && interface) { |
1694 | if (ACPI_FAILURE(WMID_set_capabilities())) { | 1685 | if (ACPI_FAILURE(WMID_set_capabilities())) { |
1695 | printk(ACER_ERR "Unable to detect available WMID " | 1686 | pr_err("Unable to detect available WMID devices\n"); |
1696 | "devices\n"); | ||
1697 | return -ENODEV; | 1687 | return -ENODEV; |
1698 | } | 1688 | } |
1699 | } else if (!wmi_has_guid(WMID_GUID2) && interface) { | 1689 | } else if (!wmi_has_guid(WMID_GUID2) && interface) { |
1700 | printk(ACER_ERR "No WMID device detection method found\n"); | 1690 | pr_err("No WMID device detection method found\n"); |
1701 | return -ENODEV; | 1691 | return -ENODEV; |
1702 | } | 1692 | } |
1703 | 1693 | ||
@@ -1705,8 +1695,7 @@ static int __init acer_wmi_init(void) | |||
1705 | interface = &AMW0_interface; | 1695 | interface = &AMW0_interface; |
1706 | 1696 | ||
1707 | if (ACPI_FAILURE(AMW0_set_capabilities())) { | 1697 | if (ACPI_FAILURE(AMW0_set_capabilities())) { |
1708 | printk(ACER_ERR "Unable to detect available AMW0 " | 1698 | pr_err("Unable to detect available AMW0 devices\n"); |
1709 | "devices\n"); | ||
1710 | return -ENODEV; | 1699 | return -ENODEV; |
1711 | } | 1700 | } |
1712 | } | 1701 | } |
@@ -1715,8 +1704,7 @@ static int __init acer_wmi_init(void) | |||
1715 | AMW0_find_mailled(); | 1704 | AMW0_find_mailled(); |
1716 | 1705 | ||
1717 | if (!interface) { | 1706 | if (!interface) { |
1718 | printk(ACER_INFO "No or unsupported WMI interface, unable to " | 1707 | pr_err("No or unsupported WMI interface, unable to load\n"); |
1719 | "load\n"); | ||
1720 | return -ENODEV; | 1708 | return -ENODEV; |
1721 | } | 1709 | } |
1722 | 1710 | ||
@@ -1724,22 +1712,22 @@ static int __init acer_wmi_init(void) | |||
1724 | 1712 | ||
1725 | if (acpi_video_backlight_support() && has_cap(ACER_CAP_BRIGHTNESS)) { | 1713 | if (acpi_video_backlight_support() && has_cap(ACER_CAP_BRIGHTNESS)) { |
1726 | interface->capability &= ~ACER_CAP_BRIGHTNESS; | 1714 | interface->capability &= ~ACER_CAP_BRIGHTNESS; |
1727 | printk(ACER_INFO "Brightness must be controlled by " | 1715 | pr_info("Brightness must be controlled by " |
1728 | "generic video driver\n"); | 1716 | "generic video driver\n"); |
1729 | } | 1717 | } |
1730 | 1718 | ||
1731 | if (wmi_has_guid(WMID_GUID3)) { | 1719 | if (wmi_has_guid(WMID_GUID3)) { |
1732 | if (ec_raw_mode) { | 1720 | if (ec_raw_mode) { |
1733 | if (ACPI_FAILURE(acer_wmi_enable_ec_raw())) { | 1721 | if (ACPI_FAILURE(acer_wmi_enable_ec_raw())) { |
1734 | printk(ACER_ERR "Cannot enable EC raw mode\n"); | 1722 | pr_err("Cannot enable EC raw mode\n"); |
1735 | return -ENODEV; | 1723 | return -ENODEV; |
1736 | } | 1724 | } |
1737 | } else if (ACPI_FAILURE(acer_wmi_enable_lm())) { | 1725 | } else if (ACPI_FAILURE(acer_wmi_enable_lm())) { |
1738 | printk(ACER_ERR "Cannot enable Launch Manager mode\n"); | 1726 | pr_err("Cannot enable Launch Manager mode\n"); |
1739 | return -ENODEV; | 1727 | return -ENODEV; |
1740 | } | 1728 | } |
1741 | } else if (ec_raw_mode) { | 1729 | } else if (ec_raw_mode) { |
1742 | printk(ACER_INFO "No WMID EC raw mode enable method\n"); | 1730 | pr_info("No WMID EC raw mode enable method\n"); |
1743 | } | 1731 | } |
1744 | 1732 | ||
1745 | if (wmi_has_guid(ACERWMID_EVENT_GUID)) { | 1733 | if (wmi_has_guid(ACERWMID_EVENT_GUID)) { |
@@ -1750,7 +1738,7 @@ static int __init acer_wmi_init(void) | |||
1750 | 1738 | ||
1751 | err = platform_driver_register(&acer_platform_driver); | 1739 | err = platform_driver_register(&acer_platform_driver); |
1752 | if (err) { | 1740 | if (err) { |
1753 | printk(ACER_ERR "Unable to register platform driver.\n"); | 1741 | pr_err("Unable to register platform driver.\n"); |
1754 | goto error_platform_register; | 1742 | goto error_platform_register; |
1755 | } | 1743 | } |
1756 | 1744 | ||
@@ -1805,7 +1793,7 @@ static void __exit acer_wmi_exit(void) | |||
1805 | platform_device_unregister(acer_platform_device); | 1793 | platform_device_unregister(acer_platform_device); |
1806 | platform_driver_unregister(&acer_platform_driver); | 1794 | platform_driver_unregister(&acer_platform_driver); |
1807 | 1795 | ||
1808 | printk(ACER_INFO "Acer Laptop WMI Extras unloaded\n"); | 1796 | pr_info("Acer Laptop WMI Extras unloaded\n"); |
1809 | return; | 1797 | return; |
1810 | } | 1798 | } |
1811 | 1799 | ||