[PATCH 4/4] Emerson KSI8560 base support
Stephen Rothwell
sfr at canb.auug.org.au
Fri Feb 29 13:34:33 EST 2008
Hi Alexandr,
On Thu, 28 Feb 2008 21:52:02 +0300 Alexandr Smirnov <asmirnov at ru.mvista.com> wrote:
>
> +void __iomem *cpld_base = NULL;
Should this be static?
> +static void cpm2_cascade(unsigned int irq, struct irq_desc *desc)
> +{
> + int cascade_irq;
> +
> + while ((cascade_irq = cpm2_get_irq()) >= 0) {
> + generic_handle_irq(cascade_irq);
> + }
We normally don't bracket single line blocks.
> +static void __init ksi8560_pic_init(void)
> +{
> + struct mpic *mpic;
> + struct resource r;
> + struct device_node *np = NULL;
> +#ifdef CONFIG_CPM2
> + int irq;
> +#endif
> +
> + np = of_find_node_by_type(np, "open-pic");
You can pass NULL as the first argument here, so you don't need the
initialisation of "np" above.
> +static struct cpm_pin ksi8560_pins[] = {
This should be marked __init.
> +static void ksi8560_show_cpuinfo(struct seq_file *m)
> +{
> + seq_printf(m, "Hardware rev\t: %d\n",
> + in_8(cpld_base + KSI8560_CPLD_HVR));
What if cpld_base is NULL?
> +static struct of_device_id __initdata of_bus_ids[] = {
> + { .type = "soc", },
> + { .name = "cpm", },
> + { .name = "localbus", },
> + {},
> +};
> +
> +static int __init declare_of_platform_devices(void)
> +{
> + if (!machine_is(ksi8560))
> + return 0;
You don't need this test because this is a machine_init_call.
> +static int __init ksi8560_probe(void)
> +{
> + unsigned long root = of_get_flat_dt_root();
> +
> + return of_flat_dt_is_compatible(root, "emerson,KSI8560");
You need to include asm/prom.h to use these routines.
--
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/20080229/f082d98b/attachment.pgp>
More information about the Linuxppc-dev
mailing list