diff mbox series

[16/17] xen: pvblock: Print found devices indices

Message ID 20200701162959.9814-17-vicooodin@gmail.com
State Superseded
Delegated to: Tom Rini
Headers show
Series Add new board: Xen guest for ARM64 | expand

Commit Message

Anastasiia Lukianenko July 1, 2020, 4:29 p.m. UTC
From: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com>

Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Signed-off-by: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com>
---
 drivers/xen/pvblock.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

Comments

Simon Glass July 3, 2020, 3:50 a.m. UTC | #1
On Wed, 1 Jul 2020 at 10:30, Anastasiia Lukianenko <vicooodin@gmail.com> wrote:
>
> From: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com>
>
> Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
> Signed-off-by: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com>
> ---
>  drivers/xen/pvblock.c | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
>

Reviewed-by: Simon Glass <sjg@chromium.org>
diff mbox series

Patch

diff --git a/drivers/xen/pvblock.c b/drivers/xen/pvblock.c
index a23afc2cb2..8b102b181d 100644
--- a/drivers/xen/pvblock.c
+++ b/drivers/xen/pvblock.c
@@ -734,6 +734,24 @@  fail:
 	return ret;
 }
 
+static void print_pvblock_devices(void)
+{
+	struct udevice *udev;
+	bool first = true;
+	const char *class_name;
+
+	class_name = uclass_get_name(UCLASS_PVBLOCK);
+	for (blk_first_device(IF_TYPE_PVBLOCK, &udev); udev;
+	     blk_next_device(&udev), first = false) {
+		struct blk_desc *desc = dev_get_uclass_platdata(udev);
+
+		if (!first)
+			puts(", ");
+		printf("%s: %d", class_name, desc->devnum);
+	}
+	printf("\n");
+}
+
 void pvblock_init(void)
 {
 	struct driver_info info;
@@ -756,6 +774,8 @@  void pvblock_init(void)
 	if (ret)
 		return;
 	uclass_foreach_dev_probe(UCLASS_PVBLOCK, udev);
+
+	print_pvblock_devices();
 }
 
 static int pvblock_probe(struct udevice *udev)