aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/mtd_blkdevs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/mtd_blkdevs.c')
-rw-r--r--drivers/mtd/mtd_blkdevs.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c
index 1409f01406f6..a49a9c8f2cb1 100644
--- a/drivers/mtd/mtd_blkdevs.c
+++ b/drivers/mtd/mtd_blkdevs.c
@@ -286,6 +286,7 @@ int add_mtd_blktrans_dev(struct mtd_blktrans_dev *new)
286 gd->private_data = new; 286 gd->private_data = new;
287 new->blkcore_priv = gd; 287 new->blkcore_priv = gd;
288 gd->queue = tr->blkcore_priv->rq; 288 gd->queue = tr->blkcore_priv->rq;
289 gd->driverfs_dev = new->mtd->dev.parent;
289 290
290 if (new->readonly) 291 if (new->readonly)
291 set_disk_ro(gd, 1); 292 set_disk_ro(gd, 1);
@@ -382,11 +383,12 @@ int register_mtd_blktrans(struct mtd_blktrans_ops *tr)
382 tr->blkcore_priv->thread = kthread_run(mtd_blktrans_thread, tr, 383 tr->blkcore_priv->thread = kthread_run(mtd_blktrans_thread, tr,
383 "%sd", tr->name); 384 "%sd", tr->name);
384 if (IS_ERR(tr->blkcore_priv->thread)) { 385 if (IS_ERR(tr->blkcore_priv->thread)) {
386 int ret = PTR_ERR(tr->blkcore_priv->thread);
385 blk_cleanup_queue(tr->blkcore_priv->rq); 387 blk_cleanup_queue(tr->blkcore_priv->rq);
386 unregister_blkdev(tr->major, tr->name); 388 unregister_blkdev(tr->major, tr->name);
387 kfree(tr->blkcore_priv); 389 kfree(tr->blkcore_priv);
388 mutex_unlock(&mtd_table_mutex); 390 mutex_unlock(&mtd_table_mutex);
389 return PTR_ERR(tr->blkcore_priv->thread); 391 return ret;
390 } 392 }
391 393
392 INIT_LIST_HEAD(&tr->devs); 394 INIT_LIST_HEAD(&tr->devs);