[PATCH] [POWERPC] 85xx: Port STX GP3 board over from arch/ppc
Stephen Rothwell
sfr at canb.auug.org.au
Thu Jan 24 18:06:35 EST 2008
Hi Kumar,
On Thu, 24 Jan 2008 00:43:38 -0600 (CST) Kumar Gala <galak at kernel.crashing.org> 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 sfr at canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20080124/9c702758/attachment.pgp>
More information about the Linuxppc-dev
mailing list