disk: part: add interface to get partition type
Change-Id: I69894f5e4ce03909a8290e941d8808593d027080 Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
This commit is contained in:
parent
61184b8f14
commit
df2027612e
13
disk/part.c
13
disk/part.c
|
|
@ -319,6 +319,19 @@ void part_print(struct blk_desc *dev_desc)
|
|||
drv->print(dev_desc);
|
||||
}
|
||||
|
||||
const char *part_get_type(struct blk_desc *dev_desc)
|
||||
{
|
||||
struct part_driver *drv;
|
||||
|
||||
drv = part_driver_lookup_type(dev_desc);
|
||||
if (!drv) {
|
||||
printf("## Unknown partition table type %x\n",
|
||||
dev_desc->part_type);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return drv->name;
|
||||
}
|
||||
#endif /* HAVE_BLOCK_DEVICE */
|
||||
|
||||
int part_get_info(struct blk_desc *dev_desc, int part,
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ int part_get_info(struct blk_desc *dev_desc, int part, disk_partition_t *info);
|
|||
* a partition occupying the entire disk.
|
||||
*/
|
||||
int part_get_info_whole_disk(struct blk_desc *dev_desc, disk_partition_t *info);
|
||||
|
||||
const char *part_get_type(struct blk_desc *dev_desc);
|
||||
void part_print(struct blk_desc *dev_desc);
|
||||
void part_init(struct blk_desc *dev_desc);
|
||||
void dev_print(struct blk_desc *dev_desc);
|
||||
|
|
@ -214,6 +214,8 @@ static inline int part_get_info(struct blk_desc *dev_desc, int part,
|
|||
static inline int part_get_info_whole_disk(struct blk_desc *dev_desc,
|
||||
disk_partition_t *info)
|
||||
{ return -1; }
|
||||
|
||||
static inline const char *part_get_type(struct blk_desc *dev_desc) { return NULL; }
|
||||
static inline void part_print(struct blk_desc *dev_desc) {}
|
||||
static inline void part_init(struct blk_desc *dev_desc) {}
|
||||
static inline void dev_print(struct blk_desc *dev_desc) {}
|
||||
|
|
|
|||
Loading…
Reference in New Issue