diff options
| -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 fdd6ae859397..051b4d4ed21f 100644 --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c | |||
| @@ -48,11 +48,11 @@ static LIST_HEAD(mtd_notifiers); | |||
| 48 | */ | 48 | */ |
| 49 | static void mtd_release(struct device *dev) | 49 | static void mtd_release(struct device *dev) |
| 50 | { | 50 | { |
| 51 | struct mtd_info *mtd = dev_to_mtd(dev); | 51 | dev_t index = MTD_DEVT(dev_to_mtd(dev)->index); |
| 52 | 52 | ||
| 53 | /* remove /dev/mtdXro node if needed */ | 53 | /* remove /dev/mtdXro node if needed */ |
| 54 | if (MTD_DEVT(mtd->index)) | 54 | if (index) |
| 55 | device_destroy(mtd_class, MTD_DEVT(mtd->index) + 1); | 55 | device_destroy(mtd_class, index + 1); |
| 56 | } | 56 | } |
| 57 | 57 | ||
| 58 | static ssize_t mtd_type_show(struct device *dev, | 58 | static ssize_t mtd_type_show(struct device *dev, |
