Re: [PATCH] Soekris net5501 board support code

From: Andrew Morton
Date: Fri Feb 06 2009 - 18:22:34 EST


On Thu, 5 Feb 2009 16:13:19 +0100
Alessandro Zummo <alessandro.zummo@xxxxxxxxxxxx> wrote:

> +static int __init soekris_init(void)
> +{
> + int i;
> + unsigned char *rombase, *bios;
> +
> + if (!is_geode() || geode_has_vsa2())
> + return 0;
> +
> + rombase = ioremap(0xffff0000, 0xffff);
> + if (!rombase)
> + return 0;

Is it appropriate to silently "succeed" if the ioremap() failed?

> + bios = rombase + 0x20; /* null terminated */
> +
> + if (strncmp(bios, "comBIOS", 7))
> + goto unmap;
> +
> + for (i = 0; i < ARRAY_SIZE(boards); i++) {
> + unsigned char *model = rombase + boards[i].offset;
> +
> + if (strncmp(model, boards[i].sig, boards[i].len) == 0) {
> + printk(KERN_INFO "Soekris %s: %s\n", model, bios);
> +
> + if (boards[i].init)
> + boards[i].init();
> + break;
> + }
> + }
> +
> +unmap:
> + iounmap(rombase);
> + return 0;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/