From 2478907572fdd7cf285720f16513e956b3528854 Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Wed, 24 Feb 2021 19:41:44 +0100 Subject: platform: x86: ACPI: Get rid of ACPICA message printing A few x86 platform drivers use ACPI_DEBUG_PRINT() or ACPI_EXCEPTION() for printing messages, but that is questionable, because those macros belong to ACPICA and they should not be used elsewhere. In addition, ACPI_DEBUG_PRINT() requires special enabling to allow it to actually print the message, which is a nuisance, and the _COMPONENT symbol generally needed for that is not defined in any of the files in question. For this reason, replace the ACPI_DEBUG_PRINT() in lg-laptop.c with pr_debug() and the one in xo15-ebook.c with acpi_handle_debug() (with the additional benefit that the source object can be identified more easily after this change). Also drop the ACPI_MODULE_NAME() definitions that are only used by the ACPICA message printing macros from those files and from wmi.c and surfacepro3_button.c (while at it). Signed-off-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/2074665.VPHYfYaQb6@kreacher [hdegoede@redhat.com: Drop acer-wmi.c chunk, a similar patch was already merged] Signed-off-by: Hans de Goede --- drivers/platform/x86/wmi.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/platform/x86/wmi.c') diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c index c669676ea8e8..f30d791be95b 100644 --- a/drivers/platform/x86/wmi.c +++ b/drivers/platform/x86/wmi.c @@ -32,7 +32,6 @@ #include #include -ACPI_MODULE_NAME("wmi"); MODULE_AUTHOR("Carlos Corbacho"); MODULE_DESCRIPTION("ACPI-WMI Mapping Driver"); MODULE_LICENSE("GPL"); -- cgit From 2b329f5694aec86107931584413c7d2ebc6b548d Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Mon, 1 Mar 2021 17:04:04 +0100 Subject: platform/x86: wmi: Make remove callback return void MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The driver core ignores the return value of struct bus_type::remove() (and so wmi_dev_remove()) because there is only little that can be done. To simplify the quest to make this function return void, let struct wmi_driver::remove() return void, too. All implementers of this callback return 0 already and this way it should be obvious to driver authors that returning an error code is a bad idea. Signed-off-by: Uwe Kleine-König Reviewed-by: Pali Rohár Link: https://lore.kernel.org/r/20210301160404.1677064-1-u.kleine-koenig@pengutronix.de Signed-off-by: Hans de Goede --- drivers/platform/x86/wmi.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'drivers/platform/x86/wmi.c') diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c index f30d791be95b..62e0d56a3332 100644 --- a/drivers/platform/x86/wmi.c +++ b/drivers/platform/x86/wmi.c @@ -985,7 +985,6 @@ static int wmi_dev_remove(struct device *dev) struct wmi_block *wblock = dev_to_wblock(dev); struct wmi_driver *wdriver = container_of(dev->driver, struct wmi_driver, driver); - int ret = 0; if (wdriver->filter_callback) { misc_deregister(&wblock->char_dev); @@ -994,12 +993,12 @@ static int wmi_dev_remove(struct device *dev) } if (wdriver->remove) - ret = wdriver->remove(dev_to_wdev(dev)); + wdriver->remove(dev_to_wdev(dev)); if (ACPI_FAILURE(wmi_method_enable(wblock, 0))) dev_warn(dev, "failed to disable device\n"); - return ret; + return 0; } static struct class wmi_bus_class = { -- cgit