提交 e1e5687d 编写于 作者: É Éric Piel 提交者: Linus Torvalds

lis3: change exported function to use passed parameter

Change exported functions to use the device given as parameter
instead of the global one.
Signed-off-by: NIlkka Koskinen <ilkka.koskinen@nokia.com>
Signed-off-by: NÉ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: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 d7f81d42
...@@ -631,7 +631,7 @@ static struct miscdevice lis3lv02d_misc_device = { ...@@ -631,7 +631,7 @@ static struct miscdevice lis3lv02d_misc_device = {
.fops = &lis3lv02d_misc_fops, .fops = &lis3lv02d_misc_fops,
}; };
int lis3lv02d_joystick_enable(void) int lis3lv02d_joystick_enable(struct lis3lv02d *lis3)
{ {
struct input_dev *input_dev; struct input_dev *input_dev;
int err; int err;
...@@ -689,7 +689,7 @@ int lis3lv02d_joystick_enable(void) ...@@ -689,7 +689,7 @@ int lis3lv02d_joystick_enable(void)
} }
EXPORT_SYMBOL_GPL(lis3lv02d_joystick_enable); EXPORT_SYMBOL_GPL(lis3lv02d_joystick_enable);
void lis3lv02d_joystick_disable(void) void lis3lv02d_joystick_disable(struct lis3lv02d *lis3)
{ {
if (lis3_dev.irq) if (lis3_dev.irq)
free_irq(lis3_dev.irq, &lis3_dev); free_irq(lis3_dev.irq, &lis3_dev);
...@@ -959,7 +959,7 @@ int lis3lv02d_init_device(struct lis3lv02d *lis3) ...@@ -959,7 +959,7 @@ int lis3lv02d_init_device(struct lis3lv02d *lis3)
pm_runtime_enable(lis3->pm_dev); pm_runtime_enable(lis3->pm_dev);
} }
if (lis3lv02d_joystick_enable()) if (lis3lv02d_joystick_enable(lis3))
pr_err("joystick initialization failed\n"); pr_err("joystick initialization failed\n");
/* passing in platform specific data is purely optional and only /* passing in platform specific data is purely optional and only
......
...@@ -282,8 +282,8 @@ struct lis3lv02d { ...@@ -282,8 +282,8 @@ struct lis3lv02d {
}; };
int lis3lv02d_init_device(struct lis3lv02d *lis3); int lis3lv02d_init_device(struct lis3lv02d *lis3);
int lis3lv02d_joystick_enable(void); int lis3lv02d_joystick_enable(struct lis3lv02d *lis3);
void lis3lv02d_joystick_disable(void); void lis3lv02d_joystick_disable(struct lis3lv02d *lis3);
void lis3lv02d_poweroff(struct lis3lv02d *lis3); void lis3lv02d_poweroff(struct lis3lv02d *lis3);
int lis3lv02d_poweron(struct lis3lv02d *lis3); int lis3lv02d_poweron(struct lis3lv02d *lis3);
int lis3lv02d_remove_fs(struct lis3lv02d *lis3); int lis3lv02d_remove_fs(struct lis3lv02d *lis3);
......
...@@ -182,7 +182,7 @@ static int __devexit lis3lv02d_i2c_remove(struct i2c_client *client) ...@@ -182,7 +182,7 @@ static int __devexit lis3lv02d_i2c_remove(struct i2c_client *client)
if (pdata && pdata->release_resources) if (pdata && pdata->release_resources)
pdata->release_resources(); pdata->release_resources();
lis3lv02d_joystick_disable(); lis3lv02d_joystick_disable(lis3);
lis3lv02d_remove_fs(&lis3_dev); lis3lv02d_remove_fs(&lis3_dev);
if (lis3_dev.reg_ctrl) if (lis3_dev.reg_ctrl)
......
...@@ -83,7 +83,7 @@ static int __devinit lis302dl_spi_probe(struct spi_device *spi) ...@@ -83,7 +83,7 @@ static int __devinit lis302dl_spi_probe(struct spi_device *spi)
static int __devexit lis302dl_spi_remove(struct spi_device *spi) static int __devexit lis302dl_spi_remove(struct spi_device *spi)
{ {
struct lis3lv02d *lis3 = spi_get_drvdata(spi); struct lis3lv02d *lis3 = spi_get_drvdata(spi);
lis3lv02d_joystick_disable(); lis3lv02d_joystick_disable(lis3);
lis3lv02d_poweroff(lis3); lis3lv02d_poweroff(lis3);
return lis3lv02d_remove_fs(&lis3_dev); return lis3lv02d_remove_fs(&lis3_dev);
......
...@@ -323,7 +323,7 @@ static int lis3lv02d_add(struct acpi_device *device) ...@@ -323,7 +323,7 @@ static int lis3lv02d_add(struct acpi_device *device)
INIT_WORK(&hpled_led.work, delayed_set_status_worker); INIT_WORK(&hpled_led.work, delayed_set_status_worker);
ret = led_classdev_register(NULL, &hpled_led.led_classdev); ret = led_classdev_register(NULL, &hpled_led.led_classdev);
if (ret) { if (ret) {
lis3lv02d_joystick_disable(); lis3lv02d_joystick_disable(&lis3_dev);
lis3lv02d_poweroff(&lis3_dev); lis3lv02d_poweroff(&lis3_dev);
flush_work(&hpled_led.work); flush_work(&hpled_led.work);
return ret; return ret;
...@@ -337,7 +337,7 @@ static int lis3lv02d_remove(struct acpi_device *device, int type) ...@@ -337,7 +337,7 @@ static int lis3lv02d_remove(struct acpi_device *device, int type)
if (!device) if (!device)
return -EINVAL; return -EINVAL;
lis3lv02d_joystick_disable(); lis3lv02d_joystick_disable(&lis3_dev);
lis3lv02d_poweroff(&lis3_dev); lis3lv02d_poweroff(&lis3_dev);
led_classdev_unregister(&hpled_led.led_classdev); led_classdev_unregister(&hpled_led.led_classdev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册