diff options
Diffstat (limited to 'drivers/uio/uio.c')
-rw-r--r-- | drivers/uio/uio.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c index 9ac22c7c3854..557e73ef5884 100644 --- a/drivers/uio/uio.c +++ b/drivers/uio/uio.c | |||
@@ -67,6 +67,11 @@ static ssize_t map_size_show(struct uio_mem *mem, char *buf) | |||
67 | return sprintf(buf, "0x%lx\n", mem->size); | 67 | return sprintf(buf, "0x%lx\n", mem->size); |
68 | } | 68 | } |
69 | 69 | ||
70 | static ssize_t map_offset_show(struct uio_mem *mem, char *buf) | ||
71 | { | ||
72 | return sprintf(buf, "0x%lx\n", mem->addr & ~PAGE_MASK); | ||
73 | } | ||
74 | |||
70 | struct uio_sysfs_entry { | 75 | struct uio_sysfs_entry { |
71 | struct attribute attr; | 76 | struct attribute attr; |
72 | ssize_t (*show)(struct uio_mem *, char *); | 77 | ssize_t (*show)(struct uio_mem *, char *); |
@@ -77,10 +82,13 @@ static struct uio_sysfs_entry addr_attribute = | |||
77 | __ATTR(addr, S_IRUGO, map_addr_show, NULL); | 82 | __ATTR(addr, S_IRUGO, map_addr_show, NULL); |
78 | static struct uio_sysfs_entry size_attribute = | 83 | static struct uio_sysfs_entry size_attribute = |
79 | __ATTR(size, S_IRUGO, map_size_show, NULL); | 84 | __ATTR(size, S_IRUGO, map_size_show, NULL); |
85 | static struct uio_sysfs_entry offset_attribute = | ||
86 | __ATTR(offset, S_IRUGO, map_offset_show, NULL); | ||
80 | 87 | ||
81 | static struct attribute *attrs[] = { | 88 | static struct attribute *attrs[] = { |
82 | &addr_attribute.attr, | 89 | &addr_attribute.attr, |
83 | &size_attribute.attr, | 90 | &size_attribute.attr, |
91 | &offset_attribute.attr, | ||
84 | NULL, /* need to NULL terminate the list of attributes */ | 92 | NULL, /* need to NULL terminate the list of attributes */ |
85 | }; | 93 | }; |
86 | 94 | ||