On Wed, 09 Jan 2008 15:19:13 -0500 Sean MacLennan <[EMAIL PROTECTED]> wrote: > > I have split up the patches slightly differently based on Josh's comments. > > The first patch is basically the platform/44x files. > > Signed-off-by: Sean MacLennan <[EMAIL PROTECTED]>
> No comments? I really thought I would get raked over the coals for this one. Ah ha! A challenge! :-) > +++ arch/powerpc/platforms/44x/warp.c 2008-01-08 17:59:48.000000000 -0500 > +void warp_set_power_leds(int green, int red) > +{ > + static void *gpio_base = NULL; > + unsigned leds; > + > + if(gpio_base == NULL) { ^ space, please > + if((gpio_base = ioremap(WARP_GPIO_BASE, 0x148)) == NULL) { and again. Also split the assignment from the test. > + printk("ERROR: Unable to remap GPIO base.\n"); > + return; > + } > + } > + > + leds = readl(gpio_base + 0x100); > + > + switch(green) { space > + case 0: leds &= ~0x80; break; > + case 1: leds |= 0x80; break; > + } > + switch(red) { again > + case 0: leds &= ~0x40; break; > + case 1: leds |= 0x40; break; > + } > + > + writel(leds, gpio_base + 0x100); > +} > +EXPORT_SYMBOL(warp_set_power_leds); > + > + > +static int pika_dtm_thread(void *fpga) > +{ > + extern int ad7414_get_temp(int index); no externs in C code - put it in a header file. > + > + while(!kthread_should_stop()) { space > +static int __devinit warp_fpga_init(void) > +{ > + struct device_node *np; > + void *fpga; > + int irq; > + struct resource res; > + struct task_struct *dtm_thread; > + > + if((np = of_find_compatible_node(NULL, NULL, "pika,fpga")) == NULL) { space and split the assignment from the test. > + printk(KERN_ERR __FILE__ ": Unable to find fpga\n"); > + return -ENOENT; > + } > + > + if((irq = irq_of_parse_and_map(np, 0)) == NO_IRQ) { again > + printk(KERN_ERR __FILE__ ": irq_of_parse_and_map failed\n"); > + return -EBUSY; > + } > + > + /* We do not call of_iomap here since it would map in the entire > + * fpga space, which is over 8k. > + */ > + if(of_address_to_resource(np, 0, &res) || > + (fpga = ioremap(res.start, 0x24)) == NULL) { and again > + printk(KERN_ERR __FILE__ ": Unable to map FPGA\n"); > + return -ENOENT; > + } > + > + /* Turn off the line LEDs */ > + out_be32(fpga + 8, 0); > + > + dtm_thread = kthread_run(pika_dtm_thread, fpga + 0x20, "pika-dtm"); > + > + if(IS_ERR(dtm_thread)) { space enough? :-) -- Cheers, Stephen Rothwell [EMAIL PROTECTED] http://www.canb.auug.org.au/~sfr/
pgpFpiSuuBHmo.pgp
Description: PGP signature
_______________________________________________ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev