[PATCH]: Cleanup of leds-neo1973

Nelson Castillo nelsoneci at gmail.com
Wed Oct 15 17:46:07 CEST 2008


On Tue, Oct 14, 2008 at 05:15:19PM -0200, Werner Almesberger wrote:
> Nelson Castillo wrote:
> > -MODULE_DESCRIPTION("FIC Neo1973 GTA02 LED driver");
> > +MODULE_DESCRIPTION("FIC/Openmoko Neo1973 GTA02 LED driver");
> 
> Hmm, this is getting messy :-(
> 
> If we change those strings at all, then something like "Openmoko
> GTA02" would be much closer to reality.

Thanks. Resending.

From: Nelson Castillo <nelsoneci at gmail.com>

Remove unneeded spaces and coding style fixes. Purely cosmetic.
I don't know if cleanup patches are wanted at the moment.
I asked Andy for advise.

---

 drivers/leds/leds-neo1973-gta02.c    |   10 +++++-----
 drivers/leds/leds-neo1973-vibrator.c |   23 +++++++++++------------
 2 files changed, 16 insertions(+), 17 deletions(-)


Signed-off-by: Nelson Castillo <nelsoneci at gmail.com>
diff --git a/drivers/leds/leds-neo1973-gta02.c b/drivers/leds/leds-neo1973-gta02.c
index 0b3f02a..142b5cb 100644
--- a/drivers/leds/leds-neo1973-gta02.c
+++ b/drivers/leds/leds-neo1973-gta02.c
@@ -1,7 +1,7 @@
 /*
- * LED driver for the FIC Neo1973 GTA02 GSM phone
+ * LED driver for the Openmoko GTA02 GSM phone
  *
- * (C) 2006-2007 by Openmoko, Inc.
+ * (C) 2006-2008 by Openmoko, Inc.
  * Author: Harald Welte <laforge at openmoko.org>
  * All rights reserved.
  *
@@ -48,7 +48,7 @@ static inline struct gta02_led_bundle *to_bundle(struct led_classdev *led_cdev)
 }
 
 static void gta02led_set(struct led_classdev *led_cdev,
-		enum led_brightness value)
+			 enum led_brightness value)
 {
 	unsigned long flags;
 	struct gta02_led_priv *lp = to_priv(led_cdev);
@@ -168,12 +168,12 @@ static int __init gta02led_init(void)
 
 static void __exit gta02led_exit(void)
 {
- 	platform_driver_unregister(&gta02led_driver);
+	platform_driver_unregister(&gta02led_driver);
 }
 
 module_init(gta02led_init);
 module_exit(gta02led_exit);
 
 MODULE_AUTHOR("Harald Welte <laforge at openmoko.org>");
-MODULE_DESCRIPTION("FIC Neo1973 GTA02 LED driver");
+MODULE_DESCRIPTION("Openmoko GTA02 LED driver");
 MODULE_LICENSE("GPL");
diff --git a/drivers/leds/leds-neo1973-vibrator.c b/drivers/leds/leds-neo1973-vibrator.c
index 3cead0f..06a4a2c 100644
--- a/drivers/leds/leds-neo1973-vibrator.c
+++ b/drivers/leds/leds-neo1973-vibrator.c
@@ -1,7 +1,7 @@
 /*
- * LED driver for the vibrator of the FIC Neo1973 GSM Phone
+ * LED driver for the vibrator of the Openmoko GTA01/GTA02 GSM Phones
  *
- * (C) 2006-2007 by Openmoko, Inc.
+ * (C) 2006-2008 by Openmoko, Inc.
  * Author: Harald Welte <laforge at openmoko.org>
  * All rights reserved.
  *
@@ -10,7 +10,7 @@
  * published by the Free Software Foundation.
  *
  * Javi Roman <javiroman at kernel-labs.org>:
- * 	Implement PWM support for GTA01Bv4 and later
+ *	Implement PWM support for GTA01Bv4 and later
  */
 
 #include <linux/kernel.h>
@@ -39,11 +39,12 @@ struct neo1973_vib_priv {
 };
 
 static void neo1973_vib_vib_set(struct led_classdev *led_cdev,
-		enum led_brightness value)
+				enum led_brightness value)
 {
 	unsigned long flags;
-	struct neo1973_vib_priv *vp =
-		container_of(led_cdev, struct neo1973_vib_priv, cdev);
+	struct neo1973_vib_priv *vp = container_of(led_cdev,
+						   struct neo1973_vib_priv,
+						   cdev);
 
 #ifdef CONFIG_MACH_NEO1973_GTA02
 	if (machine_is_neo1973_gta02()) { /* use FIQ to control GPIO */
@@ -58,13 +59,11 @@ static void neo1973_vib_vib_set(struct led_classdev *led_cdev,
 	 * value == 0 -> 0% duty cycle (zero power)
 	 */
 	spin_lock_irqsave(&vp->lock, flags);
-	if (vp->has_pwm)
+	if (vp->has_pwm) {
 		s3c2410_pwm_duty_cycle(value / 4, &vp->pwm);
+	}
 	else {
-		if (value)
-			neo1973_gpb_setpin(vp->gpio, 1);
-		else
-			neo1973_gpb_setpin(vp->gpio, 0);
+		neo1973_gpb_setpin(vp->gpio, value ? 1 : 0);
 	}
 	spin_unlock_irqrestore(&vp->lock, flags);
 }
@@ -206,5 +205,5 @@ module_init(neo1973_vib_init);
 module_exit(neo1973_vib_exit);
 
 MODULE_AUTHOR("Harald Welte <laforge at openmoko.org>");
-MODULE_DESCRIPTION("FIC Neo1973 vibrator driver");
+MODULE_DESCRIPTION("Openmoko GTA01/GTA02 vibrator driver");
 MODULE_LICENSE("GPL");

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.openmoko.org/pipermail/openmoko-kernel/attachments/20081015/fb2c37bd/attachment.pgp 


More information about the openmoko-kernel mailing list