Skip to content

Commit e1e5687

Browse files
pielerictorvalds
authored andcommitted
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: 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>
1 parent d7f81d4 commit e1e5687

5 files changed

Lines changed: 9 additions & 9 deletions

File tree

‎drivers/misc/lis3lv02d/lis3lv02d.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ static struct miscdevice lis3lv02d_misc_device = {
631631
.fops = &lis3lv02d_misc_fops,
632632
};
633633

634-
int lis3lv02d_joystick_enable(void)
634+
int lis3lv02d_joystick_enable(struct lis3lv02d *lis3)
635635
{
636636
struct input_dev *input_dev;
637637
int err;
@@ -689,7 +689,7 @@ int lis3lv02d_joystick_enable(void)
689689
}
690690
EXPORT_SYMBOL_GPL(lis3lv02d_joystick_enable);
691691

692-
void lis3lv02d_joystick_disable(void)
692+
void lis3lv02d_joystick_disable(struct lis3lv02d *lis3)
693693
{
694694
if (lis3_dev.irq)
695695
free_irq(lis3_dev.irq, &lis3_dev);
@@ -959,7 +959,7 @@ int lis3lv02d_init_device(struct lis3lv02d *lis3)
959959
pm_runtime_enable(lis3->pm_dev);
960960
}
961961

962-
if (lis3lv02d_joystick_enable())
962+
if (lis3lv02d_joystick_enable(lis3))
963963
pr_err("joystick initialization failed\n");
964964

965965
/* passing in platform specific data is purely optional and only

‎drivers/misc/lis3lv02d/lis3lv02d.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,8 @@ struct lis3lv02d {
282282
};
283283

284284
int lis3lv02d_init_device(struct lis3lv02d *lis3);
285-
int lis3lv02d_joystick_enable(void);
286-
void lis3lv02d_joystick_disable(void);
285+
int lis3lv02d_joystick_enable(struct lis3lv02d *lis3);
286+
void lis3lv02d_joystick_disable(struct lis3lv02d *lis3);
287287
void lis3lv02d_poweroff(struct lis3lv02d *lis3);
288288
int lis3lv02d_poweron(struct lis3lv02d *lis3);
289289
int lis3lv02d_remove_fs(struct lis3lv02d *lis3);

‎drivers/misc/lis3lv02d/lis3lv02d_i2c.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ static int __devexit lis3lv02d_i2c_remove(struct i2c_client *client)
182182
if (pdata && pdata->release_resources)
183183
pdata->release_resources();
184184

185-
lis3lv02d_joystick_disable();
185+
lis3lv02d_joystick_disable(lis3);
186186
lis3lv02d_remove_fs(&lis3_dev);
187187

188188
if (lis3_dev.reg_ctrl)

‎drivers/misc/lis3lv02d/lis3lv02d_spi.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ static int __devinit lis302dl_spi_probe(struct spi_device *spi)
8383
static int __devexit lis302dl_spi_remove(struct spi_device *spi)
8484
{
8585
struct lis3lv02d *lis3 = spi_get_drvdata(spi);
86-
lis3lv02d_joystick_disable();
86+
lis3lv02d_joystick_disable(lis3);
8787
lis3lv02d_poweroff(lis3);
8888

8989
return lis3lv02d_remove_fs(&lis3_dev);

‎drivers/platform/x86/hp_accel.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ static int lis3lv02d_add(struct acpi_device *device)
323323
INIT_WORK(&hpled_led.work, delayed_set_status_worker);
324324
ret = led_classdev_register(NULL, &hpled_led.led_classdev);
325325
if (ret) {
326-
lis3lv02d_joystick_disable();
326+
lis3lv02d_joystick_disable(&lis3_dev);
327327
lis3lv02d_poweroff(&lis3_dev);
328328
flush_work(&hpled_led.work);
329329
return ret;
@@ -337,7 +337,7 @@ static int lis3lv02d_remove(struct acpi_device *device, int type)
337337
if (!device)
338338
return -EINVAL;
339339

340-
lis3lv02d_joystick_disable();
340+
lis3lv02d_joystick_disable(&lis3_dev);
341341
lis3lv02d_poweroff(&lis3_dev);
342342

343343
led_classdev_unregister(&hpled_led.led_classdev);

0 commit comments

Comments
 (0)