Lines Matching refs:id
279 sprintf(buf, "%s%d,%d", MTD_DEV_TYPE(current_mtd_dev->id->type), in current_save()
280 current_mtd_dev->id->num, current_mtd_partnum); in current_save()
328 static int part_validate_eraseblock(struct mtdids *id, struct part_info *part) in part_validate_eraseblock() argument
335 if (get_mtd_info(id->type, id->num, &mtd)) in part_validate_eraseblock()
349 MTD_DEV_TYPE(id->type), id->num, part->name); in part_validate_eraseblock()
356 MTD_DEV_TYPE(id->type), id->num, part->name); in part_validate_eraseblock()
376 MTD_DEV_TYPE(id->type), id->num, part->name); in part_validate_eraseblock()
395 MTD_DEV_TYPE(id->type), id->num, part->name); in part_validate_eraseblock()
415 static int part_validate(struct mtdids *id, struct part_info *part) in part_validate() argument
418 part->size = id->size - part->offset; in part_validate()
420 if (part->offset > id->size) { in part_validate()
422 id->mtd_id, part->offset, id->size); in part_validate()
428 MTD_DEV_TYPE(id->type), id->num, part->name); in part_validate()
432 if (part->offset + part->size > id->size) { in part_validate()
433 printf("%s: partitioning exceeds flash size\n", id->mtd_id); in part_validate()
441 return part_validate_eraseblock(id, part); in part_validate()
582 if (part_validate(dev->id, part) != 0) in part_add()
801 if ((dev_tmp->id->type == type) && (dev_tmp->id->num == num)) in device_find()
844 struct mtdids *id; in device_parse() local
873 if ((id = id_find_by_mtd_id(mtd_id, mtd_id_len - 1)) == NULL) { in device_parse()
880 id->type, MTD_DEV_TYPE(id->type), in device_parse()
881 id->num, id->mtd_id); in device_parse()
888 if ((dev = device_find(id->type, id->num)) != NULL) { in device_parse()
906 if (part_validate(id, part) != 0) in device_parse()
945 dev->id = id; in device_parse()
988 struct mtdids *id; in id_find() local
991 id = list_entry(entry, struct mtdids, link); in id_find()
993 if ((id->type == type) && (id->num == num)) in id_find()
994 return id; in id_find()
1012 struct mtdids *id; in id_find_by_mtd_id() local
1018 id = list_entry(entry, struct mtdids, link); in id_find_by_mtd_id()
1021 id->mtd_id, strlen(id->mtd_id)); in id_find_by_mtd_id()
1023 if (mtd_id_len != strlen(id->mtd_id)) in id_find_by_mtd_id()
1025 if (strncmp(id->mtd_id, mtd_id, mtd_id_len) == 0) in id_find_by_mtd_id()
1026 return id; in id_find_by_mtd_id()
1042 int mtd_id_parse(const char *id, const char **ret_id, u8 *dev_type, in mtd_id_parse() argument
1045 const char *p = id; in mtd_id_parse()
1061 printf("incorrect device type in %s\n", id); in mtd_id_parse()
1066 printf("incorrect device number in %s\n", id); in mtd_id_parse()
1106 len = strlen(dev->id->mtd_id) + 1; in generate_mtdparts()
1109 memcpy(p, dev->id->mtd_id, len - 1); in generate_mtdparts()
1261 if (get_mtd_info(dev->id->type, dev->id->num, &mtd))
1265 MTD_DEV_TYPE(dev->id->type), dev->id->num,
1266 dev->id->mtd_id, dev->num_parts);
1282 MTD_DEV_TYPE(dev->id->type), dev->id->num,
1283 dev->id->mtd_id, dev->num_parts);
1316 MTD_DEV_TYPE(current_mtd_dev->id->type),
1317 current_mtd_dev->id->num, current_mtd_partnum,
1347 int find_dev_and_part(const char *id, struct mtd_device **dev, argument
1354 debug("--- find_dev_and_part ---\nid = %s\n", id);
1361 if (strcmp((*part)->name, id) == 0)
1367 p = id;
1407 static int delete_partition(const char *id) argument
1413 if (find_dev_and_part(id, &dev, &pnum, &part) == 0) {
1416 MTD_DEV_TYPE(dev->id->type), dev->id->num, pnum,
1429 printf("partition %s not found\n", id);
1495 if (get_mtd_info(dev->id->type, dev->id->num, &mtd))
1505 MTD_DEV_TYPE(dev->id->type), dev->id->num,
1581 debug("+ device: %s\t%d\t%s\n", MTD_DEV_TYPE(dev->id->type),
1582 dev->id->num, dev->id->mtd_id);
1585 if (device_find(dev->id->type, dev->id->num) != NULL) {
1587 MTD_DEV_TYPE(dev->id->type), dev->id->num);
1615 struct mtdids *id; local
1680 if (!(id = (struct mtdids *)malloc(sizeof(struct mtdids) + mtd_id_len))) {
1684 memset(id, 0, sizeof(struct mtdids) + mtd_id_len);
1685 id->num = num;
1686 id->type = type;
1687 id->size = size;
1688 id->mtd_id = (char *)(id + 1);
1689 strncpy(id->mtd_id, mtd_id, mtd_id_len - 1);
1690 id->mtd_id[mtd_id_len - 1] = '\0';
1691 INIT_LIST_HEAD(&id->link);
1694 MTD_DEV_TYPE(id->type), id->num,
1695 id->size, id->mtd_id);
1697 list_add_tail(&id->link, &mtdids);
1829 MTD_DEV_TYPE(current_mtd_dev->id->type),
1830 current_mtd_dev->id->num, current_mtd_partnum);
1880 part_num, MTD_DEV_TYPE(dev->id->type),
1881 dev->id->num, dev->id->mtd_id);
1885 part_num, MTD_DEV_TYPE(dev->id->type),
1886 dev->id->num, dev->id->mtd_id);
1940 MTD_DEV_TYPE(dev->id->type), dev->id->num, pnum);
1998 struct mtdids *id; local
2004 if ((id = id_find(type, num)) == NULL) {
2009 len = strlen(id->mtd_id) + 1; /* 'mtd_id:' */
2020 id->mtd_id, argv[3], argv[4], argv[5] ? argv[5] : "");
2026 debug("+ %s\t%d\t%s\n", MTD_DEV_TYPE(dev->id->type),
2027 dev->id->num, dev->id->mtd_id);
2032 if (get_mtd_info(dev->id->type, dev->id->num, &mtd))
2041 dev_tmp = device_find(dev->id->type, dev->id->num);