linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Mack <daniel@caiaq.de>
To: linux-kernel@vger.kernel.org
Cc: Daniel Mack <daniel@caiaq.de>,
	Eric Piel <eric.piel@tremplin-utc.net>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH 1/3] lis3: reorder functions to make forward decl obsolete
Date: Mon, 23 Mar 2009 00:51:25 +0100	[thread overview]
Message-ID: <1237765887-32672-1-git-send-email-daniel@caiaq.de> (raw)
In-Reply-To: <20090322234248.GG22927@buzzloop.caiaq.de>

moved 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>
Cc: Eric Piel <eric.piel@tremplin-utc.net>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 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 4888ac5..eeae7c9 100644
--- a/drivers/hwmon/lis3lv02d.c
+++ b/drivers/hwmon/lis3lv02d.c
@@ -59,8 +59,6 @@ struct acpi_lis3lv02d 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)
 {
 	u8 lo, hi;
@@ -377,37 +375,6 @@ void lis3lv02d_joystick_disable(void)
 }
 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 */
 static ssize_t lis3lv02d_position_show(struct device *dev,
 				struct device_attribute *attr, char *buf)
@@ -485,6 +452,37 @@ int lis3lv02d_remove_fs(void)
 }
 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_AUTHOR("Yan Burman, Eric Piel, Pavel Machek");
 MODULE_LICENSE("GPL");
-- 
1.6.2


  reply	other threads:[~2009-03-22 23:52 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-01 13:29 lis3's ACPI dependency Daniel Mack
2009-03-01 18:28 ` Éric Piel
2009-03-02  0:55   ` Daniel Mack
2009-03-02 10:17     ` Éric Piel
2009-03-02 14:31       ` Daniel Mack
2009-03-02 14:31         ` Daniel Mack
2009-03-02 14:31           ` [PATCH 3/5] lis3: reorder functions to make forward decl obsolete Daniel Mack
2009-03-02 14:31             ` [PATCH 4/5] lis3: solve dependency between core and ACPI Daniel Mack
2009-03-02 14:31               ` [PATCH 5/5] lis3: SPI transport layer Daniel Mack
2009-03-02 15:11                 ` Pavel Machek
2009-03-03 19:59                 ` Éric Piel
2009-03-02 15:10               ` [PATCH 4/5] lis3: solve dependency between core and ACPI Pavel Machek
2009-03-03 19:54               ` Éric Piel
2009-03-04  1:43                 ` Daniel Mack
2009-03-16 19:09                   ` Daniel Mack
2009-03-16 21:30                     ` Pavel Machek
2009-03-04  1:44                 ` [PATCH 3/5] lis3: reorder functions to make forward decl obsolete Daniel Mack
2009-03-04  1:44                   ` [PATCH 4/5] lis3: solve dependency between core and ACPI Daniel Mack
2009-03-04  1:44                     ` [PATCH 5/5] lis3: SPI transport layer Daniel Mack
2009-03-22 23:31                       ` Éric Piel
2009-03-23 15:41                         ` Daniel Mack
2009-03-22 23:25                     ` [PATCH 4/5] lis3: solve dependency between core and ACPI Éric Piel
2009-03-22 23:42                       ` Daniel Mack
2009-03-22 23:51                         ` Daniel Mack [this message]
2009-03-22 23:51                           ` [PATCH 2/3] " Daniel Mack
2009-03-22 23:51                             ` [PATCH 3/3] lis3: SPI transport layer Daniel Mack
2009-03-23 15:48                               ` Éric Piel
2016-08-10 10:31                               ` Geert Uytterhoeven
2009-03-23 15:48                             ` [PATCH 2/3] lis3: solve dependency between core and ACPI Éric Piel
2009-03-23 15:48                           ` [PATCH 1/3] lis3: reorder functions to make forward decl obsolete Éric Piel
2009-03-02 14:57             ` [PATCH 3/5] " Pavel Machek
2009-03-02 14:36       ` lis3's ACPI dependency Daniel Mack
2009-03-02 14:40         ` Éric Piel
2009-03-01 19:51 ` Robert Hancock
2009-03-02  0:50   ` Daniel Mack

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1237765887-32672-1-git-send-email-daniel@caiaq.de \
    --to=daniel@caiaq.de \
    --cc=akpm@linux-foundation.org \
    --cc=eric.piel@tremplin-utc.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).