aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/mtdconcat.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/mtdconcat.c')
-rw-r--r--drivers/mtd/mtdconcat.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/mtd/mtdconcat.c b/drivers/mtd/mtdconcat.c
index 7e075621bbf4..4567bc373780 100644
--- a/drivers/mtd/mtdconcat.c
+++ b/drivers/mtd/mtdconcat.c
@@ -540,10 +540,12 @@ static int concat_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len)
540 else 540 else
541 size = len; 541 size = len;
542 542
543 err = subdev->lock(subdev, ofs, size); 543 if (subdev->lock) {
544 544 err = subdev->lock(subdev, ofs, size);
545 if (err) 545 if (err)
546 break; 546 break;
547 } else
548 err = -EOPNOTSUPP;
547 549
548 len -= size; 550 len -= size;
549 if (len == 0) 551 if (len == 0)
@@ -578,10 +580,12 @@ static int concat_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len)
578 else 580 else
579 size = len; 581 size = len;
580 582
581 err = subdev->unlock(subdev, ofs, size); 583 if (subdev->unlock) {
582 584 err = subdev->unlock(subdev, ofs, size);
583 if (err) 585 if (err)
584 break; 586 break;
587 } else
588 err = -EOPNOTSUPP;
585 589
586 len -= size; 590 len -= size;
587 if (len == 0) 591 if (len == 0)