diff options
author | Bjorn Helgaas <bjorn.helgaas@hp.com> | 2009-10-06 23:34:00 +0200 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2009-11-04 17:47:20 +0100 |
commit | 9a007b3791cdba3601d835ea10e68c14115b9afb (patch) | |
tree | 37b36bcacaf04a88cb19d28c9e811e5569a25e2c /drivers/pnp/support.c | |
parent | ia64/PCI: print resources consistently with %pRt (diff) | |
download | linux-9a007b3791cdba3601d835ea10e68c14115b9afb.tar.xz linux-9a007b3791cdba3601d835ea10e68c14115b9afb.zip |
PNP: print resources consistently with %pRt
This uses %pRt and %pRf to print additional resource information (type,
size, prefetchability, etc.) consistently.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pnp/support.c')
-rw-r--r-- | drivers/pnp/support.c | 43 |
1 files changed, 5 insertions, 38 deletions
diff --git a/drivers/pnp/support.c b/drivers/pnp/support.c index 63087d5ce609..1f8a33b0abac 100644 --- a/drivers/pnp/support.c +++ b/drivers/pnp/support.c @@ -75,47 +75,14 @@ char *pnp_resource_type_name(struct resource *res) void dbg_pnp_show_resources(struct pnp_dev *dev, char *desc) { - char buf[128]; - int len; struct pnp_resource *pnp_res; - struct resource *res; - if (list_empty(&dev->resources)) { + if (list_empty(&dev->resources)) pnp_dbg(&dev->dev, "%s: no current resources\n", desc); - return; - } - - pnp_dbg(&dev->dev, "%s: current resources:\n", desc); - list_for_each_entry(pnp_res, &dev->resources, list) { - res = &pnp_res->res; - len = 0; - - len += scnprintf(buf + len, sizeof(buf) - len, " %-3s ", - pnp_resource_type_name(res)); - - if (res->flags & IORESOURCE_DISABLED) { - pnp_dbg(&dev->dev, "%sdisabled\n", buf); - continue; - } - - switch (pnp_resource_type(res)) { - case IORESOURCE_IO: - case IORESOURCE_MEM: - len += scnprintf(buf + len, sizeof(buf) - len, - "%#llx-%#llx flags %#lx", - (unsigned long long) res->start, - (unsigned long long) res->end, - res->flags); - break; - case IORESOURCE_IRQ: - case IORESOURCE_DMA: - len += scnprintf(buf + len, sizeof(buf) - len, - "%lld flags %#lx", - (unsigned long long) res->start, - res->flags); - break; - } - pnp_dbg(&dev->dev, "%s\n", buf); + else { + pnp_dbg(&dev->dev, "%s: current resources:\n", desc); + list_for_each_entry(pnp_res, &dev->resources, list) + pnp_dbg(&dev->dev, "%pRf\n", &pnp_res->res); } } |