[PATCH 3/7] sbc8560: add support for Wind River SBC8560 in arch/powerpc

Stephen Rothwell sfr at canb.auug.org.au
Tue Jan 8 11:32:19 EST 2008


Hi Paul,

On Mon,  7 Jan 2008 09:25:28 -0500 Paul Gortmaker <paul.gortmaker at windriver.com> wrote:
>
> +++ b/arch/powerpc/platforms/85xx/sbc8560.c
>
> +static void __init sbc8560_pic_init(void)
> +{
>
> +#ifdef CONFIG_CPM2
> +	/* Setup CPM2 PIC */
> +	np = of_find_compatible_node(NULL, NULL, "fsl,cpm2-pic");
> +	if (np == NULL) {
> +		printk(KERN_ERR "PIC init: can not find fsl,cpm2-pic node\n");
> +		return;
> +	}
> +	irq = irq_of_parse_and_map(np, 0);

What happens if that fails?

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

Does passing NO_IRQ matter here (in the case that irq_of_parse_and_map fails)?

> +static const struct cpm_pin sbc8560_pins[] = {

Of course, these could be __initdata (but not const as well).  Sorry
about not mentioning this last time and it is a trivial change that
should not stop this stuff going in.

> +static int __init sbc8560_probe(void)
> +{
> +        unsigned long root = of_get_flat_dt_root();
> +
> +        return of_flat_dt_is_compatible(root, "SBC8560");

To use the flattened device tree accessors, you should include asm/prom.h

-- 
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/20080108/db9054c0/attachment.pgp>


More information about the Linuxppc-dev mailing list