{
struct mtdids *id = current_part->dev->id;
+ switch(id->type) {
#if defined(CONFIG_CMD_FLASH)
- if (id->type == MTD_DEV_TYPE_NOR) {
+ case MTD_DEV_TYPE_NOR:
return get_fl_mem_nor(off, size, ext_buf);
- }
+ break;
#endif
-
#if defined(CONFIG_JFFS2_NAND) && defined(CONFIG_CMD_NAND)
- if (id->type == MTD_DEV_TYPE_NAND)
+ case MTD_DEV_TYPE_NAND:
return get_fl_mem_nand(off, size, ext_buf);
+ break;
#endif
-
#if defined(CONFIG_CMD_ONENAND)
- if (id->type == MTD_DEV_TYPE_ONENAND)
+ case MTD_DEV_TYPE_ONENAND:
return get_fl_mem_onenand(off, size, ext_buf);
+ break;
#endif
-
- printf("get_fl_mem: unknown device type, using raw offset!\n");
+ default:
+ printf("get_fl_mem: unknown device type, " \
+ "using raw offset!\n");
+ }
return (void*)off;
}
{
struct mtdids *id = current_part->dev->id;
+ switch(id->type) {
#if defined(CONFIG_CMD_FLASH)
- if (id->type == MTD_DEV_TYPE_NOR)
+ case MTD_DEV_TYPE_NOR:
return get_node_mem_nor(off, ext_buf);
+ break;
#endif
-
#if defined(CONFIG_JFFS2_NAND) && \
defined(CONFIG_CMD_NAND)
- if (id->type == MTD_DEV_TYPE_NAND)
+ case MTD_DEV_TYPE_NAND:
return get_node_mem_nand(off, ext_buf);
+ break;
#endif
-
#if defined(CONFIG_CMD_ONENAND)
- if (id->type == MTD_DEV_TYPE_ONENAND)
+ case MTD_DEV_TYPE_ONENAND:
return get_node_mem_onenand(off, ext_buf);
+ break;
#endif
-
- printf("get_node_mem: unknown device type, using raw offset!\n");
+ default:
+ printf("get_fl_mem: unknown device type, " \
+ "using raw offset!\n");
+ }
return (void*)off;
}