ar71xx: ag71xx: use mdio bus name in ar7240_probe messages
[oweals/openwrt.git] / target / linux / ar71xx / files / drivers / leds / leds-rb750.c
index 2e6064763abdc6fe688a14c077c6e0f91e4fddd5..79e98b488233da0d3f737d762ecc067021f13865 100644 (file)
@@ -9,11 +9,13 @@
  *
  */
 #include <linux/kernel.h>
+#include <linux/module.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/leds.h>
+#include <linux/slab.h>
 
-#include <asm/mach-ar71xx/mach-rb750.h>
+#include <asm/mach-ath79/mach-rb750.h>
 
 #define DRV_NAME       "leds-rb750"
 
@@ -21,6 +23,7 @@ struct rb750_led_dev {
        struct led_classdev     cdev;
        u32                     mask;
        int                     active_low;
+       void                    (*latch_change)(u32 clear, u32 set);
 };
 
 struct rb750_led_drvdata {
@@ -44,12 +47,12 @@ static void rb750_led_brightness_set(struct led_classdev *led_cdev,
        level ^= rbled->active_low;
 
        if (level)
-               rb750_latch_change(0, rbled->mask);
+               rbled->latch_change(0, rbled->mask);
        else
-               rb750_latch_change(rbled->mask, 0);
+               rbled->latch_change(rbled->mask, 0);
 }
 
-static int __devinit rb750_led_probe(struct platform_device *pdev)
+static int rb750_led_probe(struct platform_device *pdev)
 {
        struct rb750_led_platform_data *pdata;
        struct rb750_led_drvdata *drvdata;
@@ -80,6 +83,7 @@ static int __devinit rb750_led_probe(struct platform_device *pdev)
 
                rbled->mask = led_data->mask;
                rbled->active_low = !!led_data->active_low;
+               rbled->latch_change = pdata->latch_change;
 
                ret = led_classdev_register(&pdev->dev, &rbled->cdev);
                if (ret)
@@ -89,7 +93,7 @@ static int __devinit rb750_led_probe(struct platform_device *pdev)
        platform_set_drvdata(pdev, drvdata);
        return 0;
 
- err:
+err:
        for (i = i - 1; i >= 0; i--)
                led_classdev_unregister(&drvdata->led_devs[i].cdev);
 
@@ -97,7 +101,7 @@ static int __devinit rb750_led_probe(struct platform_device *pdev)
        return ret;
 }
 
-static int __devexit rb750_led_remove(struct platform_device *pdev)
+static int rb750_led_remove(struct platform_device *pdev)
 {
        struct rb750_led_drvdata *drvdata;
        int i;
@@ -112,7 +116,7 @@ static int __devexit rb750_led_remove(struct platform_device *pdev)
 
 static struct platform_driver rb750_led_driver = {
        .probe          = rb750_led_probe,
-       .remove         = __devexit_p(rb750_led_remove),
+       .remove         = rb750_led_remove,
        .driver         = {
                .name   = DRV_NAME,
                .owner  = THIS_MODULE,