Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Éric Piel and committed by
Linus Torvalds
e1e5687d d7f81d42

+9 -9
+3 -3
drivers/misc/lis3lv02d/lis3lv02d.c
··· 631 631 .fops = &lis3lv02d_misc_fops, 632 632 }; 633 633 634 - int lis3lv02d_joystick_enable(void) 634 + int lis3lv02d_joystick_enable(struct lis3lv02d *lis3) 635 635 { 636 636 struct input_dev *input_dev; 637 637 int err; ··· 689 689 } 690 690 EXPORT_SYMBOL_GPL(lis3lv02d_joystick_enable); 691 691 692 - void lis3lv02d_joystick_disable(void) 692 + void lis3lv02d_joystick_disable(struct lis3lv02d *lis3) 693 693 { 694 694 if (lis3_dev.irq) 695 695 free_irq(lis3_dev.irq, &lis3_dev); ··· 959 959 pm_runtime_enable(lis3->pm_dev); 960 960 } 961 961 962 - if (lis3lv02d_joystick_enable()) 962 + if (lis3lv02d_joystick_enable(lis3)) 963 963 pr_err("joystick initialization failed\n"); 964 964 965 965 /* passing in platform specific data is purely optional and only
+2 -2
drivers/misc/lis3lv02d/lis3lv02d.h
··· 282 282 }; 283 283 284 284 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); 287 287 void lis3lv02d_poweroff(struct lis3lv02d *lis3); 288 288 int lis3lv02d_poweron(struct lis3lv02d *lis3); 289 289 int lis3lv02d_remove_fs(struct lis3lv02d *lis3);
+1 -1
drivers/misc/lis3lv02d/lis3lv02d_i2c.c
··· 182 182 if (pdata && pdata->release_resources) 183 183 pdata->release_resources(); 184 184 185 - lis3lv02d_joystick_disable(); 185 + lis3lv02d_joystick_disable(lis3); 186 186 lis3lv02d_remove_fs(&lis3_dev); 187 187 188 188 if (lis3_dev.reg_ctrl)
+1 -1
drivers/misc/lis3lv02d/lis3lv02d_spi.c
··· 83 83 static int __devexit lis302dl_spi_remove(struct spi_device *spi) 84 84 { 85 85 struct lis3lv02d *lis3 = spi_get_drvdata(spi); 86 - lis3lv02d_joystick_disable(); 86 + lis3lv02d_joystick_disable(lis3); 87 87 lis3lv02d_poweroff(lis3); 88 88 89 89 return lis3lv02d_remove_fs(&lis3_dev);
+2 -2
drivers/platform/x86/hp_accel.c
··· 323 323 INIT_WORK(&hpled_led.work, delayed_set_status_worker); 324 324 ret = led_classdev_register(NULL, &hpled_led.led_classdev); 325 325 if (ret) { 326 - lis3lv02d_joystick_disable(); 326 + lis3lv02d_joystick_disable(&lis3_dev); 327 327 lis3lv02d_poweroff(&lis3_dev); 328 328 flush_work(&hpled_led.work); 329 329 return ret; ··· 337 337 if (!device) 338 338 return -EINVAL; 339 339 340 - lis3lv02d_joystick_disable(); 340 + lis3lv02d_joystick_disable(&lis3_dev); 341 341 lis3lv02d_poweroff(&lis3_dev); 342 342 343 343 led_classdev_unregister(&hpled_led.led_classdev);