diff options
author | Daniel Mack <daniel@caiaq.de> | 2009-03-31 18:24:31 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-01 11:59:22 -0400 |
commit | ab337a632783c251a3c3852aec0ead8a0281cbdd (patch) | |
tree | 98a644e1c14a47164c52ed08e35e0a0e0d13f869 /drivers | |
parent | 12a324b6a3758f04a952b99d75a625732d767585 (diff) |
lis3: reorder functions to make forward decl obsolete
Move lis3lv02d_init_device() down so that the forward declaration of
lis3lv02d_add_fs() becomes unnecessary.
Signed-off-by: Daniel Mack <daniel@caiaq.de>
Acked-by: Pavel Machek <pavel@ucw.cz>
Acked-by: Eric Piel <eric.piel@tremplin-utc.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/hwmon/lis3lv02d.c | 64 |
1 files changed, 31 insertions, 33 deletions
diff --git a/drivers/hwmon/lis3lv02d.c b/drivers/hwmon/lis3lv02d.c index 4888ac5ba8cc..eeae7c9600e4 100644 --- a/drivers/hwmon/lis3lv02d.c +++ b/drivers/hwmon/lis3lv02d.c | |||
@@ -59,8 +59,6 @@ struct acpi_lis3lv02d lis3_dev = { | |||
59 | 59 | ||
60 | EXPORT_SYMBOL_GPL(lis3_dev); | 60 | EXPORT_SYMBOL_GPL(lis3_dev); |
61 | 61 | ||
62 | static int lis3lv02d_add_fs(struct acpi_device *device); | ||
63 | |||
64 | static s16 lis3lv02d_read_16(acpi_handle handle, int reg) | 62 | static s16 lis3lv02d_read_16(acpi_handle handle, int reg) |
65 | { | 63 | { |
66 | u8 lo, hi; | 64 | u8 lo, hi; |
@@ -377,37 +375,6 @@ void lis3lv02d_joystick_disable(void) | |||
377 | } | 375 | } |
378 | EXPORT_SYMBOL_GPL(lis3lv02d_joystick_disable); | 376 | EXPORT_SYMBOL_GPL(lis3lv02d_joystick_disable); |
379 | 377 | ||
380 | /* | ||
381 | * Initialise the accelerometer and the various subsystems. | ||
382 | * Should be rather independant of the bus system. | ||
383 | */ | ||
384 | int lis3lv02d_init_device(struct acpi_lis3lv02d *dev) | ||
385 | { | ||
386 | mutex_init(&dev->lock); | ||
387 | lis3lv02d_add_fs(dev->device); | ||
388 | lis3lv02d_increase_use(dev); | ||
389 | |||
390 | if (lis3lv02d_joystick_enable()) | ||
391 | printk(KERN_ERR DRIVER_NAME ": joystick initialization failed\n"); | ||
392 | |||
393 | printk("lis3_init_device: irq %d\n", dev->irq); | ||
394 | |||
395 | /* if we did not get an IRQ from ACPI - we have nothing more to do */ | ||
396 | if (!dev->irq) { | ||
397 | printk(KERN_ERR DRIVER_NAME | ||
398 | ": No IRQ in ACPI. Disabling /dev/freefall\n"); | ||
399 | goto out; | ||
400 | } | ||
401 | |||
402 | printk("lis3: registering device\n"); | ||
403 | if (misc_register(&lis3lv02d_misc_device)) | ||
404 | printk(KERN_ERR DRIVER_NAME ": misc_register failed\n"); | ||
405 | out: | ||
406 | lis3lv02d_decrease_use(dev); | ||
407 | return 0; | ||
408 | } | ||
409 | EXPORT_SYMBOL_GPL(lis3lv02d_init_device); | ||
410 | |||
411 | /* Sysfs stuff */ | 378 | /* Sysfs stuff */ |
412 | static ssize_t lis3lv02d_position_show(struct device *dev, | 379 | static ssize_t lis3lv02d_position_show(struct device *dev, |
413 | struct device_attribute *attr, char *buf) | 380 | struct device_attribute *attr, char *buf) |
@@ -485,6 +452,37 @@ int lis3lv02d_remove_fs(void) | |||
485 | } | 452 | } |
486 | EXPORT_SYMBOL_GPL(lis3lv02d_remove_fs); | 453 | EXPORT_SYMBOL_GPL(lis3lv02d_remove_fs); |
487 | 454 | ||
455 | /* | ||
456 | * Initialise the accelerometer and the various subsystems. | ||
457 | * Should be rather independant of the bus system. | ||
458 | */ | ||
459 | int lis3lv02d_init_device(struct acpi_lis3lv02d *dev) | ||
460 | { | ||
461 | mutex_init(&dev->lock); | ||
462 | lis3lv02d_add_fs(dev->device); | ||
463 | lis3lv02d_increase_use(dev); | ||
464 | |||
465 | if (lis3lv02d_joystick_enable()) | ||
466 | printk(KERN_ERR DRIVER_NAME ": joystick initialization failed\n"); | ||
467 | |||
468 | printk("lis3_init_device: irq %d\n", dev->irq); | ||
469 | |||
470 | /* if we did not get an IRQ from ACPI - we have nothing more to do */ | ||
471 | if (!dev->irq) { | ||
472 | printk(KERN_ERR DRIVER_NAME | ||
473 | ": No IRQ in ACPI. Disabling /dev/freefall\n"); | ||
474 | goto out; | ||
475 | } | ||
476 | |||
477 | printk("lis3: registering device\n"); | ||
478 | if (misc_register(&lis3lv02d_misc_device)) | ||
479 | printk(KERN_ERR DRIVER_NAME ": misc_register failed\n"); | ||
480 | out: | ||
481 | lis3lv02d_decrease_use(dev); | ||
482 | return 0; | ||
483 | } | ||
484 | EXPORT_SYMBOL_GPL(lis3lv02d_init_device); | ||
485 | |||
488 | MODULE_DESCRIPTION("ST LIS3LV02Dx three-axis digital accelerometer driver"); | 486 | MODULE_DESCRIPTION("ST LIS3LV02Dx three-axis digital accelerometer driver"); |
489 | MODULE_AUTHOR("Yan Burman, Eric Piel, Pavel Machek"); | 487 | MODULE_AUTHOR("Yan Burman, Eric Piel, Pavel Machek"); |
490 | MODULE_LICENSE("GPL"); | 488 | MODULE_LICENSE("GPL"); |