summaryrefslogtreecommitdiff
path: root/drivers/mtd/mtdpart.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/mtdpart.c')
-rw-r--r--drivers/mtd/mtdpart.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c
index f87c962205..ccbb1757ea 100644
--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
@@ -417,8 +417,10 @@ static struct mtd_part *allocate_partition(struct mtd_info *master,
slave->mtd.dev.parent = master->dev.parent;
#endif
- slave->mtd._read = part_read;
- slave->mtd._write = part_write;
+ if (master->_read)
+ slave->mtd._read = part_read;
+ if (master->_write)
+ slave->mtd._write = part_write;
if (master->_panic_write)
slave->mtd._panic_write = part_panic_write;