]> git.karo-electronics.de Git - linux-beck.git/blobdiff - drivers/platform/x86/thinkpad_acpi.c
slab: Only define slab_error for DEBUG
[linux-beck.git] / drivers / platform / x86 / thinkpad_acpi.c
index 8b5610d884186b63b693b6b7aee2ceb705fc47ee..e7f73287636cd9bdabb3f0b32104d4b7257e5e69 100644 (file)
@@ -277,7 +277,7 @@ struct ibm_struct {
        int (*write) (char *);
        void (*exit) (void);
        void (*resume) (void);
-       void (*suspend) (pm_message_t state);
+       void (*suspend) (void);
        void (*shutdown) (void);
 
        struct list_head all_drivers;
@@ -922,8 +922,7 @@ static struct input_dev *tpacpi_inputdev;
 static struct mutex tpacpi_inputdev_send_mutex;
 static LIST_HEAD(tpacpi_all_drivers);
 
-static int tpacpi_suspend_handler(struct platform_device *pdev,
-                                 pm_message_t state)
+static int tpacpi_suspend_handler(struct device *dev)
 {
        struct ibm_struct *ibm, *itmp;
 
@@ -931,13 +930,13 @@ static int tpacpi_suspend_handler(struct platform_device *pdev,
                                 &tpacpi_all_drivers,
                                 all_drivers) {
                if (ibm->suspend)
-                       (ibm->suspend)(state);
+                       (ibm->suspend)();
        }
 
        return 0;
 }
 
-static int tpacpi_resume_handler(struct platform_device *pdev)
+static int tpacpi_resume_handler(struct device *dev)
 {
        struct ibm_struct *ibm, *itmp;
 
@@ -951,6 +950,9 @@ static int tpacpi_resume_handler(struct platform_device *pdev)
        return 0;
 }
 
+static SIMPLE_DEV_PM_OPS(tpacpi_pm,
+                        tpacpi_suspend_handler, tpacpi_resume_handler);
+
 static void tpacpi_shutdown_handler(struct platform_device *pdev)
 {
        struct ibm_struct *ibm, *itmp;
@@ -967,9 +969,8 @@ static struct platform_driver tpacpi_pdriver = {
        .driver = {
                .name = TPACPI_DRVR_NAME,
                .owner = THIS_MODULE,
+               .pm = &tpacpi_pm,
        },
-       .suspend = tpacpi_suspend_handler,
-       .resume = tpacpi_resume_handler,
        .shutdown = tpacpi_shutdown_handler,
 };
 
@@ -3014,8 +3015,6 @@ static void hotkey_exit(void)
        if (hotkey_dev_attributes)
                delete_attr_set(hotkey_dev_attributes, &tpacpi_pdev->dev.kobj);
 
-       kfree(hotkey_keycode_map);
-
        dbg_printk(TPACPI_DBG_EXIT | TPACPI_DBG_HKEY,
                   "restoring original HKEY status and mask\n");
        /* yes, there is a bitwise or below, we want the
@@ -3758,7 +3757,7 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
        }
 }
 
-static void hotkey_suspend(pm_message_t state)
+static void hotkey_suspend(void)
 {
        /* Do these on suspend, we get the events on early resume! */
        hotkey_wakeup_reason = TP_ACPI_WAKEUP_NONE;
@@ -5216,6 +5215,7 @@ static void led_exit(void)
                        led_classdev_unregister(&tpacpi_leds[i].led_classdev);
        }
 
+       flush_workqueue(tpacpi_wq);
        kfree(tpacpi_leds);
 }
 
@@ -6329,7 +6329,7 @@ static int __init brightness_init(struct ibm_init_struct *iibm)
        return 0;
 }
 
-static void brightness_suspend(pm_message_t state)
+static void brightness_suspend(void)
 {
        tpacpi_brightness_checkpoint_nvram();
 }
@@ -6748,7 +6748,7 @@ static struct snd_kcontrol_new volume_alsa_control_mute __devinitdata = {
        .get = volume_alsa_mute_get,
 };
 
-static void volume_suspend(pm_message_t state)
+static void volume_suspend(void)
 {
        tpacpi_volume_checkpoint_nvram();
 }
@@ -8107,7 +8107,7 @@ static void fan_exit(void)
        flush_workqueue(tpacpi_wq);
 }
 
-static void fan_suspend(pm_message_t state)
+static void fan_suspend(void)
 {
        int rc;
 
@@ -8935,6 +8935,7 @@ static void thinkpad_acpi_module_exit(void)
                        input_unregister_device(tpacpi_inputdev);
                else
                        input_free_device(tpacpi_inputdev);
+               kfree(hotkey_keycode_map);
        }
 
        if (tpacpi_hwmon)
@@ -8968,6 +8969,7 @@ static void thinkpad_acpi_module_exit(void)
        kfree(thinkpad_id.bios_version_str);
        kfree(thinkpad_id.ec_version_str);
        kfree(thinkpad_id.model_str);
+       kfree(thinkpad_id.nummodel_str);
 }