|
@@ -47,14 +47,12 @@ static int of_flash_remove(struct platform_device *dev)
|
|
|
return 0;
|
|
return 0;
|
|
|
dev_set_drvdata(&dev->dev, NULL);
|
|
dev_set_drvdata(&dev->dev, NULL);
|
|
|
|
|
|
|
|
- if (info->cmtd != info->list[0].mtd) {
|
|
|
|
|
|
|
+ if (info->cmtd) {
|
|
|
mtd_device_unregister(info->cmtd);
|
|
mtd_device_unregister(info->cmtd);
|
|
|
- mtd_concat_destroy(info->cmtd);
|
|
|
|
|
|
|
+ if (info->cmtd != info->list[0].mtd)
|
|
|
|
|
+ mtd_concat_destroy(info->cmtd);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (info->cmtd)
|
|
|
|
|
- mtd_device_unregister(info->cmtd);
|
|
|
|
|
-
|
|
|
|
|
for (i = 0; i < info->list_size; i++) {
|
|
for (i = 0; i < info->list_size; i++) {
|
|
|
if (info->list[i].mtd)
|
|
if (info->list[i].mtd)
|
|
|
map_destroy(info->list[i].mtd);
|
|
map_destroy(info->list[i].mtd);
|