xen: pvblock: Use uclass_probe_all

Also eliminate useless code and variables.

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Michal Suchanek 2022-10-22 16:33:05 +02:00 committed by Tom Rini
parent 44b7abf8dc
commit 0b999d2082

View File

@ -818,8 +818,6 @@ static void print_pvblock_devices(void)
void pvblock_init(void) void pvblock_init(void)
{ {
struct driver_info info; struct driver_info info;
struct udevice *udev;
struct uclass *uc;
int ret; int ret;
/* /*
@ -828,15 +826,12 @@ void pvblock_init(void)
* virtual block devices. * virtual block devices.
*/ */
info.name = DRV_NAME; info.name = DRV_NAME;
ret = device_bind_by_name(gd->dm_root, false, &info, &udev); ret = device_bind_by_name(gd->dm_root, false, &info, NULL);
if (ret < 0) if (ret < 0)
printf("Failed to bind " DRV_NAME ", ret: %d\n", ret); printf("Failed to bind " DRV_NAME ", ret: %d\n", ret);
/* Bootstrap virtual block devices class driver */ /* Bootstrap virtual block devices class driver */
ret = uclass_get(UCLASS_PVBLOCK, &uc); uclass_probe_all(UCLASS_PVBLOCK);
if (ret)
return;
uclass_foreach_dev_probe(UCLASS_PVBLOCK, udev);
print_pvblock_devices(); print_pvblock_devices();
} }