Commit f1aaf914 authored by Kenneth Chan's avatar Kenneth Chan Committed by Hans de Goede

platform/x86: panasonic-laptop: Replace ACPI prints with pr_*() macros

Replace ACPI prints with pr_*() macros for consistency with other platform
devices.

Clean up obsolete ACPI_HOTKEY_COMPONENT code.
Signed-off-by: default avatarKenneth Chan <kenneth.t.chan@gmail.com>
Link: https://lore.kernel.org/r/20200821181433.17653-3-kenneth.t.chan@gmail.comSigned-off-by: default avatarHans de Goede <hdegoede@redhat.com>
parent d5a81d8e
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
* *
* ChangeLog: * ChangeLog:
* Aug.18, 2020 Kenneth Chan <kenneth.t.chan@gmail.com> * Aug.18, 2020 Kenneth Chan <kenneth.t.chan@gmail.com>
* replace ACPI prints with pr_*() macros
* -v0.97 add support for cdpower hardware switch * -v0.97 add support for cdpower hardware switch
* -v0.96 merge Lucina's enhancement * -v0.96 merge Lucina's enhancement
* Jan.13, 2009 Martin Lucina <mato@kotelna.sk> * Jan.13, 2009 Martin Lucina <mato@kotelna.sk>
...@@ -124,12 +125,6 @@ ...@@ -124,12 +125,6 @@
#include <linux/input/sparse-keymap.h> #include <linux/input/sparse-keymap.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#ifndef ACPI_HOTKEY_COMPONENT
#define ACPI_HOTKEY_COMPONENT 0x10000000
#endif
#define _COMPONENT ACPI_HOTKEY_COMPONENT
MODULE_AUTHOR("Hiroshi Miura, David Bronaugh and Harald Welte"); MODULE_AUTHOR("Hiroshi Miura, David Bronaugh and Harald Welte");
MODULE_DESCRIPTION("ACPI HotKey driver for Panasonic Let's Note laptops"); MODULE_DESCRIPTION("ACPI HotKey driver for Panasonic Let's Note laptops");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
...@@ -255,8 +250,7 @@ static inline int acpi_pcc_get_sqty(struct acpi_device *device) ...@@ -255,8 +250,7 @@ static inline int acpi_pcc_get_sqty(struct acpi_device *device)
if (ACPI_SUCCESS(status)) if (ACPI_SUCCESS(status))
return s; return s;
else { else {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, pr_err("evaluation error HKEY.SQTY\n");
"evaluation error HKEY.SQTY\n"));
return -EINVAL; return -EINVAL;
} }
} }
...@@ -271,21 +265,19 @@ static int acpi_pcc_retrieve_biosdata(struct pcc_acpi *pcc) ...@@ -271,21 +265,19 @@ static int acpi_pcc_retrieve_biosdata(struct pcc_acpi *pcc)
status = acpi_evaluate_object(pcc->handle, METHOD_HKEY_SINF, NULL, status = acpi_evaluate_object(pcc->handle, METHOD_HKEY_SINF, NULL,
&buffer); &buffer);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, pr_err("evaluation error HKEY.SINF\n");
"evaluation error HKEY.SINF\n"));
return 0; return 0;
} }
hkey = buffer.pointer; hkey = buffer.pointer;
if (!hkey || (hkey->type != ACPI_TYPE_PACKAGE)) { if (!hkey || (hkey->type != ACPI_TYPE_PACKAGE)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid HKEY.SINF\n")); pr_err("Invalid HKEY.SINF\n");
status = AE_ERROR; status = AE_ERROR;
goto end; goto end;
} }
if (pcc->num_sifr < hkey->package.count) { if (pcc->num_sifr < hkey->package.count) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, pr_err("SQTY reports bad SINF length\n");
"SQTY reports bad SINF length\n"));
status = AE_ERROR; status = AE_ERROR;
goto end; goto end;
} }
...@@ -295,8 +287,7 @@ static int acpi_pcc_retrieve_biosdata(struct pcc_acpi *pcc) ...@@ -295,8 +287,7 @@ static int acpi_pcc_retrieve_biosdata(struct pcc_acpi *pcc)
if (likely(element->type == ACPI_TYPE_INTEGER)) { if (likely(element->type == ACPI_TYPE_INTEGER)) {
pcc->sinf[i] = element->integer.value; pcc->sinf[i] = element->integer.value;
} else } else
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, pr_err("Invalid HKEY.SINF data\n");
"Invalid HKEY.SINF data\n"));
} }
pcc->sinf[hkey->package.count] = -1; pcc->sinf[hkey->package.count] = -1;
...@@ -563,8 +554,7 @@ static void acpi_pcc_generate_keyinput(struct pcc_acpi *pcc) ...@@ -563,8 +554,7 @@ static void acpi_pcc_generate_keyinput(struct pcc_acpi *pcc)
rc = acpi_evaluate_integer(pcc->handle, METHOD_HKEY_QUERY, rc = acpi_evaluate_integer(pcc->handle, METHOD_HKEY_QUERY,
NULL, &result); NULL, &result);
if (ACPI_FAILURE(rc)) { if (ACPI_FAILURE(rc)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, pr_err("error getting hotkey status\n");
"error getting hotkey status\n"));
return; return;
} }
...@@ -579,8 +569,7 @@ static void acpi_pcc_generate_keyinput(struct pcc_acpi *pcc) ...@@ -579,8 +569,7 @@ static void acpi_pcc_generate_keyinput(struct pcc_acpi *pcc)
if (!sparse_keymap_report_event(hotk_input_dev, if (!sparse_keymap_report_event(hotk_input_dev,
result & 0xf, result & 0x80, false)) result & 0xf, result & 0x80, false))
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, pr_err("Unknown hotkey event: 0x%04llx\n", result);
"Unknown hotkey event: %d\n", result));
} }
static void acpi_pcc_hotkey_notify(struct acpi_device *device, u32 event) static void acpi_pcc_hotkey_notify(struct acpi_device *device, u32 event)
...@@ -659,15 +648,13 @@ static int acpi_pcc_init_input(struct pcc_acpi *pcc) ...@@ -659,15 +648,13 @@ static int acpi_pcc_init_input(struct pcc_acpi *pcc)
error = sparse_keymap_setup(input_dev, panasonic_keymap, NULL); error = sparse_keymap_setup(input_dev, panasonic_keymap, NULL);
if (error) { if (error) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, pr_err("Unable to setup input device keymap\n");
"Unable to setup input device keymap\n"));
goto err_free_dev; goto err_free_dev;
} }
error = input_register_device(input_dev); error = input_register_device(input_dev);
if (error) { if (error) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, pr_err("Unable to register input device\n");
"Unable to register input device\n"));
goto err_free_dev; goto err_free_dev;
} }
...@@ -693,9 +680,6 @@ static int acpi_pcc_hotkey_resume(struct device *dev) ...@@ -693,9 +680,6 @@ static int acpi_pcc_hotkey_resume(struct device *dev)
if (!pcc) if (!pcc)
return -EINVAL; return -EINVAL;
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Sticky mode restore: %d\n",
pcc->sticky_mode));
return acpi_pcc_write_sset(pcc, SINF_STICKY_KEY, pcc->sticky_mode); return acpi_pcc_write_sset(pcc, SINF_STICKY_KEY, pcc->sticky_mode);
} }
#endif #endif
...@@ -712,14 +696,13 @@ static int acpi_pcc_hotkey_add(struct acpi_device *device) ...@@ -712,14 +696,13 @@ static int acpi_pcc_hotkey_add(struct acpi_device *device)
num_sifr = acpi_pcc_get_sqty(device); num_sifr = acpi_pcc_get_sqty(device);
if (num_sifr < 0 || num_sifr > 255) { if (num_sifr < 0 || num_sifr > 255) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "num_sifr out of range")); pr_err("num_sifr out of range");
return -ENODEV; return -ENODEV;
} }
pcc = kzalloc(sizeof(struct pcc_acpi), GFP_KERNEL); pcc = kzalloc(sizeof(struct pcc_acpi), GFP_KERNEL);
if (!pcc) { if (!pcc) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, pr_err("Couldn't allocate mem for pcc");
"Couldn't allocate mem for pcc"));
return -ENOMEM; return -ENOMEM;
} }
...@@ -738,15 +721,13 @@ static int acpi_pcc_hotkey_add(struct acpi_device *device) ...@@ -738,15 +721,13 @@ static int acpi_pcc_hotkey_add(struct acpi_device *device)
result = acpi_pcc_init_input(pcc); result = acpi_pcc_init_input(pcc);
if (result) { if (result) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, pr_err("Error installing keyinput handler\n");
"Error installing keyinput handler\n"));
goto out_sinf; goto out_sinf;
} }
if (!acpi_pcc_retrieve_biosdata(pcc)) { if (!acpi_pcc_retrieve_biosdata(pcc)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Couldn't retrieve BIOS data\n"));
result = -EIO; result = -EIO;
pr_err("Couldn't retrieve BIOS data\n");
goto out_input; goto out_input;
} }
/* initialize backlight */ /* initialize backlight */
......
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