aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mtd/mtd_blkdevs.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c
index 646cc84ae692..9dd23d6acbb6 100644
--- a/drivers/mtd/mtd_blkdevs.c
+++ b/drivers/mtd/mtd_blkdevs.c
@@ -379,6 +379,10 @@ int add_mtd_blktrans_dev(struct mtd_blktrans_dev *new)
379 set_disk_ro(gd, 1); 379 set_disk_ro(gd, 1);
380 380
381 add_disk(gd); 381 add_disk(gd);
382
383 if (new->disk_attributes)
384 sysfs_create_group(&disk_to_dev(gd)->kobj,
385 new->disk_attributes);
382 return 0; 386 return 0;
383error4: 387error4:
384 module_put(tr->owner); 388 module_put(tr->owner);
@@ -405,6 +409,10 @@ int del_mtd_blktrans_dev(struct mtd_blktrans_dev *old)
405 /* Stop new requests to arrive */ 409 /* Stop new requests to arrive */
406 del_gendisk(old->disk); 410 del_gendisk(old->disk);
407 411
412 if (old->disk_attributes)
413 sysfs_remove_group(&disk_to_dev(old->disk)->kobj,
414 old->disk_attributes);
415
408 /* Stop the thread */ 416 /* Stop the thread */
409 kthread_stop(old->thread); 417 kthread_stop(old->thread);
410 418