diff options
author | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2011-12-30 10:00:35 -0500 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-01-09 13:26:22 -0500 |
commit | 381345652fca688aeaa967c231e5075cf68d05b6 (patch) | |
tree | 5f23ecdd28165d15109c6fd7ad0c4c573f094707 /drivers/mtd/mtdcore.c | |
parent | 327cf2922b4edf0439b219469722d2a502e37349 (diff) |
mtd: do not use mtd->lock, unlock and is_locked directly
Instead, call the corresponding MTD API function which will return
'-EOPNOTSUPP' if the operation is not supported.
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/mtdcore.c')
-rw-r--r-- | drivers/mtd/mtdcore.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c index 4d0f3e557bd1..66494ee5355a 100644 --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c | |||
@@ -339,9 +339,9 @@ int add_mtd_device(struct mtd_info *mtd) | |||
339 | mtd->writesize_mask = (1 << mtd->writesize_shift) - 1; | 339 | mtd->writesize_mask = (1 << mtd->writesize_shift) - 1; |
340 | 340 | ||
341 | /* Some chips always power up locked. Unlock them now */ | 341 | /* Some chips always power up locked. Unlock them now */ |
342 | if ((mtd->flags & MTD_WRITEABLE) | 342 | if ((mtd->flags & MTD_WRITEABLE) && (mtd->flags & MTD_POWERUP_LOCK)) { |
343 | && (mtd->flags & MTD_POWERUP_LOCK) && mtd->unlock) { | 343 | error = mtd_unlock(mtd, 0, mtd->size); |
344 | if (mtd_unlock(mtd, 0, mtd->size)) | 344 | if (error && error != -EOPNOTSUPP) |
345 | printk(KERN_WARNING | 345 | printk(KERN_WARNING |
346 | "%s: unlock failed, writes may not work\n", | 346 | "%s: unlock failed, writes may not work\n", |
347 | mtd->name); | 347 | mtd->name); |