blk: Rename if_type to uclass_id
Use the word 'uclass' instead of 'if_type' to complete the conversion.
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/drivers/ata/sata.c b/drivers/ata/sata.c
index 604c721..ce3e9b5 100644
--- a/drivers/ata/sata.c
+++ b/drivers/ata/sata.c
@@ -79,7 +79,7 @@
for (i = 0; i < CONFIG_SYS_SATA_MAX_DEVICE; i++) {
memset(&sata_dev_desc[i], 0, sizeof(struct blk_desc));
- sata_dev_desc[i].if_type = UCLASS_AHCI;
+ sata_dev_desc[i].uclass_id = UCLASS_AHCI;
sata_dev_desc[i].devnum = i;
sata_dev_desc[i].part_type = PART_TYPE_UNKNOWN;
sata_dev_desc[i].type = DEV_TYPE_HARDDISK;
diff --git a/drivers/block/blk-uclass.c b/drivers/block/blk-uclass.c
index a9a85aa..7d12d54 100644
--- a/drivers/block/blk-uclass.c
+++ b/drivers/block/blk-uclass.c
@@ -20,7 +20,7 @@
static struct {
enum uclass_id id;
const char *name;
-} if_typename_str[] = {
+} uclass_idname_str[] = {
{ UCLASS_IDE, "ide" },
{ UCLASS_SCSI, "scsi" },
{ UCLASS_USB, "usb" },
@@ -34,19 +34,19 @@
{ UCLASS_PVBLOCK, "pvblock" },
};
-static enum uclass_id if_typename_to_iftype(const char *if_typename)
+static enum uclass_id uclass_name_to_iftype(const char *uclass_idname)
{
int i;
- for (i = 0; i < ARRAY_SIZE(if_typename_str); i++) {
- if (!strcmp(if_typename, if_typename_str[i].name))
- return if_typename_str[i].id;
+ for (i = 0; i < ARRAY_SIZE(uclass_idname_str); i++) {
+ if (!strcmp(uclass_idname, uclass_idname_str[i].name))
+ return uclass_idname_str[i].id;
}
return UCLASS_INVALID;
}
-static enum uclass_id if_type_to_uclass_id(enum uclass_id if_type)
+static enum uclass_id conv_uclass_id(enum uclass_id uclass_id)
{
/*
* This strange adjustment is used because we use UCLASS_MASS_STORAGE
@@ -65,31 +65,30 @@
* - rename UCLASS_USB name to "usb_ctlr"
* - use UCLASS_MASS_STORAGE instead of UCLASS_USB in if_typename_str
*/
- if (if_type == UCLASS_USB)
+ if (uclass_id == UCLASS_USB)
return UCLASS_MASS_STORAGE;
-
- return if_type;
+ return uclass_id;
}
-const char *blk_get_if_type_name(enum uclass_id if_type)
+const char *blk_get_uclass_name(enum uclass_id uclass_id)
{
int i;
- for (i = 0; i < ARRAY_SIZE(if_typename_str); i++) {
- if (if_typename_str[i].id == if_type)
- return if_typename_str[i].name;
+ for (i = 0; i < ARRAY_SIZE(uclass_idname_str); i++) {
+ if (uclass_idname_str[i].id == uclass_id)
+ return uclass_idname_str[i].name;
}
return "(none)";
}
-struct blk_desc *blk_get_devnum_by_type(enum uclass_id if_type, int devnum)
+struct blk_desc *blk_get_devnum_by_uclass_id(enum uclass_id uclass_id, int devnum)
{
struct blk_desc *desc;
struct udevice *dev;
int ret;
- ret = blk_get_device(if_type, devnum, &dev);
+ ret = blk_get_device(uclass_id, devnum, &dev);
if (ret)
return NULL;
desc = dev_get_uclass_plat(dev);
@@ -102,7 +101,7 @@
* name in a local table. This gives us an interface type which we can match
* against the uclass of the block device's parent.
*/
-struct blk_desc *blk_get_devnum_by_typename(const char *if_typename, int devnum)
+struct blk_desc *blk_get_devnum_by_uclass_idname(const char *uclass_idname, int devnum)
{
enum uclass_id uclass_id;
enum uclass_id type;
@@ -110,16 +109,16 @@
struct uclass *uc;
int ret;
- type = if_typename_to_iftype(if_typename);
+ type = uclass_name_to_iftype(uclass_idname);
if (type == UCLASS_INVALID) {
debug("%s: Unknown interface type '%s'\n", __func__,
- if_typename);
+ uclass_idname);
return NULL;
}
- uclass_id = if_type_to_uclass_id(type);
+ uclass_id = conv_uclass_id(type);
if (uclass_id == UCLASS_INVALID) {
debug("%s: Unknown uclass for interface type'\n",
- blk_get_if_type_name(type));
+ blk_get_uclass_name(type));
return NULL;
}
@@ -129,8 +128,8 @@
uclass_foreach_dev(dev, uc) {
struct blk_desc *desc = dev_get_uclass_plat(dev);
- debug("%s: if_type=%d, devnum=%d: %s, %d, %d\n", __func__,
- type, devnum, dev->name, desc->if_type, desc->devnum);
+ debug("%s: uclass_id=%d, devnum=%d: %s, %d, %d\n", __func__,
+ type, devnum, dev->name, desc->uclass_id, desc->devnum);
if (desc->devnum != devnum)
continue;
@@ -178,14 +177,14 @@
/**
* get_desc() - Get the block device descriptor for the given device number
*
- * @if_type: Interface type
+ * @uclass_id: Interface type
* @devnum: Device number (0 = first)
* @descp: Returns block device descriptor on success
* Return: 0 on success, -ENODEV if there is no such device and no device
* with a higher device number, -ENOENT if there is no such device but there
* is one with a higher number, or other -ve on other error.
*/
-static int get_desc(enum uclass_id if_type, int devnum, struct blk_desc **descp)
+static int get_desc(enum uclass_id uclass_id, int devnum, struct blk_desc **descp)
{
bool found_more = false;
struct udevice *dev;
@@ -199,9 +198,9 @@
uclass_foreach_dev(dev, uc) {
struct blk_desc *desc = dev_get_uclass_plat(dev);
- debug("%s: if_type=%d, devnum=%d: %s, %d, %d\n", __func__,
- if_type, devnum, dev->name, desc->if_type, desc->devnum);
- if (desc->if_type == if_type) {
+ debug("%s: uclass_id=%d, devnum=%d: %s, %d, %d\n", __func__,
+ uclass_id, devnum, dev->name, desc->uclass_id, desc->devnum);
+ if (desc->uclass_id == uclass_id) {
if (desc->devnum == devnum) {
ret = device_probe(dev);
if (ret)
@@ -218,26 +217,26 @@
return found_more ? -ENOENT : -ENODEV;
}
-int blk_select_hwpart_devnum(enum uclass_id if_type, int devnum, int hwpart)
+int blk_select_hwpart_devnum(enum uclass_id uclass_id, int devnum, int hwpart)
{
struct udevice *dev;
int ret;
- ret = blk_get_device(if_type, devnum, &dev);
+ ret = blk_get_device(uclass_id, devnum, &dev);
if (ret)
return ret;
return blk_select_hwpart(dev, hwpart);
}
-int blk_list_part(enum uclass_id if_type)
+int blk_list_part(enum uclass_id uclass_id)
{
struct blk_desc *desc;
int devnum, ok;
int ret;
for (ok = 0, devnum = 0;; ++devnum) {
- ret = get_desc(if_type, devnum, &desc);
+ ret = get_desc(uclass_id, devnum, &desc);
if (ret == -ENODEV)
break;
else if (ret)
@@ -255,12 +254,12 @@
return 0;
}
-int blk_print_part_devnum(enum uclass_id if_type, int devnum)
+int blk_print_part_devnum(enum uclass_id uclass_id, int devnum)
{
struct blk_desc *desc;
int ret;
- ret = get_desc(if_type, devnum, &desc);
+ ret = get_desc(uclass_id, devnum, &desc);
if (ret)
return ret;
if (desc->type == DEV_TYPE_UNKNOWN)
@@ -270,14 +269,14 @@
return 0;
}
-void blk_list_devices(enum uclass_id if_type)
+void blk_list_devices(enum uclass_id uclass_id)
{
struct blk_desc *desc;
int ret;
int i;
for (i = 0;; ++i) {
- ret = get_desc(if_type, i, &desc);
+ ret = get_desc(uclass_id, i, &desc);
if (ret == -ENODEV)
break;
else if (ret)
@@ -289,12 +288,12 @@
}
}
-int blk_print_device_num(enum uclass_id if_type, int devnum)
+int blk_print_device_num(enum uclass_id uclass_id, int devnum)
{
struct blk_desc *desc;
int ret;
- ret = get_desc(if_type, devnum, &desc);
+ ret = get_desc(uclass_id, devnum, &desc);
if (ret)
return ret;
printf("\nIDE device %d: ", devnum);
@@ -303,13 +302,13 @@
return 0;
}
-int blk_show_device(enum uclass_id if_type, int devnum)
+int blk_show_device(enum uclass_id uclass_id, int devnum)
{
struct blk_desc *desc;
int ret;
printf("\nDevice %d: ", devnum);
- ret = get_desc(if_type, devnum, &desc);
+ ret = get_desc(uclass_id, devnum, &desc);
if (ret == -ENODEV || ret == -ENOENT) {
printf("unknown device\n");
return -ENODEV;
@@ -324,14 +323,14 @@
return 0;
}
-ulong blk_read_devnum(enum uclass_id if_type, int devnum, lbaint_t start,
+ulong blk_read_devnum(enum uclass_id uclass_id, int devnum, lbaint_t start,
lbaint_t blkcnt, void *buffer)
{
struct blk_desc *desc;
ulong n;
int ret;
- ret = get_desc(if_type, devnum, &desc);
+ ret = get_desc(uclass_id, devnum, &desc);
if (ret)
return ret;
n = blk_dread(desc, start, blkcnt, buffer);
@@ -341,13 +340,13 @@
return n;
}
-ulong blk_write_devnum(enum uclass_id if_type, int devnum, lbaint_t start,
+ulong blk_write_devnum(enum uclass_id uclass_id, int devnum, lbaint_t start,
lbaint_t blkcnt, const void *buffer)
{
struct blk_desc *desc;
int ret;
- ret = get_desc(if_type, devnum, &desc);
+ ret = get_desc(uclass_id, devnum, &desc);
if (ret)
return ret;
return blk_dwrite(desc, start, blkcnt, buffer);
@@ -370,7 +369,7 @@
return blk_select_hwpart(desc->bdev, hwpart);
}
-int blk_first_device(int if_type, struct udevice **devp)
+int blk_first_device(int uclass_id, struct udevice **devp)
{
struct blk_desc *desc;
int ret;
@@ -382,7 +381,7 @@
return -ENODEV;
do {
desc = dev_get_uclass_plat(*devp);
- if (desc->if_type == if_type)
+ if (desc->uclass_id == uclass_id)
return 0;
ret = uclass_find_next_device(devp);
if (ret)
@@ -395,10 +394,10 @@
int blk_next_device(struct udevice **devp)
{
struct blk_desc *desc;
- int ret, if_type;
+ int ret, uclass_id;
desc = dev_get_uclass_plat(*devp);
- if_type = desc->if_type;
+ uclass_id = desc->uclass_id;
do {
ret = uclass_find_next_device(devp);
if (ret)
@@ -406,12 +405,12 @@
if (!*devp)
return -ENODEV;
desc = dev_get_uclass_plat(*devp);
- if (desc->if_type == if_type)
+ if (desc->uclass_id == uclass_id)
return 0;
} while (1);
}
-int blk_find_device(int if_type, int devnum, struct udevice **devp)
+int blk_find_device(int uclass_id, int devnum, struct udevice **devp)
{
struct uclass *uc;
struct udevice *dev;
@@ -423,9 +422,9 @@
uclass_foreach_dev(dev, uc) {
struct blk_desc *desc = dev_get_uclass_plat(dev);
- debug("%s: if_type=%d, devnum=%d: %s, %d, %d\n", __func__,
- if_type, devnum, dev->name, desc->if_type, desc->devnum);
- if (desc->if_type == if_type && desc->devnum == devnum) {
+ debug("%s: uclass_id=%d, devnum=%d: %s, %d, %d\n", __func__,
+ uclass_id, devnum, dev->name, desc->uclass_id, desc->devnum);
+ if (desc->uclass_id == uclass_id && desc->devnum == devnum) {
*devp = dev;
return 0;
}
@@ -434,11 +433,11 @@
return -ENODEV;
}
-int blk_get_device(int if_type, int devnum, struct udevice **devp)
+int blk_get_device(int uclass_id, int devnum, struct udevice **devp)
{
int ret;
- ret = blk_find_device(if_type, devnum, devp);
+ ret = blk_find_device(uclass_id, devnum, devp);
if (ret)
return ret;
@@ -455,12 +454,12 @@
if (!ops->read)
return -ENOSYS;
- if (blkcache_read(block_dev->if_type, block_dev->devnum,
+ if (blkcache_read(block_dev->uclass_id, block_dev->devnum,
start, blkcnt, block_dev->blksz, buffer))
return blkcnt;
blks_read = ops->read(dev, start, blkcnt, buffer);
if (blks_read == blkcnt)
- blkcache_fill(block_dev->if_type, block_dev->devnum,
+ blkcache_fill(block_dev->uclass_id, block_dev->devnum,
start, blkcnt, block_dev->blksz, buffer);
return blks_read;
@@ -475,7 +474,7 @@
if (!ops->write)
return -ENOSYS;
- blkcache_invalidate(block_dev->if_type, block_dev->devnum);
+ blkcache_invalidate(block_dev->uclass_id, block_dev->devnum);
return ops->write(dev, start, blkcnt, buffer);
}
@@ -488,7 +487,7 @@
if (!ops->erase)
return -ENOSYS;
- blkcache_invalidate(block_dev->if_type, block_dev->devnum);
+ blkcache_invalidate(block_dev->uclass_id, block_dev->devnum);
return ops->erase(dev, start, blkcnt);
}
@@ -525,7 +524,7 @@
return uclass_get_name(device_get_uclass_id(parent));
};
-int blk_find_max_devnum(enum uclass_id if_type)
+int blk_find_max_devnum(enum uclass_id uclass_id)
{
struct udevice *dev;
int max_devnum = -ENODEV;
@@ -538,18 +537,18 @@
uclass_foreach_dev(dev, uc) {
struct blk_desc *desc = dev_get_uclass_plat(dev);
- if (desc->if_type == if_type && desc->devnum > max_devnum)
+ if (desc->uclass_id == uclass_id && desc->devnum > max_devnum)
max_devnum = desc->devnum;
}
return max_devnum;
}
-int blk_next_free_devnum(enum uclass_id if_type)
+int blk_next_free_devnum(enum uclass_id uclass_id)
{
int ret;
- ret = blk_find_max_devnum(if_type);
+ ret = blk_find_max_devnum(uclass_id);
if (ret == -ENODEV)
return 0;
if (ret < 0)
@@ -631,7 +630,7 @@
return count;
}
-static int blk_claim_devnum(enum uclass_id if_type, int devnum)
+static int blk_claim_devnum(enum uclass_id uclass_id, int devnum)
{
struct udevice *dev;
struct uclass *uc;
@@ -643,8 +642,8 @@
uclass_foreach_dev(dev, uc) {
struct blk_desc *desc = dev_get_uclass_plat(dev);
- if (desc->if_type == if_type && desc->devnum == devnum) {
- int next = blk_next_free_devnum(if_type);
+ if (desc->uclass_id == uclass_id && desc->devnum == devnum) {
+ int next = blk_next_free_devnum(uclass_id);
if (next < 0)
return next;
@@ -657,7 +656,7 @@
}
int blk_create_device(struct udevice *parent, const char *drv_name,
- const char *name, int if_type, int devnum, int blksz,
+ const char *name, int uclass_id, int devnum, int blksz,
lbaint_t lba, struct udevice **devp)
{
struct blk_desc *desc;
@@ -665,9 +664,9 @@
int ret;
if (devnum == -1) {
- devnum = blk_next_free_devnum(if_type);
+ devnum = blk_next_free_devnum(uclass_id);
} else {
- ret = blk_claim_devnum(if_type, devnum);
+ ret = blk_claim_devnum(uclass_id, devnum);
if (ret < 0 && ret != -ENOENT)
return ret;
}
@@ -677,7 +676,7 @@
if (ret)
return ret;
desc = dev_get_uclass_plat(dev);
- desc->if_type = if_type;
+ desc->uclass_id = uclass_id;
desc->blksz = blksz;
desc->log2blksz = LOG2(desc->blksz);
desc->lba = lba;
@@ -690,7 +689,7 @@
}
int blk_create_devicef(struct udevice *parent, const char *drv_name,
- const char *name, int if_type, int devnum, int blksz,
+ const char *name, int uclass_id, int devnum, int blksz,
lbaint_t lba, struct udevice **devp)
{
char dev_name[30], *str;
@@ -701,7 +700,7 @@
if (!str)
return -ENOMEM;
- ret = blk_create_device(parent, drv_name, str, if_type, devnum,
+ ret = blk_create_device(parent, drv_name, str, uclass_id, devnum,
blksz, lba, devp);
if (ret) {
free(str);
@@ -725,7 +724,7 @@
return ret;
}
-int blk_unbind_all(int if_type)
+int blk_unbind_all(int uclass_id)
{
struct uclass *uc;
struct udevice *dev, *next;
@@ -737,7 +736,7 @@
uclass_foreach_dev_safe(dev, next, uc) {
struct blk_desc *desc = dev_get_uclass_plat(dev);
- if (desc->if_type == if_type) {
+ if (desc->uclass_id == uclass_id) {
ret = device_remove(dev, DM_REMOVE_NORMAL);
if (ret)
return ret;
diff --git a/drivers/block/blk_legacy.c b/drivers/block/blk_legacy.c
index 8c6f9cb..5bf1d04 100644
--- a/drivers/block/blk_legacy.c
+++ b/drivers/block/blk_legacy.c
@@ -9,14 +9,14 @@
#include <part.h>
#include <linux/err.h>
-struct blk_driver *blk_driver_lookup_type(int if_type)
+struct blk_driver *blk_driver_lookup_type(int uclass_id)
{
struct blk_driver *drv = ll_entry_start(struct blk_driver, blk_driver);
const int n_ents = ll_entry_count(struct blk_driver, blk_driver);
struct blk_driver *entry;
for (entry = drv; entry != drv + n_ents; entry++) {
- if (if_type == entry->if_type)
+ if (uclass_id == entry->uclass_id)
return entry;
}
@@ -24,14 +24,14 @@
return NULL;
}
-static struct blk_driver *blk_driver_lookup_typename(const char *if_typename)
+static struct blk_driver *blk_driver_lookup_typename(const char *uclass_idname)
{
struct blk_driver *drv = ll_entry_start(struct blk_driver, blk_driver);
const int n_ents = ll_entry_count(struct blk_driver, blk_driver);
struct blk_driver *entry;
for (entry = drv; entry != drv + n_ents; entry++) {
- if (!strcmp(if_typename, entry->if_typename))
+ if (!strcmp(uclass_idname, entry->uclass_idname))
return entry;
}
@@ -39,11 +39,11 @@
return NULL;
}
-const char *blk_get_if_type_name(enum uclass_id if_type)
+const char *blk_get_uclass_name(enum uclass_id uclass_id)
{
- struct blk_driver *drv = blk_driver_lookup_type(if_type);
+ struct blk_driver *drv = blk_driver_lookup_type(uclass_id);
- return drv ? drv->if_typename : NULL;
+ return drv ? drv->uclass_idname : NULL;
}
/**
@@ -70,14 +70,14 @@
return drv->get_dev(devnum, descp);
}
-int blk_list_part(enum uclass_id if_type)
+int blk_list_part(enum uclass_id uclass_id)
{
struct blk_driver *drv;
struct blk_desc *desc;
int devnum, ok;
bool first = true;
- drv = blk_driver_lookup_type(if_type);
+ drv = blk_driver_lookup_type(uclass_id);
if (!drv)
return -ENOSYS;
for (ok = 0, devnum = 0; devnum < drv->max_devs; ++devnum) {
@@ -97,9 +97,9 @@
return 0;
}
-int blk_print_part_devnum(enum uclass_id if_type, int devnum)
+int blk_print_part_devnum(enum uclass_id uclass_id, int devnum)
{
- struct blk_driver *drv = blk_driver_lookup_type(if_type);
+ struct blk_driver *drv = blk_driver_lookup_type(uclass_id);
struct blk_desc *desc;
int ret;
@@ -115,9 +115,9 @@
return 0;
}
-void blk_list_devices(enum uclass_id if_type)
+void blk_list_devices(enum uclass_id uclass_id)
{
- struct blk_driver *drv = blk_driver_lookup_type(if_type);
+ struct blk_driver *drv = blk_driver_lookup_type(uclass_id);
struct blk_desc *desc;
int i;
@@ -133,9 +133,9 @@
}
}
-int blk_print_device_num(enum uclass_id if_type, int devnum)
+int blk_print_device_num(enum uclass_id uclass_id, int devnum)
{
- struct blk_driver *drv = blk_driver_lookup_type(if_type);
+ struct blk_driver *drv = blk_driver_lookup_type(uclass_id);
struct blk_desc *desc;
int ret;
@@ -144,15 +144,15 @@
ret = get_desc(drv, devnum, &desc);
if (ret)
return ret;
- printf("\n%s device %d: ", drv->if_typename, devnum);
+ printf("\n%s device %d: ", drv->uclass_idname, devnum);
dev_print(desc);
return 0;
}
-int blk_show_device(enum uclass_id if_type, int devnum)
+int blk_show_device(enum uclass_id uclass_id, int devnum)
{
- struct blk_driver *drv = blk_driver_lookup_type(if_type);
+ struct blk_driver *drv = blk_driver_lookup_type(uclass_id);
struct blk_desc *desc;
int ret;
@@ -174,9 +174,9 @@
return 0;
}
-struct blk_desc *blk_get_devnum_by_type(enum uclass_id if_type, int devnum)
+struct blk_desc *blk_get_devnum_by_uclass_id(enum uclass_id uclass_id, int devnum)
{
- struct blk_driver *drv = blk_driver_lookup_type(if_type);
+ struct blk_driver *drv = blk_driver_lookup_type(uclass_id);
struct blk_desc *desc;
if (!drv)
@@ -190,7 +190,7 @@
int blk_dselect_hwpart(struct blk_desc *desc, int hwpart)
{
- struct blk_driver *drv = blk_driver_lookup_type(desc->if_type);
+ struct blk_driver *drv = blk_driver_lookup_type(desc->uclass_id);
if (!drv)
return -ENOSYS;
@@ -200,9 +200,9 @@
return 0;
}
-struct blk_desc *blk_get_devnum_by_typename(const char *if_typename, int devnum)
+struct blk_desc *blk_get_devnum_by_uclass_idname(const char *uclass_idname, int devnum)
{
- struct blk_driver *drv = blk_driver_lookup_typename(if_typename);
+ struct blk_driver *drv = blk_driver_lookup_typename(uclass_idname);
struct blk_desc *desc;
if (!drv)
@@ -214,10 +214,10 @@
return desc;
}
-ulong blk_read_devnum(enum uclass_id if_type, int devnum, lbaint_t start,
+ulong blk_read_devnum(enum uclass_id uclass_id, int devnum, lbaint_t start,
lbaint_t blkcnt, void *buffer)
{
- struct blk_driver *drv = blk_driver_lookup_type(if_type);
+ struct blk_driver *drv = blk_driver_lookup_type(uclass_id);
struct blk_desc *desc;
ulong n;
int ret;
@@ -234,10 +234,10 @@
return n;
}
-ulong blk_write_devnum(enum uclass_id if_type, int devnum, lbaint_t start,
+ulong blk_write_devnum(enum uclass_id uclass_id, int devnum, lbaint_t start,
lbaint_t blkcnt, const void *buffer)
{
- struct blk_driver *drv = blk_driver_lookup_type(if_type);
+ struct blk_driver *drv = blk_driver_lookup_type(uclass_id);
struct blk_desc *desc;
int ret;
@@ -249,9 +249,9 @@
return desc->block_write(desc, start, blkcnt, buffer);
}
-int blk_select_hwpart_devnum(enum uclass_id if_type, int devnum, int hwpart)
+int blk_select_hwpart_devnum(enum uclass_id uclass_id, int devnum, int hwpart)
{
- struct blk_driver *drv = blk_driver_lookup_type(if_type);
+ struct blk_driver *drv = blk_driver_lookup_type(uclass_id);
struct blk_desc *desc;
int ret;
diff --git a/drivers/block/ide.c b/drivers/block/ide.c
index b8840d2..eaa58d8 100644
--- a/drivers/block/ide.c
+++ b/drivers/block/ide.c
@@ -537,7 +537,7 @@
/* Select device
*/
ide_outb(device, ATA_DEV_HD, ATA_LBA | ATA_DEVICE(device));
- dev_desc->if_type = UCLASS_IDE;
+ dev_desc->uclass_id = UCLASS_IDE;
#ifdef CONFIG_ATAPI
retries = 0;
@@ -752,7 +752,7 @@
for (i = 0; i < CONFIG_SYS_IDE_MAXDEVICE; ++i) {
ide_dev_desc[i].type = DEV_TYPE_UNKNOWN;
- ide_dev_desc[i].if_type = UCLASS_IDE;
+ ide_dev_desc[i].uclass_id = UCLASS_IDE;
ide_dev_desc[i].devnum = i;
ide_dev_desc[i].part_type = PART_TYPE_UNKNOWN;
ide_dev_desc[i].blksz = 0;
@@ -1143,8 +1143,8 @@
};
#else
U_BOOT_LEGACY_BLK(ide) = {
- .if_typename = "ide",
- .if_type = UCLASS_IDE,
+ .uclass_idname = "ide",
+ .uclass_id = UCLASS_IDE,
.max_devs = CONFIG_SYS_IDE_MAXDEVICE,
.desc = ide_dev_desc,
};
diff --git a/drivers/block/sandbox.c b/drivers/block/sandbox.c
index 2de12e0..f2aae89 100644
--- a/drivers/block/sandbox.c
+++ b/drivers/block/sandbox.c
@@ -150,7 +150,7 @@
goto err_file;
}
- desc = blk_get_devnum_by_type(UCLASS_ROOT, devnum);
+ desc = blk_get_devnum_by_uclass_id(UCLASS_ROOT, devnum);
desc->removable = removable;
snprintf(desc->vendor, BLK_VEN_SIZE, "U-Boot");
snprintf(desc->product, BLK_PRD_SIZE, "hostfile");
@@ -192,7 +192,7 @@
}
struct blk_desc *blk_dev = &host_dev->blk_dev;
- blk_dev->if_type = UCLASS_ROOT;
+ blk_dev->uclass_id = UCLASS_ROOT;
blk_dev->priv = host_dev;
blk_dev->blksz = 512;
blk_dev->lba = os_lseek(host_dev->fd, 0, OS_SEEK_END) / blk_dev->blksz;
@@ -262,8 +262,8 @@
};
#else
U_BOOT_LEGACY_BLK(sandbox_host) = {
- .if_typename = "host",
- .if_type = UCLASS_ROOT,
+ .uclass_idname = "host",
+ .uclass_id = UCLASS_ROOT,
.max_devs = SANDBOX_HOST_MAX_DEVICES,
.get_dev = host_get_dev_err,
};
diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c
index b1bd4ae..759a6b7 100644
--- a/drivers/mmc/mmc-uclass.c
+++ b/drivers/mmc/mmc-uclass.c
@@ -472,7 +472,7 @@
ret = mmc_switch_part(mmc, hwpart);
if (!ret)
- blkcache_invalidate(desc->if_type, desc->devnum);
+ blkcache_invalidate(desc->uclass_id, desc->devnum);
return ret;
}
diff --git a/drivers/mmc/mmc_legacy.c b/drivers/mmc/mmc_legacy.c
index 4e0891e..a101ee4 100644
--- a/drivers/mmc/mmc_legacy.c
+++ b/drivers/mmc/mmc_legacy.c
@@ -132,7 +132,7 @@
.dsr_imp = 0,
.dsr = 0xffffffff,
.block_dev = {
- .if_type = UCLASS_MMC,
+ .uclass_id = UCLASS_MMC,
.removable = 1,
.devnum = 0,
.block_read = mmc_bread,
@@ -194,7 +194,7 @@
mmc->dsr = 0xffffffff;
/* Setup the universal parts of the block interface just once */
bdesc = mmc_get_blk_desc(mmc);
- bdesc->if_type = UCLASS_MMC;
+ bdesc->uclass_id = UCLASS_MMC;
bdesc->removable = 1;
bdesc->devnum = mmc_get_next_devnum();
bdesc->block_read = mmc_bread;
@@ -253,8 +253,8 @@
}
U_BOOT_LEGACY_BLK(mmc) = {
- .if_typename = "mmc",
- .if_type = UCLASS_MMC,
+ .uclass_idname = "mmc",
+ .uclass_id = UCLASS_MMC,
.max_devs = -1,
.get_dev = mmc_get_dev,
.select_hwpart = mmc_select_hwpartp,
diff --git a/drivers/net/fsl_enetc.c b/drivers/net/fsl_enetc.c
index 835e5bd..d43a85b 100644
--- a/drivers/net/fsl_enetc.c
+++ b/drivers/net/fsl_enetc.c
@@ -146,7 +146,7 @@
if (!enetc_has_imdio(dev))
return 0;
- if (priv->if_type == PHY_INTERFACE_MODE_2500BASEX)
+ if (priv->uclass_id == PHY_INTERFACE_MODE_2500BASEX)
is2500 = true;
/*
@@ -221,7 +221,7 @@
struct enetc_priv *priv = dev_get_priv(dev);
u32 if_mode;
- switch (priv->if_type) {
+ switch (priv->uclass_id) {
case PHY_INTERFACE_MODE_RGMII:
case PHY_INTERFACE_MODE_RGMII_ID:
case PHY_INTERFACE_MODE_RGMII_RXID:
@@ -278,14 +278,14 @@
return;
}
- priv->if_type = dev_read_phy_mode(dev);
- if (priv->if_type == PHY_INTERFACE_MODE_NA) {
+ priv->uclass_id = dev_read_phy_mode(dev);
+ if (priv->uclass_id == PHY_INTERFACE_MODE_NA) {
enetc_dbg(dev,
"phy-mode property not found, defaulting to SGMII\n");
- priv->if_type = PHY_INTERFACE_MODE_SGMII;
+ priv->uclass_id = PHY_INTERFACE_MODE_SGMII;
}
- switch (priv->if_type) {
+ switch (priv->uclass_id) {
case PHY_INTERFACE_MODE_SGMII:
case PHY_INTERFACE_MODE_2500BASEX:
enetc_init_sgmii(dev);
diff --git a/drivers/net/fsl_enetc.h b/drivers/net/fsl_enetc.h
index 69f2f4a..f2acf36 100644
--- a/drivers/net/fsl_enetc.h
+++ b/drivers/net/fsl_enetc.h
@@ -158,7 +158,7 @@
struct bd_ring tx_bdr;
struct bd_ring rx_bdr;
- int if_type;
+ int uclass_id;
struct mii_dev imdio;
struct phy_device *phy;
};
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index 99be5ae..3e769b0 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -456,7 +456,7 @@
{
dev_desc->lba = 0;
dev_desc->blksz = 0;
- dev_desc->if_type = UCLASS_SCSI;
+ dev_desc->uclass_id = UCLASS_SCSI;
dev_desc->devnum = devnum;
dev_desc->part_type = PART_TYPE_UNKNOWN;
@@ -706,8 +706,8 @@
};
#else
U_BOOT_LEGACY_BLK(scsi) = {
- .if_typename = "scsi",
- .if_type = UCLASS_SCSI,
+ .uclass_idname = "scsi",
+ .uclass_id = UCLASS_SCSI,
.max_devs = SCSI_MAX_DEVICE,
.desc = scsi_dev_desc,
};
diff --git a/drivers/virtio/virtio_blk.c b/drivers/virtio/virtio_blk.c
index 9710b79..30cfc56 100644
--- a/drivers/virtio/virtio_blk.c
+++ b/drivers/virtio/virtio_blk.c
@@ -75,7 +75,7 @@
struct blk_desc *desc = dev_get_uclass_plat(dev);
int devnum;
- desc->if_type = UCLASS_VIRTIO;
+ desc->uclass_id = UCLASS_VIRTIO;
/*
* Initialize the devnum to -ENODEV. This is to make sure that
* blk_next_free_devnum() works as expected, since the default
diff --git a/drivers/xen/pvblock.c b/drivers/xen/pvblock.c
index 1090e52..970182c 100644
--- a/drivers/xen/pvblock.c
+++ b/drivers/xen/pvblock.c
@@ -665,7 +665,7 @@
struct blk_desc *desc = dev_get_uclass_plat(udev);
int devnum;
- desc->if_type = UCLASS_PVBLOCK;
+ desc->uclass_id = UCLASS_PVBLOCK;
/*
* Initialize the devnum to -ENODEV. This is to make sure that
* blk_next_free_devnum() works as expected, since the default