Hi Marian,

On Sun, 04 Nov 2007 00:53:11 +0100 Marian Balakowicz <[EMAIL PROTECTED]> wrote:
>
> +++ b/drivers/leds/leds-motionpro.c
> @@ -0,0 +1,240 @@
> +
> +#include <linux/module.h>
> +#include <linux/types.h>
> +#include <linux/kernel.h>
> +#include <linux/platform_device.h>
> +#include <linux/leds.h>
> +#include <linux/vmalloc.h>
> +
> +#include <asm/mpc52xx.h>
> +#include <asm/io.h>
> +#include <asm/of_platform.h>

You want <linux/of_platform.h> instead of <asm/..> and probably not
<linux/platform_device.h> above.

> +static void mpled_timer_toggle(unsigned long data)
> +{
> +     struct motionpro_led *mpled = (struct motionpro_led *) data;
                                                              ^
Unnecessary space.

> +static int __devinit mpled_probe(struct of_device *op, const struct 
> of_device_id *match)

Split this line.

> +{
> +     struct motionpro_led *mpled;
> +     const unsigned int *of_blink_delay = NULL;

You don't need to initialise this as you assign it before you use it.

> +     int err = 0;

Same here.

> +     if ((err = led_classdev_register(NULL, &mpled->mpled_cdev))) {

We would normally do the assignment separately from the check, so:

        err = led_classdev_register(NULL, &mpled->mpled_cdev);
        if (err) {

> +static struct of_platform_driver mpled_driver = {
> +     .owner          = THIS_MODULE,
> +     .name           = "leds-motionpro",
> +     .match_table    = mpled_match,
> +     .probe          = mpled_probe,
> +     .remove         = mpled_remove,
> +};

You should now use the name and owner fields of the embedded struct
device_driver, so:

static struct of_platform_driver mpled_driver = {
        .match_table    = mpled_match,
        .probe          = mpled_probe,
        .remove         = mpled_remove,
        .driver         = {
                .owner          = THIS_MODULE,
                .name           = "leds-motionpro",
        },
};

-- 
Cheers,
Stephen Rothwell                    [EMAIL PROTECTED]
http://www.canb.auug.org.au/~sfr/

Attachment: pgp3ZkmQmPZ4p.pgp
Description: PGP signature

_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Reply via email to