diff options
-rw-r--r-- | drivers/mtd/mtdcore.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c index 051b4d4ed21f..bccb4b1ffc46 100644 --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c | |||
@@ -132,6 +132,17 @@ static ssize_t mtd_writesize_show(struct device *dev, | |||
132 | } | 132 | } |
133 | static DEVICE_ATTR(writesize, S_IRUGO, mtd_writesize_show, NULL); | 133 | static DEVICE_ATTR(writesize, S_IRUGO, mtd_writesize_show, NULL); |
134 | 134 | ||
135 | static ssize_t mtd_subpagesize_show(struct device *dev, | ||
136 | struct device_attribute *attr, char *buf) | ||
137 | { | ||
138 | struct mtd_info *mtd = dev_to_mtd(dev); | ||
139 | unsigned int subpagesize = mtd->writesize >> mtd->subpage_sft; | ||
140 | |||
141 | return snprintf(buf, PAGE_SIZE, "%u\n", subpagesize); | ||
142 | |||
143 | } | ||
144 | static DEVICE_ATTR(subpagesize, S_IRUGO, mtd_subpagesize_show, NULL); | ||
145 | |||
135 | static ssize_t mtd_oobsize_show(struct device *dev, | 146 | static ssize_t mtd_oobsize_show(struct device *dev, |
136 | struct device_attribute *attr, char *buf) | 147 | struct device_attribute *attr, char *buf) |
137 | { | 148 | { |
@@ -169,6 +180,7 @@ static struct attribute *mtd_attrs[] = { | |||
169 | &dev_attr_size.attr, | 180 | &dev_attr_size.attr, |
170 | &dev_attr_erasesize.attr, | 181 | &dev_attr_erasesize.attr, |
171 | &dev_attr_writesize.attr, | 182 | &dev_attr_writesize.attr, |
183 | &dev_attr_subpagesize.attr, | ||
172 | &dev_attr_oobsize.attr, | 184 | &dev_attr_oobsize.attr, |
173 | &dev_attr_numeraseregions.attr, | 185 | &dev_attr_numeraseregions.attr, |
174 | &dev_attr_name.attr, | 186 | &dev_attr_name.attr, |