On Thu, Jan 14, 2010 at 23:35, Song, Barry wrote: >>From: Mike Frysinger [mailto:[email protected]] >>On Thu, Jan 14, 2010 at 23:01, Song, Barry wrote: >>>From: Mike Frysinger [mailto:[email protected]] >>>>On Thu, Jan 14, 2010 at 22:24, <[email protected]> wrote: >>>>> Revision 8168 Author bhsong Date 2010-01-14 22:24:39 -0500 >>>>> >>>>> 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 >>> This patch is fine to me. But if there is a new probe which is not >>> listed in physmap, it should be added to the list to permit users to >>> detect. >> >>there's already probe types not listed there. then again, what you >>want to do can already be accomplished with the plat-ram driver. so >>why not use that instead. > > I don't think ram driver is not a right choice for a real flash. Its write > and erase is fake.
i mean when we're doing a ROM kernel. the plat-ram driver lets you specify a specific probe type (mtd-rom) which lets you disable write/erase funcs. a flash doing kernel XIP shouldnt be allowed to write/erase any sector. -mike _______________________________________________ Linux-kernel-commits mailing list [email protected] https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits
