lis3: change exported function to use passed parameter
authorÉric Piel <eric.piel@tremplin-utc.net>
Tue, 1 Nov 2011 00:11:02 +0000 (17:11 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 1 Nov 2011 00:30:52 +0000 (17:30 -0700)
Change exported functions to use the device given as parameter
instead of the global one.

Signed-off-by: Ilkka Koskinen <ilkka.koskinen@nokia.com>
Signed-off-by: Éric Piel <eric.piel@tremplin-utc.net>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Witold Pilat <witold.pilat@gmail.com>
Cc: Lyall Pearce <lyall.pearce@hp.com>
Cc: Malte Starostik <m-starostik@versanet.de>
Cc: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Cc: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/misc/lis3lv02d/lis3lv02d.c
drivers/misc/lis3lv02d/lis3lv02d.h
drivers/misc/lis3lv02d/lis3lv02d_i2c.c
drivers/misc/lis3lv02d/lis3lv02d_spi.c
drivers/platform/x86/hp_accel.c

index eaef96bbbdfd85d08af7750575061e4027e74f8c..57249a01e6e7153dfe3c2a512a44a81763040896 100644 (file)
@@ -631,7 +631,7 @@ static struct miscdevice lis3lv02d_misc_device = {
        .fops    = &lis3lv02d_misc_fops,
 };
 
-int lis3lv02d_joystick_enable(void)
+int lis3lv02d_joystick_enable(struct lis3lv02d *lis3)
 {
        struct input_dev *input_dev;
        int err;
@@ -689,7 +689,7 @@ int lis3lv02d_joystick_enable(void)
 }
 EXPORT_SYMBOL_GPL(lis3lv02d_joystick_enable);
 
-void lis3lv02d_joystick_disable(void)
+void lis3lv02d_joystick_disable(struct lis3lv02d *lis3)
 {
        if (lis3_dev.irq)
                free_irq(lis3_dev.irq, &lis3_dev);
@@ -959,7 +959,7 @@ int lis3lv02d_init_device(struct lis3lv02d *lis3)
                pm_runtime_enable(lis3->pm_dev);
        }
 
-       if (lis3lv02d_joystick_enable())
+       if (lis3lv02d_joystick_enable(lis3))
                pr_err("joystick initialization failed\n");
 
        /* passing in platform specific data is purely optional and only
index 57c64bbcf5f7593f372a42e3094a67be70649e9c..b94e72374810bba97243bd262582435ed0da7b56 100644 (file)
@@ -282,8 +282,8 @@ struct lis3lv02d {
 };
 
 int lis3lv02d_init_device(struct lis3lv02d *lis3);
-int lis3lv02d_joystick_enable(void);
-void lis3lv02d_joystick_disable(void);
+int lis3lv02d_joystick_enable(struct lis3lv02d *lis3);
+void lis3lv02d_joystick_disable(struct lis3lv02d *lis3);
 void lis3lv02d_poweroff(struct lis3lv02d *lis3);
 int lis3lv02d_poweron(struct lis3lv02d *lis3);
 int lis3lv02d_remove_fs(struct lis3lv02d *lis3);
index ea9159c65b58d84f562f6eda2ddf1663b19a5597..6cdc38f6a9a83f671d6030f23aef59911a84568d 100644 (file)
@@ -182,7 +182,7 @@ static int __devexit lis3lv02d_i2c_remove(struct i2c_client *client)
        if (pdata && pdata->release_resources)
                pdata->release_resources();
 
-       lis3lv02d_joystick_disable();
+       lis3lv02d_joystick_disable(lis3);
        lis3lv02d_remove_fs(&lis3_dev);
 
        if (lis3_dev.reg_ctrl)
index c1f8a8fbf6943983a8e8a34b47e049cfc5111ef0..b2c1be12d16fb5625190b21e3bed774cc924d3a2 100644 (file)
@@ -83,7 +83,7 @@ static int __devinit lis302dl_spi_probe(struct spi_device *spi)
 static int __devexit lis302dl_spi_remove(struct spi_device *spi)
 {
        struct lis3lv02d *lis3 = spi_get_drvdata(spi);
-       lis3lv02d_joystick_disable();
+       lis3lv02d_joystick_disable(lis3);
        lis3lv02d_poweroff(lis3);
 
        return lis3lv02d_remove_fs(&lis3_dev);
index 89c5cb586187a818128e01080af5c1deab3219f3..f93a47b7136a1cefdd953b3df7cceb98107d616c 100644 (file)
@@ -323,7 +323,7 @@ static int lis3lv02d_add(struct acpi_device *device)
        INIT_WORK(&hpled_led.work, delayed_set_status_worker);
        ret = led_classdev_register(NULL, &hpled_led.led_classdev);
        if (ret) {
-               lis3lv02d_joystick_disable();
+               lis3lv02d_joystick_disable(&lis3_dev);
                lis3lv02d_poweroff(&lis3_dev);
                flush_work(&hpled_led.work);
                return ret;
@@ -337,7 +337,7 @@ static int lis3lv02d_remove(struct acpi_device *device, int type)
        if (!device)
                return -EINVAL;
 
-       lis3lv02d_joystick_disable();
+       lis3lv02d_joystick_disable(&lis3_dev);
        lis3lv02d_poweroff(&lis3_dev);
 
        led_classdev_unregister(&hpled_led.led_classdev);