mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-06-26 16:41:42 +00:00
dm: part: Use the legacy block driver for hardware partition support
Drop use of the table in part.c for this feature. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
cd0fb55b64
commit
1fde473da7
1 changed files with 1 additions and 11 deletions
12
disk/part.c
12
disk/part.c
|
@ -71,9 +71,7 @@ static struct part_driver *part_driver_lookup_type(int part_type)
|
||||||
static struct blk_desc *get_dev_hwpart(const char *ifname, int dev, int hwpart)
|
static struct blk_desc *get_dev_hwpart(const char *ifname, int dev, int hwpart)
|
||||||
{
|
{
|
||||||
const struct block_drvr *drvr = block_drvr;
|
const struct block_drvr *drvr = block_drvr;
|
||||||
int (*select_hwpart)(int dev_num, int hwpart);
|
|
||||||
char *name;
|
char *name;
|
||||||
int ret;
|
|
||||||
|
|
||||||
if (!ifname)
|
if (!ifname)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -84,11 +82,8 @@ static struct blk_desc *get_dev_hwpart(const char *ifname, int dev, int hwpart)
|
||||||
#endif
|
#endif
|
||||||
while (drvr->name) {
|
while (drvr->name) {
|
||||||
name = drvr->name;
|
name = drvr->name;
|
||||||
select_hwpart = drvr->select_hwpart;
|
|
||||||
#ifdef CONFIG_NEEDS_MANUAL_RELOC
|
#ifdef CONFIG_NEEDS_MANUAL_RELOC
|
||||||
name += gd->reloc_off;
|
name += gd->reloc_off;
|
||||||
if (select_hwpart)
|
|
||||||
select_hwpart += gd->reloc_off;
|
|
||||||
#endif
|
#endif
|
||||||
if (strncmp(ifname, name, strlen(name)) == 0) {
|
if (strncmp(ifname, name, strlen(name)) == 0) {
|
||||||
struct blk_desc *dev_desc;
|
struct blk_desc *dev_desc;
|
||||||
|
@ -96,12 +91,7 @@ static struct blk_desc *get_dev_hwpart(const char *ifname, int dev, int hwpart)
|
||||||
dev_desc = blk_get_devnum_by_typename(name, dev);
|
dev_desc = blk_get_devnum_by_typename(name, dev);
|
||||||
if (!dev_desc)
|
if (!dev_desc)
|
||||||
return NULL;
|
return NULL;
|
||||||
if (hwpart == 0 && !select_hwpart)
|
if (blk_dselect_hwpart(dev_desc, hwpart))
|
||||||
return dev_desc;
|
|
||||||
if (!select_hwpart)
|
|
||||||
return NULL;
|
|
||||||
ret = select_hwpart(dev_desc->devnum, hwpart);
|
|
||||||
if (ret < 0)
|
|
||||||
return NULL;
|
return NULL;
|
||||||
return dev_desc;
|
return dev_desc;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue