diff options
author | Bjorn Helgaas <bjorn.helgaas@hp.com> | 2008-06-27 18:56:55 -0400 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2008-07-16 17:27:05 -0400 |
commit | 9fdee4e02e3b214cde8e4f3beb6776075a3d08a7 (patch) | |
tree | 2b08862f3d585b104f76b1c2fd362982e297a19d /drivers/pnp/support.c | |
parent | 940e98dbc616f1df7b63b73858a966969baf261d (diff) |
PNP: add pnp_resource_type_name() helper function
This patch adds a "pnp_resource_type_name(struct resource *)" that
returns the string resource type. This will be used by the sysfs
"show resources" function and the debug resource dump function.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Diffstat (limited to 'drivers/pnp/support.c')
-rw-r--r-- | drivers/pnp/support.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/pnp/support.c b/drivers/pnp/support.c index 7f594ccf4958..eb07345f5cf7 100644 --- a/drivers/pnp/support.c +++ b/drivers/pnp/support.c | |||
@@ -52,6 +52,21 @@ void pnp_eisa_id_to_string(u32 id, char *str) | |||
52 | str[7] = '\0'; | 52 | str[7] = '\0'; |
53 | } | 53 | } |
54 | 54 | ||
55 | char *pnp_resource_type_name(struct resource *res) | ||
56 | { | ||
57 | switch (pnp_resource_type(res)) { | ||
58 | case IORESOURCE_IO: | ||
59 | return "io"; | ||
60 | case IORESOURCE_MEM: | ||
61 | return "mem"; | ||
62 | case IORESOURCE_IRQ: | ||
63 | return "irq"; | ||
64 | case IORESOURCE_DMA: | ||
65 | return "dma"; | ||
66 | } | ||
67 | return NULL; | ||
68 | } | ||
69 | |||
55 | void dbg_pnp_show_resources(struct pnp_dev *dev, char *desc) | 70 | void dbg_pnp_show_resources(struct pnp_dev *dev, char *desc) |
56 | { | 71 | { |
57 | #ifdef DEBUG | 72 | #ifdef DEBUG |