[PATCH 2/7] devinfo: switch to resource
Jean-Christophe PLAGNIOL-VILLARD
plagnioj at jcrosoft.com
Fri Jul 29 01:52:52 EDT 2011
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
---
drivers/base/driver.c | 16 +++++++++++++---
1 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/drivers/base/driver.c b/drivers/base/driver.c
index 3efb538..1bb74ee 100644
--- a/drivers/base/driver.c
+++ b/drivers/base/driver.c
@@ -340,6 +340,8 @@ static int do_devinfo(struct command *cmdtp, int argc, char *argv[])
struct device_d *dev;
struct driver_d *drv;
struct param_d *param;
+ int i;
+ struct resource *res;
if (argc == 1) {
printf("devices:\n");
@@ -360,9 +362,17 @@ static int do_devinfo(struct command *cmdtp, int argc, char *argv[])
return -1;
}
- printf("base : 0x%08x\nsize : 0x%08x\ndriver: %s\n\n",
- dev->map_base, dev->size,
- dev->driver ?
+ printf("resources:\n");
+ for (i = 0; i < dev->num_resources; i++) {
+ res = &dev->resource[i];
+ printf("num : %d\n", i);
+ if (res->name)
+ printf("name : %s\n", res->name);
+ printf("start : 0x%08x\nsize : 0x%08x\n",
+ res->start, res->size);
+ }
+
+ printf("driver: %s\n\n", dev->driver ?
dev->driver->name : "none");
if (dev->driver)
--
1.7.5.4
More information about the barebox
mailing list