On Thu, Jan 14, 2010 at 22:24, <[email protected]> wrote:
> Revision 8168 Author bhsong Date 2010-01-14 22:24:39 -0500 (Thu, 14 Jan
> 2010)
>
> Log Message
>
> mtd-physmap: add support users can assign the probe type in board files
>
> Modified: trunk/drivers/mtd/maps/physmap.c (8167 => 8168)
>
> probe_type = rom_probe_types;
> - for (; info->mtd[i] == NULL && *probe_type != NULL;
> probe_type++)
> + for (; info->mtd[i] == NULL && *probe_type != NULL;
> probe_type++) {
> + if (info->probe_type != NULL)
> + if (strcmp(info->probe_type, *probe_type) != 0)
> + continue;
> info->mtd[i] = do_map_probe(*probe_type, &info->map[i]);
> + }
this prevents people from putting a probe type into the board which
isnt already listed in the physmap driver. how about doing the NULL
check up front:
if (info->probe_type == NULL) {
for (; info->mtd[i] == NULL && *probe_type != NULL;
probe_type++)
info->mtd[i] = do_map_probe(*probe_type, &info->map[i]);
} else
info->mtd[i] = do_map_probe(info->probe_type, &info->map[i]);
this also gets rid of the redundant ptr/strcmp checks
-mike
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits