From: Kenneth Chan <kenneth.t.chan@gmail.com>
To: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: laforge@gnumonks.org, Kenneth Chan <kenneth.t.chan@gmail.com>
Subject: [PATCH 2/9] replace ACPI prints with pr_*() macros
Date: Sat, 22 Aug 2020 02:14:26 +0800 [thread overview]
Message-ID: <20200821181433.17653-3-kenneth.t.chan@gmail.com> (raw)
In-Reply-To: <20200821181433.17653-1-kenneth.t.chan@gmail.com>
Replace ACPI prints with pr_*() macros for consistency with other platform
devices.
Clean up obsolete ACPI_HOTKEY_COMPONENT code.
Signed-off-by: Kenneth Chan <kenneth.t.chan@gmail.com>
---
drivers/platform/x86/panasonic-laptop.c | 47 ++++++++-----------------
1 file changed, 14 insertions(+), 33 deletions(-)
diff --git a/drivers/platform/x86/panasonic-laptop.c b/drivers/platform/x86/panasonic-laptop.c
index 21cdc2149a10..7170c36577bf 100644
--- a/drivers/platform/x86/panasonic-laptop.c
+++ b/drivers/platform/x86/panasonic-laptop.c
@@ -13,6 +13,7 @@
*
* ChangeLog:
* 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.96 merge Lucina's enhancement
* Jan.13, 2009 Martin Lucina <mato@kotelna.sk>
@@ -124,12 +125,6 @@
#include <linux/input/sparse-keymap.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_DESCRIPTION("ACPI HotKey driver for Panasonic Let's Note laptops");
MODULE_LICENSE("GPL");
@@ -255,8 +250,7 @@ static inline int acpi_pcc_get_sqty(struct acpi_device *device)
if (ACPI_SUCCESS(status))
return s;
else {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "evaluation error HKEY.SQTY\n"));
+ pr_err("evaluation error HKEY.SQTY\n");
return -EINVAL;
}
}
@@ -271,21 +265,19 @@ static int acpi_pcc_retrieve_biosdata(struct pcc_acpi *pcc)
status = acpi_evaluate_object(pcc->handle, METHOD_HKEY_SINF, NULL,
&buffer);
if (ACPI_FAILURE(status)) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "evaluation error HKEY.SINF\n"));
+ pr_err("evaluation error HKEY.SINF\n");
return 0;
}
hkey = buffer.pointer;
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;
goto end;
}
if (pcc->num_sifr < hkey->package.count) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "SQTY reports bad SINF length\n"));
+ pr_err("SQTY reports bad SINF length\n");
status = AE_ERROR;
goto end;
}
@@ -295,8 +287,7 @@ static int acpi_pcc_retrieve_biosdata(struct pcc_acpi *pcc)
if (likely(element->type == ACPI_TYPE_INTEGER)) {
pcc->sinf[i] = element->integer.value;
} else
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "Invalid HKEY.SINF data\n"));
+ pr_err("Invalid HKEY.SINF data\n");
}
pcc->sinf[hkey->package.count] = -1;
@@ -563,8 +554,7 @@ static void acpi_pcc_generate_keyinput(struct pcc_acpi *pcc)
rc = acpi_evaluate_integer(pcc->handle, METHOD_HKEY_QUERY,
NULL, &result);
if (ACPI_FAILURE(rc)) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "error getting hotkey status\n"));
+ pr_err("error getting hotkey status\n");
return;
}
@@ -579,8 +569,7 @@ static void acpi_pcc_generate_keyinput(struct pcc_acpi *pcc)
if (!sparse_keymap_report_event(hotk_input_dev,
result & 0xf, result & 0x80, false))
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "Unknown hotkey event: %d\n", result));
+ pr_err("Unknown hotkey event: 0x%04llx\n", result);
}
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)
error = sparse_keymap_setup(input_dev, panasonic_keymap, NULL);
if (error) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "Unable to setup input device keymap\n"));
+ pr_err("Unable to setup input device keymap\n");
goto err_free_dev;
}
error = input_register_device(input_dev);
if (error) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "Unable to register input device\n"));
+ pr_err("Unable to register input device\n");
goto err_free_dev;
}
@@ -693,9 +680,6 @@ static int acpi_pcc_hotkey_resume(struct device *dev)
if (!pcc)
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);
}
#endif
@@ -712,14 +696,13 @@ static int acpi_pcc_hotkey_add(struct acpi_device *device)
num_sifr = acpi_pcc_get_sqty(device);
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;
}
pcc = kzalloc(sizeof(struct pcc_acpi), GFP_KERNEL);
if (!pcc) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "Couldn't allocate mem for pcc"));
+ pr_err("Couldn't allocate mem for pcc");
return -ENOMEM;
}
@@ -738,15 +721,13 @@ static int acpi_pcc_hotkey_add(struct acpi_device *device)
result = acpi_pcc_init_input(pcc);
if (result) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "Error installing keyinput handler\n"));
+ pr_err("Error installing keyinput handler\n");
goto out_sinf;
}
if (!acpi_pcc_retrieve_biosdata(pcc)) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "Couldn't retrieve BIOS data\n"));
result = -EIO;
+ pr_err("Couldn't retrieve BIOS data\n");
goto out_input;
}
/* initialize backlight */
--
2.17.5
next prev parent reply other threads:[~2020-08-21 18:14 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-21 18:14 [PATCH 0/9] platform/x86: panasonic-laptop: add optical drive, brightness and battery charging threshold Kenneth Chan
2020-08-21 18:14 ` [PATCH 1/9] add support for optical driver power in Y and W series Kenneth Chan
2020-11-10 14:00 ` Hans de Goede
2020-08-21 18:14 ` Kenneth Chan [this message]
2020-08-21 18:14 ` [PATCH 3/9] split MODULE_AUTHOR() by one author per macro call Kenneth Chan
2020-08-21 18:14 ` [PATCH 4/9] fix naming of platform files for consistency with other modules Kenneth Chan
2020-08-21 18:14 ` [PATCH 5/9] fix sticky key init bug Kenneth Chan
2020-08-21 18:14 ` [PATCH 6/9] add write support to mute Kenneth Chan
2020-08-21 18:14 ` [PATCH 7/9] resolve hotkey double trigger bug Kenneth Chan
2022-06-12 9:05 ` [PATCH 0/2] fix panasonic-laptop hotkey regression stefan.seyfried
2022-06-12 9:05 ` [PATCH 1/2] platform/x86: panasonic-laptop: de-obfuscate button codes stefan.seyfried
2022-06-12 9:05 ` [PATCH 2/2] platform/x86: panasonic-laptop: allow to use all hotkeys stefan.seyfried
2022-06-15 10:53 ` Kenneth Chan
2022-06-15 11:21 ` Andy Shevchenko
2022-06-15 11:24 ` Andy Shevchenko
2022-06-15 17:10 ` Stefan Seyfried
2022-06-15 19:28 ` Hans de Goede
2022-06-16 18:38 ` Kenneth Chan
2022-06-16 19:03 ` Andy Shevchenko
2022-06-17 7:51 ` Kenneth Chan
2022-06-17 11:07 ` Hans de Goede
2022-06-17 13:07 ` Stefan Seyfried
2022-06-20 15:08 ` Hans de Goede
2022-06-20 18:10 ` Stefan Seyfried
2022-06-21 9:26 ` Hans de Goede
2022-06-21 10:23 ` Stefan Seyfried
2022-06-21 17:54 ` Stefan Seyfried
2022-06-22 10:57 ` Hans de Goede
2022-06-20 15:21 ` Kenneth Chan
2022-06-21 9:34 ` Hans de Goede
2022-06-24 5:14 ` Kenneth Chan
2022-06-24 9:24 ` Hans de Goede
2020-08-21 18:14 ` [PATCH 8/9] add support for battery charging threshold (eco mode) Kenneth Chan
2020-08-21 18:14 ` [PATCH 9/9] add platform devices for firmware brightness registers Kenneth Chan
2020-08-22 7:29 ` [PATCH 0/9] platform/x86: panasonic-laptop: add optical drive, brightness and battery charging threshold Harald Welte
2020-08-22 8:20 ` Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200821181433.17653-3-kenneth.t.chan@gmail.com \
--to=kenneth.t.chan@gmail.com \
--cc=laforge@gnumonks.org \
--cc=linux-kernel@vger.kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox