diff options
Diffstat (limited to 'drivers/mtd/mtdconcat.c')
-rw-r--r-- | drivers/mtd/mtdconcat.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/mtd/mtdconcat.c b/drivers/mtd/mtdconcat.c index 9119f76f87ff..aaafb5e18765 100644 --- a/drivers/mtd/mtdconcat.c +++ b/drivers/mtd/mtdconcat.c | |||
@@ -555,12 +555,9 @@ static int concat_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len) | |||
555 | else | 555 | else |
556 | size = len; | 556 | size = len; |
557 | 557 | ||
558 | if (subdev->lock) { | 558 | err = mtd_lock(subdev, ofs, size); |
559 | err = mtd_lock(subdev, ofs, size); | 559 | if (err) |
560 | if (err) | 560 | break; |
561 | break; | ||
562 | } else | ||
563 | err = -EOPNOTSUPP; | ||
564 | 561 | ||
565 | len -= size; | 562 | len -= size; |
566 | if (len == 0) | 563 | if (len == 0) |
@@ -595,12 +592,9 @@ static int concat_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len) | |||
595 | else | 592 | else |
596 | size = len; | 593 | size = len; |
597 | 594 | ||
598 | if (subdev->unlock) { | 595 | err = mtd_unlock(subdev, ofs, size); |
599 | err = mtd_unlock(subdev, ofs, size); | 596 | if (err) |
600 | if (err) | 597 | break; |
601 | break; | ||
602 | } else | ||
603 | err = -EOPNOTSUPP; | ||
604 | 598 | ||
605 | len -= size; | 599 | len -= size; |
606 | if (len == 0) | 600 | if (len == 0) |