diff options
| author | 2011-12-30 17:00:35 +0200 | |
|---|---|---|
| committer | 2012-01-09 18:26:22 +0000 | |
| commit | 381345652fca688aeaa967c231e5075cf68d05b6 (patch) | |
| tree | 5f23ecdd28165d15109c6fd7ad0c4c573f094707 /drivers/mtd/mtdcore.c | |
| parent | mtd: do not use mtd->sync directly (diff) | |
| download | linux-dev-381345652fca688aeaa967c231e5075cf68d05b6.tar.xz linux-dev-381345652fca688aeaa967c231e5075cf68d05b6.zip | |
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) mtd->writesize_mask = (1 << mtd->writesize_shift) - 1; /* Some chips always power up locked. Unlock them now */ - if ((mtd->flags & MTD_WRITEABLE) - && (mtd->flags & MTD_POWERUP_LOCK) && mtd->unlock) { - if (mtd_unlock(mtd, 0, mtd->size)) + if ((mtd->flags & MTD_WRITEABLE) && (mtd->flags & MTD_POWERUP_LOCK)) { + error = mtd_unlock(mtd, 0, mtd->size); + if (error && error != -EOPNOTSUPP) printk(KERN_WARNING "%s: unlock failed, writes may not work\n", mtd->name); |
