From: Simon Glass Date: Mon, 29 Feb 2016 22:25:42 +0000 (-0700) Subject: dm: blk: Rename get_dev() to blk_get_dev() X-Git-Tag: v2016.05-rc1~420^2~28 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=db1d9e78e6f0ea51a698f18abe4cebc5ff39b691;p=u-boot dm: blk: Rename get_dev() to blk_get_dev() The current name is too generic. Add a 'blk_' prefix to aid searching and make its purpose clearer. Signed-off-by: Simon Glass Reviewed-by: Bin Meng Tested-by: Stephen Warren --- diff --git a/api/api_storage.c b/api/api_storage.c index 225a6cf10f..8c30c56e49 100644 --- a/api/api_storage.c +++ b/api/api_storage.c @@ -106,7 +106,7 @@ static int dev_stor_get(int type, int first, int *more, struct device_info *di) struct blk_desc *dd; if (first) { - di->cookie = (void *)get_dev(specs[type].name, 0); + di->cookie = (void *)blk_get_dev(specs[type].name, 0); if (di->cookie == NULL) return 0; else @@ -119,7 +119,8 @@ static int dev_stor_get(int type, int first, int *more, struct device_info *di) } else { for (i = 0; i < specs[type].max_dev; i++) - if (di->cookie == (void *)get_dev(specs[type].name, i)) { + if (di->cookie == + (void *)blk_get_dev(specs[type].name, i)) { /* previous cookie found -- advance to the * next device, if possible */ @@ -129,7 +130,8 @@ static int dev_stor_get(int type, int first, int *more, struct device_info *di) break; } - di->cookie = (void *)get_dev(specs[type].name, i); + di->cookie = (void *)blk_get_dev( + specs[type].name, i); if (di->cookie == NULL) return 0; else @@ -174,7 +176,7 @@ static int dev_stor_type(struct blk_desc *dd) for (i = ENUM_IDE; i < ENUM_MAX; i++) for (j = 0; j < specs[i].max_dev; j++) - if (dd == get_dev(specs[i].name, j)) + if (dd == blk_get_dev(specs[i].name, j)) return i; return ENUM_MAX; @@ -313,7 +315,7 @@ static int dev_stor_is_valid(int type, struct blk_desc *dd) int i; for (i = 0; i < specs[type].max_dev; i++) - if (dd == get_dev(specs[type].name, i)) + if (dd == blk_get_dev(specs[type].name, i)) if (dd->type != DEV_TYPE_UNKNOWN) return 1; diff --git a/cmd/gpt.c b/cmd/gpt.c index 881367c095..8ffaef30f5 100644 --- a/cmd/gpt.c +++ b/cmd/gpt.c @@ -418,7 +418,7 @@ static int do_gpt(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) printf("'%s' is not a number\n", argv[3]); return CMD_RET_USAGE; } - blk_dev_desc = get_dev(argv[2], dev); + blk_dev_desc = blk_get_dev(argv[2], dev); if (!blk_dev_desc) { printf("%s: %s dev %d NOT available\n", __func__, argv[2], dev); diff --git a/cmd/read.c b/cmd/read.c index 6a1e1d9e2d..12ac165986 100644 --- a/cmd/read.c +++ b/cmd/read.c @@ -39,7 +39,7 @@ int do_read(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) part = (int)simple_strtoul(++ep, NULL, 16); } - dev_desc = get_dev(argv[1], dev); + dev_desc = blk_get_dev(argv[1], dev); if (dev_desc == NULL) { printf("Block device %s %d not supported\n", argv[1], dev); return 1; diff --git a/common/fb_mmc.c b/common/fb_mmc.c index fd4308530f..4324f5805c 100644 --- a/common/fb_mmc.c +++ b/common/fb_mmc.c @@ -106,7 +106,7 @@ void fb_mmc_flash_write(const char *cmd, unsigned int session_id, /* initialize the response buffer */ response_str = response; - dev_desc = get_dev("mmc", CONFIG_FASTBOOT_FLASH_MMC_DEV); + dev_desc = blk_get_dev("mmc", CONFIG_FASTBOOT_FLASH_MMC_DEV); if (!dev_desc || dev_desc->type == DEV_TYPE_UNKNOWN) { error("invalid mmc device\n"); fastboot_fail(response_str, "invalid mmc device"); @@ -179,7 +179,7 @@ void fb_mmc_erase(const char *cmd, char *response) /* initialize the response buffer */ response_str = response; - dev_desc = get_dev("mmc", CONFIG_FASTBOOT_FLASH_MMC_DEV); + dev_desc = blk_get_dev("mmc", CONFIG_FASTBOOT_FLASH_MMC_DEV); if (!dev_desc || dev_desc->type == DEV_TYPE_UNKNOWN) { error("invalid mmc device"); fastboot_fail(response_str, "invalid mmc device"); diff --git a/disk/part.c b/disk/part.c index 7f98d89115..2466c3ea96 100644 --- a/disk/part.c +++ b/disk/part.c @@ -101,7 +101,7 @@ static struct blk_desc *get_dev_hwpart(const char *ifname, int dev, int hwpart) return NULL; } -struct blk_desc *get_dev(const char *ifname, int dev) +struct blk_desc *blk_get_dev(const char *ifname, int dev) { return get_dev_hwpart(ifname, dev, 0); } @@ -111,7 +111,7 @@ struct blk_desc *get_dev_hwpart(const char *ifname, int dev, int hwpart) return NULL; } -struct blk_desc *get_dev(const char *ifname, int dev) +struct blk_desc *blk_get_dev(const char *ifname, int dev) { return NULL; } diff --git a/include/part.h b/include/part.h index 4e70d8dba2..ddc4422588 100644 --- a/include/part.h +++ b/include/part.h @@ -54,7 +54,7 @@ typedef struct disk_partition { /* Misc _get_dev functions */ #ifdef CONFIG_PARTITIONS /** - * get_dev() - get a pointer to a block device given its type and number + * blk_get_dev() - get a pointer to a block device given its type and number * * Each interface allocates its own devices and typically struct blk_desc is * contained with the interface's data structure. There is no global @@ -66,7 +66,7 @@ typedef struct disk_partition { * @return pointer to the block device, or NULL if not available, or an * error occurred. */ -struct blk_desc *get_dev(const char *ifname, int dev); +struct blk_desc *blk_get_dev(const char *ifname, int dev); struct blk_desc *ide_get_dev(int dev); struct blk_desc *sata_get_dev(int dev); struct blk_desc *scsi_get_dev(int dev); @@ -107,7 +107,7 @@ int get_device_and_partition(const char *ifname, const char *dev_part_str, struct blk_desc **dev_desc, disk_partition_t *info, int allow_whole_dev); #else -static inline struct blk_desc *get_dev(const char *ifname, int dev) +static inline struct blk_desc *blk_get_dev(const char *ifname, int dev) { return NULL; } static inline struct blk_desc *ide_get_dev(int dev) { return NULL; } static inline struct blk_desc *sata_get_dev(int dev) { return NULL; }