From edf2d7780da5d96a168da7e31b36fb11620106d3 Mon Sep 17 00:00:00 2001 From: Adam Lee Date: Sat, 8 Jun 2013 16:51:15 +0800 Subject: thinkpad_acpi: return -NODEV while operating uninitialized LEDs Not all 0-15 LEDs are available for all models, sometimes it's even not safe. This patch return -NODEV while operating uninitialized LEDs. Signed-off-by: Adam Lee Acked-by: Henrique de Moraes Holschuh Signed-off-by: Matthew Garrett --- drivers/platform/x86/thinkpad_acpi.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index be67e5e28d18..359c87b3b1b2 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -369,7 +369,7 @@ struct tpacpi_led_classdev { struct led_classdev led_classdev; struct work_struct work; enum led_status_t new_state; - unsigned int led; + int led; }; /* brightness level capabilities */ @@ -5313,6 +5313,8 @@ static int __init led_init(struct ibm_init_struct *iibm) ARRAY_SIZE(led_useful_qtable)); for (i = 0; i < TPACPI_LED_NUMLEDS; i++) { + tpacpi_leds[i].led = -1; + if (!tpacpi_is_led_restricted(i) && test_bit(i, &useful_leds)) { rc = tpacpi_init_led(i); @@ -5370,9 +5372,13 @@ static int led_write(char *buf) return -ENODEV; while ((cmd = next_cmd(&buf))) { - if (sscanf(cmd, "%d", &led) != 1 || led < 0 || led > 15) + if (sscanf(cmd, "%d", &led) != 1) return -EINVAL; + if (led < 0 || led > (TPACPI_LED_NUMLEDS - 1) || + tpacpi_leds[led].led < 0) + return -ENODEV; + if (strstr(cmd, "off")) { s = TPACPI_LED_OFF; } else if (strstr(cmd, "on")) { -- cgit v1.2.3 From fcb44e12d38a18f99d22ff66e739bb2f2ac762f0 Mon Sep 17 00:00:00 2001 From: Adam Lee Date: Fri, 7 Jun 2013 16:20:08 +0800 Subject: thinkpad_acpi: add the ability setting TPACPI_LED_NONE by quirk Some new Lenovo or ThinkPad laptops don't have EC controllable LEDs, their LED quirks are 0. This patch set led_supported=TPACPI_LED_NONE when quirk equals 0. Signed-off-by: Adam Lee Acked-by: Henrique de Moraes Holschuh Signed-off-by: Matthew Garrett --- drivers/platform/x86/thinkpad_acpi.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index 359c87b3b1b2..03ca6c139f1a 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -5296,6 +5296,16 @@ static int __init led_init(struct ibm_init_struct *iibm) led_supported = led_init_detect_mode(); + if (led_supported != TPACPI_LED_NONE) { + useful_leds = tpacpi_check_quirks(led_useful_qtable, + ARRAY_SIZE(led_useful_qtable)); + + if (!useful_leds) { + led_handle = NULL; + led_supported = TPACPI_LED_NONE; + } + } + vdbg_printk(TPACPI_DBG_INIT, "LED commands are %s, mode %d\n", str_supported(led_supported), led_supported); @@ -5309,9 +5319,6 @@ static int __init led_init(struct ibm_init_struct *iibm) return -ENOMEM; } - useful_leds = tpacpi_check_quirks(led_useful_qtable, - ARRAY_SIZE(led_useful_qtable)); - for (i = 0; i < TPACPI_LED_NUMLEDS; i++) { tpacpi_leds[i].led = -1; -- cgit v1.2.3 From aa3b88a3a4b75c4dd17e3091280cd94538489147 Mon Sep 17 00:00:00 2001 From: Frederick van der Wyck Date: Mon, 8 Jul 2013 22:34:56 +0100 Subject: platform samsung-q10: use ACPI instead of direct EC calls This patch changes the Samsung Q10 backlight driver to use ACPI methods (the same ones as triggered by the brightness up/down function keys) instead of direct EC calls. The advantage is that the brightness setting is not lost on shutdown. Signed-off-by: Frederick van der Wyck Signed-off-by: Matthew Garrett --- drivers/platform/x86/Kconfig | 2 +- drivers/platform/x86/samsung-q10.c | 65 ++++++++++++-------------------------- 2 files changed, 22 insertions(+), 45 deletions(-) diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig index 36a9e6023395..e5b17b1c8398 100644 --- a/drivers/platform/x86/Kconfig +++ b/drivers/platform/x86/Kconfig @@ -764,7 +764,7 @@ config INTEL_OAKTRAIL config SAMSUNG_Q10 tristate "Samsung Q10 Extras" - depends on SERIO_I8042 + depends on ACPI select BACKLIGHT_CLASS_DEVICE ---help--- This driver provides support for backlight control on Samsung Q10 diff --git a/drivers/platform/x86/samsung-q10.c b/drivers/platform/x86/samsung-q10.c index 1a90b62a71c6..9d6609d0d90a 100644 --- a/drivers/platform/x86/samsung-q10.c +++ b/drivers/platform/x86/samsung-q10.c @@ -14,16 +14,12 @@ #include #include #include -#include #include +#include -#define SAMSUNGQ10_BL_MAX_INTENSITY 255 -#define SAMSUNGQ10_BL_DEFAULT_INTENSITY 185 +#define SAMSUNGQ10_BL_MAX_INTENSITY 7 -#define SAMSUNGQ10_BL_8042_CMD 0xbe -#define SAMSUNGQ10_BL_8042_DATA { 0x89, 0x91 } - -static int samsungq10_bl_brightness; +static acpi_handle ec_handle; static bool force; module_param(force, bool, 0); @@ -33,21 +29,26 @@ MODULE_PARM_DESC(force, static int samsungq10_bl_set_intensity(struct backlight_device *bd) { - int brightness = bd->props.brightness; - unsigned char c[3] = SAMSUNGQ10_BL_8042_DATA; + acpi_status status; + int i; - c[2] = (unsigned char)brightness; - i8042_lock_chip(); - i8042_command(c, (0x30 << 8) | SAMSUNGQ10_BL_8042_CMD); - i8042_unlock_chip(); - samsungq10_bl_brightness = brightness; + for (i = 0; i < SAMSUNGQ10_BL_MAX_INTENSITY; i++) { + status = acpi_evaluate_object(ec_handle, "_Q63", NULL, NULL); + if (ACPI_FAILURE(status)) + return -EIO; + } + for (i = 0; i < bd->props.brightness; i++) { + status = acpi_evaluate_object(ec_handle, "_Q64", NULL, NULL); + if (ACPI_FAILURE(status)) + return -EIO; + } return 0; } static int samsungq10_bl_get_intensity(struct backlight_device *bd) { - return samsungq10_bl_brightness; + return bd->props.brightness; } static const struct backlight_ops samsungq10_bl_ops = { @@ -55,28 +56,6 @@ static const struct backlight_ops samsungq10_bl_ops = { .update_status = samsungq10_bl_set_intensity, }; -#ifdef CONFIG_PM_SLEEP -static int samsungq10_suspend(struct device *dev) -{ - return 0; -} - -static int samsungq10_resume(struct device *dev) -{ - - struct backlight_device *bd = dev_get_drvdata(dev); - - samsungq10_bl_set_intensity(bd); - return 0; -} -#else -#define samsungq10_suspend NULL -#define samsungq10_resume NULL -#endif - -static SIMPLE_DEV_PM_OPS(samsungq10_pm_ops, - samsungq10_suspend, samsungq10_resume); - static int samsungq10_probe(struct platform_device *pdev) { @@ -93,9 +72,6 @@ static int samsungq10_probe(struct platform_device *pdev) platform_set_drvdata(pdev, bd); - bd->props.brightness = SAMSUNGQ10_BL_DEFAULT_INTENSITY; - samsungq10_bl_set_intensity(bd); - return 0; } @@ -104,9 +80,6 @@ static int samsungq10_remove(struct platform_device *pdev) struct backlight_device *bd = platform_get_drvdata(pdev); - bd->props.brightness = SAMSUNGQ10_BL_DEFAULT_INTENSITY; - samsungq10_bl_set_intensity(bd); - backlight_device_unregister(bd); return 0; @@ -116,7 +89,6 @@ static struct platform_driver samsungq10_driver = { .driver = { .name = KBUILD_MODNAME, .owner = THIS_MODULE, - .pm = &samsungq10_pm_ops, }, .probe = samsungq10_probe, .remove = samsungq10_remove, @@ -172,6 +144,11 @@ static int __init samsungq10_init(void) if (!force && !dmi_check_system(samsungq10_dmi_table)) return -ENODEV; + ec_handle = ec_get_handle(); + + if (!ec_handle) + return -ENODEV; + samsungq10_device = platform_create_bundle(&samsungq10_driver, samsungq10_probe, NULL, 0, NULL, 0); -- cgit v1.2.3 From 4d2635367bbcfaa168194ced0899717eac2ef4bd Mon Sep 17 00:00:00 2001 From: Wei Yongjun Date: Wed, 17 Jul 2013 09:52:28 +0800 Subject: x86: smartconnect: use module_acpi_driver to simplify the code module_acpi_driver() makes the code simpler by eliminating boilerplate code. Signed-off-by: Wei Yongjun Signed-off-by: Matthew Garrett --- drivers/platform/x86/intel-smartconnect.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/platform/x86/intel-smartconnect.c b/drivers/platform/x86/intel-smartconnect.c index f74e93d096bc..52259dcabecb 100644 --- a/drivers/platform/x86/intel-smartconnect.c +++ b/drivers/platform/x86/intel-smartconnect.c @@ -74,17 +74,6 @@ static struct acpi_driver smartconnect_driver = { }, }; -static int smartconnect_init(void) -{ - return acpi_bus_register_driver(&smartconnect_driver); -} - -static void smartconnect_exit(void) -{ - acpi_bus_unregister_driver(&smartconnect_driver); -} - -module_init(smartconnect_init); -module_exit(smartconnect_exit); +module_acpi_driver(smartconnect_driver); MODULE_DEVICE_TABLE(acpi, smartconnect_ids); -- cgit v1.2.3 From 2ff1af707b09cbf29247c9224fb3494305e82aef Mon Sep 17 00:00:00 2001 From: Wei Yongjun Date: Wed, 17 Jul 2013 09:55:25 +0800 Subject: x86: irst: use module_acpi_driver to simplify the code module_acpi_driver() makes the code simpler by eliminating boilerplate code. Signed-off-by: Wei Yongjun Signed-off-by: Matthew Garrett --- drivers/platform/x86/intel-rst.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/platform/x86/intel-rst.c b/drivers/platform/x86/intel-rst.c index 9385afd9b558..41b740cb28bc 100644 --- a/drivers/platform/x86/intel-rst.c +++ b/drivers/platform/x86/intel-rst.c @@ -193,17 +193,6 @@ static struct acpi_driver irst_driver = { }, }; -static int irst_init(void) -{ - return acpi_bus_register_driver(&irst_driver); -} - -static void irst_exit(void) -{ - acpi_bus_unregister_driver(&irst_driver); -} - -module_init(irst_init); -module_exit(irst_exit); +module_acpi_driver(irst_driver); MODULE_DEVICE_TABLE(acpi, irst_ids); -- cgit v1.2.3 From 0db7fd969e567dc0e4d2a7138896d6860f9614d5 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Fri, 19 Jul 2013 16:18:47 +0900 Subject: platform: replace strict_strto*() with kstrto*() The usage of strict_strtoul() and strict_strtol() is not preferred, because strict_strtoul() and strict_strtol() are obsolete. Thus, kstrtoul() and kstrtol() should be used. Signed-off-by: Jingoo Han Signed-off-by: Matthew Garrett --- drivers/platform/x86/classmate-laptop.c | 2 +- drivers/platform/x86/compal-laptop.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/platform/x86/classmate-laptop.c b/drivers/platform/x86/classmate-laptop.c index 36e5e6c13db4..6dfa8d3b4eec 100644 --- a/drivers/platform/x86/classmate-laptop.c +++ b/drivers/platform/x86/classmate-laptop.c @@ -590,7 +590,7 @@ static ssize_t cmpc_accel_sensitivity_store(struct device *dev, inputdev = dev_get_drvdata(&acpi->dev); accel = dev_get_drvdata(&inputdev->dev); - r = strict_strtoul(buf, 0, &sensitivity); + r = kstrtoul(buf, 0, &sensitivity); if (r) return r; diff --git a/drivers/platform/x86/compal-laptop.c b/drivers/platform/x86/compal-laptop.c index 475cc5242511..52f89fc1325f 100644 --- a/drivers/platform/x86/compal-laptop.c +++ b/drivers/platform/x86/compal-laptop.c @@ -425,7 +425,8 @@ static ssize_t pwm_enable_store(struct device *dev, struct compal_data *data = dev_get_drvdata(dev); long val; int err; - err = strict_strtol(buf, 10, &val); + + err = kstrtol(buf, 10, &val); if (err) return err; if (val < 0) @@ -463,7 +464,8 @@ static ssize_t pwm_store(struct device *dev, struct device_attribute *attr, struct compal_data *data = dev_get_drvdata(dev); long val; int err; - err = strict_strtol(buf, 10, &val); + + err = kstrtol(buf, 10, &val); if (err) return err; if (val < 0 || val > 255) -- cgit v1.2.3 From 5b5c2b3c9b0585350d2da62bc4b990d9bf836d94 Mon Sep 17 00:00:00 2001 From: Kirill Tkhai Date: Mon, 29 Jul 2013 17:34:37 +0400 Subject: hp_wmi: Fix unregister order in hp_wmi_rfkill_setup() Register order is: wifi bluetooth wwan gps So unregister order must be: gps wwan bluetiith wifi But currently gps and wwan are swapped. Fix that. Also fix goto links. Signed-off-by: Kirill Tkhai CC: Matthew Garrett Signed-off-by: Matthew Garrett --- drivers/platform/x86/hp-wmi.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c index d6970f47ae72..1c86fa0857c8 100644 --- a/drivers/platform/x86/hp-wmi.c +++ b/drivers/platform/x86/hp-wmi.c @@ -725,7 +725,7 @@ static int hp_wmi_rfkill_setup(struct platform_device *device) (void *) HPWMI_WWAN); if (!wwan_rfkill) { err = -ENOMEM; - goto register_gps_error; + goto register_bluetooth_error; } rfkill_init_sw_state(wwan_rfkill, hp_wmi_get_sw_state(HPWMI_WWAN)); @@ -733,7 +733,7 @@ static int hp_wmi_rfkill_setup(struct platform_device *device) hp_wmi_get_hw_state(HPWMI_WWAN)); err = rfkill_register(wwan_rfkill); if (err) - goto register_wwan_err; + goto register_wwan_error; } if (wireless & 0x8) { @@ -743,7 +743,7 @@ static int hp_wmi_rfkill_setup(struct platform_device *device) (void *) HPWMI_GPS); if (!gps_rfkill) { err = -ENOMEM; - goto register_bluetooth_error; + goto register_wwan_error; } rfkill_init_sw_state(gps_rfkill, hp_wmi_get_sw_state(HPWMI_GPS)); @@ -755,16 +755,16 @@ static int hp_wmi_rfkill_setup(struct platform_device *device) } return 0; -register_wwan_err: - rfkill_destroy(wwan_rfkill); - wwan_rfkill = NULL; - if (gps_rfkill) - rfkill_unregister(gps_rfkill); register_gps_error: rfkill_destroy(gps_rfkill); gps_rfkill = NULL; if (bluetooth_rfkill) rfkill_unregister(bluetooth_rfkill); +register_wwan_error: + rfkill_destroy(wwan_rfkill); + wwan_rfkill = NULL; + if (gps_rfkill) + rfkill_unregister(gps_rfkill); register_bluetooth_error: rfkill_destroy(bluetooth_rfkill); bluetooth_rfkill = NULL; -- cgit v1.2.3 From 0a018a68d3bfbd6288f3b646edb0dd0720209790 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Wed, 14 Aug 2013 12:02:30 +0300 Subject: wmi: parse_wdg() should return kernel error codes The current code returns a mix of acpi_status and kernel error codes. It should just return kernel error codes. There are already error paths in this function which return -ENOMEM and that's what the caller expects. Signed-off-by: Dan Carpenter Signed-off-by: Matthew Garrett --- drivers/platform/x86/wmi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c index 6e02c953d888..601ea9512242 100644 --- a/drivers/platform/x86/wmi.c +++ b/drivers/platform/x86/wmi.c @@ -780,7 +780,7 @@ static bool guid_already_parsed(const char *guid_string) /* * Parse the _WDG method for the GUID data blocks */ -static acpi_status parse_wdg(acpi_handle handle) +static int parse_wdg(acpi_handle handle) { struct acpi_buffer out = {ACPI_ALLOCATE_BUFFER, NULL}; union acpi_object *obj; @@ -812,7 +812,7 @@ static acpi_status parse_wdg(acpi_handle handle) wblock = kzalloc(sizeof(struct wmi_block), GFP_KERNEL); if (!wblock) - return AE_NO_MEMORY; + return -ENOMEM; wblock->handle = handle; wblock->gblock = gblock[i]; -- cgit v1.2.3 From 0be18a8e1133fc2cf668c90360fcd1a767f64faa Mon Sep 17 00:00:00 2001 From: Jerome Meinke Date: Mon, 19 Aug 2013 17:15:45 +0200 Subject: amilo-rfkill: Enable using amilo-rfkill with the FSC Amilo L1310. This change extends the amilo_rfkill_id_table[] with the DMI_BOARD_NAME information of the Amilo L1310, so that the wifi device can be switched on. Signed-off-by: Jerome Meinke Signed-off-by: Matthew Garrett --- drivers/platform/x86/amilo-rfkill.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/platform/x86/amilo-rfkill.c b/drivers/platform/x86/amilo-rfkill.c index 6296f078b7bc..da36b5e824d4 100644 --- a/drivers/platform/x86/amilo-rfkill.c +++ b/drivers/platform/x86/amilo-rfkill.c @@ -82,6 +82,13 @@ static const struct dmi_system_id amilo_rfkill_id_table[] = { }, .driver_data = (void *)&amilo_a1655_rfkill_ops }, + { + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), + DMI_MATCH(DMI_BOARD_NAME, "AMILO L1310"), + }, + .driver_data = (void *)&amilo_a1655_rfkill_ops + }, { .matches = { DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), -- cgit v1.2.3 From 18a0393543fa3b04278cce235d3d76a13c877b94 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Thu, 22 Aug 2013 11:04:28 +0900 Subject: platform: x86: remove unnecessary platform_set_drvdata() The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han Signed-off-by: Matthew Garrett --- drivers/platform/x86/compal-laptop.c | 1 - drivers/platform/x86/intel_mid_powerbtn.c | 1 - drivers/platform/x86/intel_mid_thermal.c | 1 - 3 files changed, 3 deletions(-) diff --git a/drivers/platform/x86/compal-laptop.c b/drivers/platform/x86/compal-laptop.c index 52f89fc1325f..eaa78edb1f4e 100644 --- a/drivers/platform/x86/compal-laptop.c +++ b/drivers/platform/x86/compal-laptop.c @@ -1083,7 +1083,6 @@ static int compal_remove(struct platform_device *pdev) hwmon_device_unregister(data->hwmon_dev); power_supply_unregister(&data->psy); - platform_set_drvdata(pdev, NULL); kfree(data); sysfs_remove_group(&pdev->dev.kobj, &compal_attribute_group); diff --git a/drivers/platform/x86/intel_mid_powerbtn.c b/drivers/platform/x86/intel_mid_powerbtn.c index f59683aa13d5..6b18aba82cfa 100644 --- a/drivers/platform/x86/intel_mid_powerbtn.c +++ b/drivers/platform/x86/intel_mid_powerbtn.c @@ -128,7 +128,6 @@ static int mfld_pb_remove(struct platform_device *pdev) free_irq(irq, input); input_unregister_device(input); - platform_set_drvdata(pdev, NULL); return 0; } diff --git a/drivers/platform/x86/intel_mid_thermal.c b/drivers/platform/x86/intel_mid_thermal.c index 81c491e74b34..93fab8b70ce1 100644 --- a/drivers/platform/x86/intel_mid_thermal.c +++ b/drivers/platform/x86/intel_mid_thermal.c @@ -542,7 +542,6 @@ static int mid_thermal_remove(struct platform_device *pdev) } kfree(pinfo); - platform_set_drvdata(pdev, NULL); /* Stop the ADC */ return configure_adc(0); -- cgit v1.2.3 From 5ff67df324e8440405e620bc05ea0600f07a8a27 Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Thu, 22 Aug 2013 09:06:23 -0700 Subject: samsung-laptop: fix config build error Fix build failure when ACPI_VIDEO=m and SAMSUNG_LAPTOP=y. The patch prevents that specific config combination. drivers/built-in.o: In function `samsung_init': samsung-laptop.c:(.init.text+0x128ff): undefined reference to `acpi_video_unregister' Signed-off-by: Randy Dunlap Reported-by: Randy Dunlap Reported-by: Fengguang Wu Cc: Corentin Chary build testing: ACPI_VIDEO=m, SAMSUNG_LAPTOP=m: OK ACPI_VIDEO=y, SAMSUNG_LAPTOP=m: OK ACPI_VIDEO=y, SAMSUNG_LAPTOP=y: OK ACPI=n, SAMSUNG_LAPTOP=y: OK ACPI=n, SAMSUNG_LAPTOP=m: OK Signed-off-by: Matthew Garrett --- drivers/platform/x86/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig index e5b17b1c8398..96d6b2eef4f2 100644 --- a/drivers/platform/x86/Kconfig +++ b/drivers/platform/x86/Kconfig @@ -732,6 +732,7 @@ config SAMSUNG_LAPTOP tristate "Samsung Laptop driver" depends on X86 depends on RFKILL || RFKILL = n + depends on ACPI_VIDEO || ACPI_VIDEO = n depends on BACKLIGHT_CLASS_DEVICE select LEDS_CLASS select NEW_LEDS -- cgit v1.2.3 From 5c07eae979dfb596141c6885e5f5ecf1cd22cad3 Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Wed, 28 Aug 2013 14:48:41 +0300 Subject: platform/x86: panasonic-laptop: reuse module_acpi_driver There is a macro to register and unregister modules in simple cases, Let's use it and clean up the driver. Signed-off-by: Andy Shevchenko Signed-off-by: Matthew Garrett --- drivers/platform/x86/panasonic-laptop.c | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/drivers/platform/x86/panasonic-laptop.c b/drivers/platform/x86/panasonic-laptop.c index 984253da365d..10d12b221601 100644 --- a/drivers/platform/x86/panasonic-laptop.c +++ b/drivers/platform/x86/panasonic-laptop.c @@ -643,23 +643,6 @@ out_hotkey: return result; } -static int __init acpi_pcc_init(void) -{ - int result = 0; - - if (acpi_disabled) - return -ENODEV; - - result = acpi_bus_register_driver(&acpi_pcc_driver); - if (result < 0) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "Error registering hotkey driver\n")); - return -ENODEV; - } - - return 0; -} - static int acpi_pcc_hotkey_remove(struct acpi_device *device) { struct pcc_acpi *pcc = acpi_driver_data(device); @@ -679,10 +662,4 @@ static int acpi_pcc_hotkey_remove(struct acpi_device *device) return 0; } -static void __exit acpi_pcc_exit(void) -{ - acpi_bus_unregister_driver(&acpi_pcc_driver); -} - -module_init(acpi_pcc_init); -module_exit(acpi_pcc_exit); +module_acpi_driver(acpi_pcc_driver); -- cgit v1.2.3