diff options
author | Mike Dunn <mikedunn@newsguy.com> | 2012-04-25 15:06:07 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-05-14 00:10:45 -0400 |
commit | a9b672e82bca47bf2b37ee869b8095000cf3ca88 (patch) | |
tree | 919600389b72762f4d14f62336fe94be6b7793ea /drivers | |
parent | 44df4d11b8f573e9efcba94d63e6a1ad148c76d0 (diff) |
mtd: expose ecc_strength through sysfs
ecc_strength element of struct mtd_info is exposed as a read-only variable in
sysfs.
Signed-off-by: Mike Dunn <mikedunn@newsguy.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mtd/mtdcore.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c index c837507dfb1c..090e849d3dcd 100644 --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c | |||
@@ -250,6 +250,15 @@ static ssize_t mtd_name_show(struct device *dev, | |||
250 | } | 250 | } |
251 | static DEVICE_ATTR(name, S_IRUGO, mtd_name_show, NULL); | 251 | static DEVICE_ATTR(name, S_IRUGO, mtd_name_show, NULL); |
252 | 252 | ||
253 | static ssize_t mtd_ecc_strength_show(struct device *dev, | ||
254 | struct device_attribute *attr, char *buf) | ||
255 | { | ||
256 | struct mtd_info *mtd = dev_get_drvdata(dev); | ||
257 | |||
258 | return snprintf(buf, PAGE_SIZE, "%u\n", mtd->ecc_strength); | ||
259 | } | ||
260 | static DEVICE_ATTR(ecc_strength, S_IRUGO, mtd_ecc_strength_show, NULL); | ||
261 | |||
253 | static struct attribute *mtd_attrs[] = { | 262 | static struct attribute *mtd_attrs[] = { |
254 | &dev_attr_type.attr, | 263 | &dev_attr_type.attr, |
255 | &dev_attr_flags.attr, | 264 | &dev_attr_flags.attr, |
@@ -260,6 +269,7 @@ static struct attribute *mtd_attrs[] = { | |||
260 | &dev_attr_oobsize.attr, | 269 | &dev_attr_oobsize.attr, |
261 | &dev_attr_numeraseregions.attr, | 270 | &dev_attr_numeraseregions.attr, |
262 | &dev_attr_name.attr, | 271 | &dev_attr_name.attr, |
272 | &dev_attr_ecc_strength.attr, | ||
263 | NULL, | 273 | NULL, |
264 | }; | 274 | }; |
265 | 275 | ||