Commit ab337a63 authored by Daniel Mack's avatar Daniel Mack Committed by Linus Torvalds

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: default avatarDaniel Mack <daniel@caiaq.de>
Acked-by: default avatarPavel Machek <pavel@ucw.cz>
Acked-by: default avatarEric Piel <eric.piel@tremplin-utc.net>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 12a324b6
...@@ -59,8 +59,6 @@ struct acpi_lis3lv02d lis3_dev = { ...@@ -59,8 +59,6 @@ struct acpi_lis3lv02d lis3_dev = {
EXPORT_SYMBOL_GPL(lis3_dev); EXPORT_SYMBOL_GPL(lis3_dev);
static int lis3lv02d_add_fs(struct acpi_device *device);
static s16 lis3lv02d_read_16(acpi_handle handle, int reg) static s16 lis3lv02d_read_16(acpi_handle handle, int reg)
{ {
u8 lo, hi; u8 lo, hi;
...@@ -377,37 +375,6 @@ void lis3lv02d_joystick_disable(void) ...@@ -377,37 +375,6 @@ void lis3lv02d_joystick_disable(void)
} }
EXPORT_SYMBOL_GPL(lis3lv02d_joystick_disable); EXPORT_SYMBOL_GPL(lis3lv02d_joystick_disable);
/*
* Initialise the accelerometer and the various subsystems.
* Should be rather independant of the bus system.
*/
int lis3lv02d_init_device(struct acpi_lis3lv02d *dev)
{
mutex_init(&dev->lock);
lis3lv02d_add_fs(dev->device);
lis3lv02d_increase_use(dev);
if (lis3lv02d_joystick_enable())
printk(KERN_ERR DRIVER_NAME ": joystick initialization failed\n");
printk("lis3_init_device: irq %d\n", dev->irq);
/* if we did not get an IRQ from ACPI - we have nothing more to do */
if (!dev->irq) {
printk(KERN_ERR DRIVER_NAME
": No IRQ in ACPI. Disabling /dev/freefall\n");
goto out;
}
printk("lis3: registering device\n");
if (misc_register(&lis3lv02d_misc_device))
printk(KERN_ERR DRIVER_NAME ": misc_register failed\n");
out:
lis3lv02d_decrease_use(dev);
return 0;
}
EXPORT_SYMBOL_GPL(lis3lv02d_init_device);
/* Sysfs stuff */ /* Sysfs stuff */
static ssize_t lis3lv02d_position_show(struct device *dev, static ssize_t lis3lv02d_position_show(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
...@@ -485,6 +452,37 @@ int lis3lv02d_remove_fs(void) ...@@ -485,6 +452,37 @@ int lis3lv02d_remove_fs(void)
} }
EXPORT_SYMBOL_GPL(lis3lv02d_remove_fs); EXPORT_SYMBOL_GPL(lis3lv02d_remove_fs);
/*
* Initialise the accelerometer and the various subsystems.
* Should be rather independant of the bus system.
*/
int lis3lv02d_init_device(struct acpi_lis3lv02d *dev)
{
mutex_init(&dev->lock);
lis3lv02d_add_fs(dev->device);
lis3lv02d_increase_use(dev);
if (lis3lv02d_joystick_enable())
printk(KERN_ERR DRIVER_NAME ": joystick initialization failed\n");
printk("lis3_init_device: irq %d\n", dev->irq);
/* if we did not get an IRQ from ACPI - we have nothing more to do */
if (!dev->irq) {
printk(KERN_ERR DRIVER_NAME
": No IRQ in ACPI. Disabling /dev/freefall\n");
goto out;
}
printk("lis3: registering device\n");
if (misc_register(&lis3lv02d_misc_device))
printk(KERN_ERR DRIVER_NAME ": misc_register failed\n");
out:
lis3lv02d_decrease_use(dev);
return 0;
}
EXPORT_SYMBOL_GPL(lis3lv02d_init_device);
MODULE_DESCRIPTION("ST LIS3LV02Dx three-axis digital accelerometer driver"); MODULE_DESCRIPTION("ST LIS3LV02Dx three-axis digital accelerometer driver");
MODULE_AUTHOR("Yan Burman, Eric Piel, Pavel Machek"); MODULE_AUTHOR("Yan Burman, Eric Piel, Pavel Machek");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment