diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2010-07-25 11:10:29 +0200 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2010-08-03 09:04:18 +0200 |
commit | 8f677ea07a2a934ac74ffa57db0f5617aec15ddf (patch) | |
tree | fb552d7c721e1e0a6c34319453fa2850ffa42dd2 /drivers | |
parent | 0ca724d37af370dbf2d55dc4d6359ead558e5756 (diff) |
pcmcia: export resource information to sysfs
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/pcmcia/ds.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c index 0bb780c3f26..028c97353b9 100644 --- a/drivers/pcmcia/ds.c +++ b/drivers/pcmcia/ds.c @@ -1011,6 +1011,18 @@ pcmcia_device_stringattr(prod_id2, prod_id[1]); pcmcia_device_stringattr(prod_id3, prod_id[2]); pcmcia_device_stringattr(prod_id4, prod_id[3]); +static ssize_t pcmcia_show_resources(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct pcmcia_device *p_dev = to_pcmcia_dev(dev); + char *str = buf; + int i; + + for (i = 0; i < PCMCIA_NUM_RESOURCES; i++) + str += sprintf(str, "%pr\n", p_dev->resource[i]); + + return str - buf; +} static ssize_t pcmcia_show_pm_state(struct device *dev, struct device_attribute *attr, char *buf) { @@ -1081,6 +1093,7 @@ static ssize_t pcmcia_store_allow_func_id_match(struct device *dev, static struct device_attribute pcmcia_dev_attrs[] = { __ATTR(function, 0444, func_show, NULL), __ATTR(pm_state, 0644, pcmcia_show_pm_state, pcmcia_store_pm_state), + __ATTR(resources, 0444, pcmcia_show_resources, NULL), __ATTR_RO(func_id), __ATTR_RO(manf_id), __ATTR_RO(card_id), |