diff options
author | Huang Shijie <b32955@freescale.com> | 2013-08-15 22:10:05 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2013-08-30 16:37:56 -0400 |
commit | bf977e3f158dc949fd6e1e4195f80d42232cb5fa (patch) | |
tree | fa78cc26e553138eabf84015cc4f8a65925226c3 /drivers/mtd/mtdcore.c | |
parent | c41a0582d59e3bc41978ac4a23e457d86ac7365f (diff) |
mtd: add a new sys node to show the ecc step size
Add a new sys node to show the ecc step size.
The application then can uses this node to get the ecc step
size.
Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/mtdcore.c')
-rw-r--r-- | drivers/mtd/mtdcore.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c index 048c823f5c51..5e14d540ba2f 100644 --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c | |||
@@ -285,6 +285,16 @@ static DEVICE_ATTR(bitflip_threshold, S_IRUGO | S_IWUSR, | |||
285 | mtd_bitflip_threshold_show, | 285 | mtd_bitflip_threshold_show, |
286 | mtd_bitflip_threshold_store); | 286 | mtd_bitflip_threshold_store); |
287 | 287 | ||
288 | static ssize_t mtd_ecc_step_size_show(struct device *dev, | ||
289 | struct device_attribute *attr, char *buf) | ||
290 | { | ||
291 | struct mtd_info *mtd = dev_get_drvdata(dev); | ||
292 | |||
293 | return snprintf(buf, PAGE_SIZE, "%u\n", mtd->ecc_step_size); | ||
294 | |||
295 | } | ||
296 | static DEVICE_ATTR(ecc_step_size, S_IRUGO, mtd_ecc_step_size_show, NULL); | ||
297 | |||
288 | static struct attribute *mtd_attrs[] = { | 298 | static struct attribute *mtd_attrs[] = { |
289 | &dev_attr_type.attr, | 299 | &dev_attr_type.attr, |
290 | &dev_attr_flags.attr, | 300 | &dev_attr_flags.attr, |
@@ -296,6 +306,7 @@ static struct attribute *mtd_attrs[] = { | |||
296 | &dev_attr_numeraseregions.attr, | 306 | &dev_attr_numeraseregions.attr, |
297 | &dev_attr_name.attr, | 307 | &dev_attr_name.attr, |
298 | &dev_attr_ecc_strength.attr, | 308 | &dev_attr_ecc_strength.attr, |
309 | &dev_attr_ecc_step_size.attr, | ||
299 | &dev_attr_bitflip_threshold.attr, | 310 | &dev_attr_bitflip_threshold.attr, |
300 | NULL, | 311 | NULL, |
301 | }; | 312 | }; |