Hi Kumar,

On Thu, 24 Jan 2008 00:43:38 -0600 (CST) Kumar Gala <[EMAIL PROTECTED]> wrote:
>
> Let's see what sfr finds wrong with this patch :)

A challenge! :-)

> +++ b/arch/powerpc/platforms/85xx/stx_gp3.c
> +static void __init stx_gp3_pic_init(void)

> +     np = of_find_node_by_type(np, "open-pic");
                                  ^^
Use NULL explicitly and then you don't need to initialise np.

> +     if (of_address_to_resource(np, 0, &r)) {
> +             printk(KERN_ERR "Could not map mpic register space\n");
> +             of_node_put(np);
> +             return;
> +     }
> +
> +     mpic = mpic_alloc(np, r.start,
> +                     MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
> +                     0, 256, " OpenPIC  ");
> +     BUG_ON(mpic == NULL);

Isn't that a little excessive?

> +     irq = irq_of_parse_and_map(np, 0);
> +
> +     cpm2_pic_init(np);
> +     of_node_put(np);
> +     set_irq_chained_handler(irq, cpm2_cascade);

What if irq_of_parse_and_map returns NO_IRQ?

> +static const struct cpm_pin mpc8560_ads_pins[] = {

__initdata and not const, please.

> +static int __init stx_gp3_probe(void)
> +{
> +        unsigned long root = of_get_flat_dt_root();
> +
> +        return of_flat_dt_is_compatible(root, "stx,gp3-8560");

You should include <asm/prom.h> to use the flattened device tree accessors.

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

Attachment: pgpytV3I5lxVz.pgp
Description: PGP signature

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

Reply via email to