diff options
author | Maxim Levitsky <maximlevitsky@gmail.com> | 2010-02-22 20:39:33 +0200 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2010-02-26 17:37:40 +0000 |
commit | 026ec57886b67c092bf7baecd029a7c1c4998c28 (patch) | |
tree | 661a61956e03482a9efc1fa26ef41d2a53d755fa /drivers/mtd | |
parent | 75c0b84d41c6f08c0cb083464907005683ef2920 (diff) | |
download | kernel_samsung_espresso10-026ec57886b67c092bf7baecd029a7c1c4998c28.zip kernel_samsung_espresso10-026ec57886b67c092bf7baecd029a7c1c4998c28.tar.gz kernel_samsung_espresso10-026ec57886b67c092bf7baecd029a7c1c4998c28.tar.bz2 |
mtd: blktrans: allow FTL drivers to export sysfs attributes
This patch adds an ability to export sysfs attributes below
the block disk device.
This can be used to pass the udev an information about the FTL
and could include the vendor, serial, version, etc...
Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/mtd_blkdevs.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c index 646cc84..9dd23d6 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) set_disk_ro(gd, 1); add_disk(gd); + + if (new->disk_attributes) + sysfs_create_group(&disk_to_dev(gd)->kobj, + new->disk_attributes); return 0; error4: module_put(tr->owner); @@ -405,6 +409,10 @@ int del_mtd_blktrans_dev(struct mtd_blktrans_dev *old) /* Stop new requests to arrive */ del_gendisk(old->disk); + if (old->disk_attributes) + sysfs_remove_group(&disk_to_dev(old->disk)->kobj, + old->disk_attributes); + /* Stop the thread */ kthread_stop(old->thread); |