diff options
author | Éric Piel <eric.piel@tremplin-utc.net> | 2011-10-31 20:11:02 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-10-31 20:30:52 -0400 |
commit | e1e5687d75ef0ea5cbae63df48ff2fdcb5306f66 (patch) | |
tree | 4831229322e0c7cff31a026270832a83eb51ccf9 /drivers/misc | |
parent | d7f81d4299cdc8cf06fc9562ec3dafce528bd6ff (diff) |
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>
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/lis3lv02d/lis3lv02d.c | 6 | ||||
-rw-r--r-- | drivers/misc/lis3lv02d/lis3lv02d.h | 4 | ||||
-rw-r--r-- | drivers/misc/lis3lv02d/lis3lv02d_i2c.c | 2 | ||||
-rw-r--r-- | drivers/misc/lis3lv02d/lis3lv02d_spi.c | 2 |
4 files changed, 7 insertions, 7 deletions
diff --git a/drivers/misc/lis3lv02d/lis3lv02d.c b/drivers/misc/lis3lv02d/lis3lv02d.c index eaef96bbbdfd..57249a01e6e7 100644 --- a/drivers/misc/lis3lv02d/lis3lv02d.c +++ b/drivers/misc/lis3lv02d/lis3lv02d.c | |||
@@ -631,7 +631,7 @@ static struct miscdevice lis3lv02d_misc_device = { | |||
631 | .fops = &lis3lv02d_misc_fops, | 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 | struct input_dev *input_dev; | 636 | struct input_dev *input_dev; |
637 | int err; | 637 | int err; |
@@ -689,7 +689,7 @@ int lis3lv02d_joystick_enable(void) | |||
689 | } | 689 | } |
690 | EXPORT_SYMBOL_GPL(lis3lv02d_joystick_enable); | 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 | if (lis3_dev.irq) | 694 | if (lis3_dev.irq) |
695 | free_irq(lis3_dev.irq, &lis3_dev); | 695 | free_irq(lis3_dev.irq, &lis3_dev); |
@@ -959,7 +959,7 @@ int lis3lv02d_init_device(struct lis3lv02d *lis3) | |||
959 | pm_runtime_enable(lis3->pm_dev); | 959 | pm_runtime_enable(lis3->pm_dev); |
960 | } | 960 | } |
961 | 961 | ||
962 | if (lis3lv02d_joystick_enable()) | 962 | if (lis3lv02d_joystick_enable(lis3)) |
963 | pr_err("joystick initialization failed\n"); | 963 | pr_err("joystick initialization failed\n"); |
964 | 964 | ||
965 | /* passing in platform specific data is purely optional and only | 965 | /* passing in platform specific data is purely optional and only |
diff --git a/drivers/misc/lis3lv02d/lis3lv02d.h b/drivers/misc/lis3lv02d/lis3lv02d.h index 57c64bbcf5f7..b94e72374810 100644 --- a/drivers/misc/lis3lv02d/lis3lv02d.h +++ b/drivers/misc/lis3lv02d/lis3lv02d.h | |||
@@ -282,8 +282,8 @@ struct lis3lv02d { | |||
282 | }; | 282 | }; |
283 | 283 | ||
284 | int lis3lv02d_init_device(struct lis3lv02d *lis3); | 284 | int lis3lv02d_init_device(struct lis3lv02d *lis3); |
285 | int lis3lv02d_joystick_enable(void); | 285 | int lis3lv02d_joystick_enable(struct lis3lv02d *lis3); |
286 | void lis3lv02d_joystick_disable(void); | 286 | void lis3lv02d_joystick_disable(struct lis3lv02d *lis3); |
287 | void lis3lv02d_poweroff(struct lis3lv02d *lis3); | 287 | void lis3lv02d_poweroff(struct lis3lv02d *lis3); |
288 | int lis3lv02d_poweron(struct lis3lv02d *lis3); | 288 | int lis3lv02d_poweron(struct lis3lv02d *lis3); |
289 | int lis3lv02d_remove_fs(struct lis3lv02d *lis3); | 289 | int lis3lv02d_remove_fs(struct lis3lv02d *lis3); |
diff --git a/drivers/misc/lis3lv02d/lis3lv02d_i2c.c b/drivers/misc/lis3lv02d/lis3lv02d_i2c.c index ea9159c65b58..6cdc38f6a9a8 100644 --- a/drivers/misc/lis3lv02d/lis3lv02d_i2c.c +++ b/drivers/misc/lis3lv02d/lis3lv02d_i2c.c | |||
@@ -182,7 +182,7 @@ static int __devexit lis3lv02d_i2c_remove(struct i2c_client *client) | |||
182 | if (pdata && pdata->release_resources) | 182 | if (pdata && pdata->release_resources) |
183 | pdata->release_resources(); | 183 | pdata->release_resources(); |
184 | 184 | ||
185 | lis3lv02d_joystick_disable(); | 185 | lis3lv02d_joystick_disable(lis3); |
186 | lis3lv02d_remove_fs(&lis3_dev); | 186 | lis3lv02d_remove_fs(&lis3_dev); |
187 | 187 | ||
188 | if (lis3_dev.reg_ctrl) | 188 | if (lis3_dev.reg_ctrl) |
diff --git a/drivers/misc/lis3lv02d/lis3lv02d_spi.c b/drivers/misc/lis3lv02d/lis3lv02d_spi.c index c1f8a8fbf694..b2c1be12d16f 100644 --- a/drivers/misc/lis3lv02d/lis3lv02d_spi.c +++ b/drivers/misc/lis3lv02d/lis3lv02d_spi.c | |||
@@ -83,7 +83,7 @@ static int __devinit lis302dl_spi_probe(struct spi_device *spi) | |||
83 | static int __devexit lis302dl_spi_remove(struct spi_device *spi) | 83 | static int __devexit lis302dl_spi_remove(struct spi_device *spi) |
84 | { | 84 | { |
85 | struct lis3lv02d *lis3 = spi_get_drvdata(spi); | 85 | struct lis3lv02d *lis3 = spi_get_drvdata(spi); |
86 | lis3lv02d_joystick_disable(); | 86 | lis3lv02d_joystick_disable(lis3); |
87 | lis3lv02d_poweroff(lis3); | 87 | lis3lv02d_poweroff(lis3); |
88 | 88 | ||
89 | return lis3lv02d_remove_fs(&lis3_dev); | 89 | return lis3lv02d_remove_fs(&lis3_dev); |