diff options
author | Dan Willemsen <dwillemsen@nvidia.com> | 2012-03-23 21:43:21 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2012-03-23 21:43:21 -0700 |
commit | 9c6641224bdc2957f1d4ef692f027ff5e0fcc63b (patch) | |
tree | 589c55d8a24b79a5cfd2cb3379d1ce0cac9c7464 /block/genhd.c | |
parent | c9134a33b3936ca9cae8bdc6dccd77e9c294f0ef (diff) | |
parent | 5275e74ae5e7e92b05bd1361e2573bb38d381358 (diff) |
Merge commit '5275e74' into after-upstream-android
Conflicts:
arch/arm/common/Kconfig
arch/arm/mm/Makefile
arch/arm/mm/cache-l2x0.c
drivers/misc/Kconfig
drivers/misc/Makefile
drivers/mmc/core/core.c
Signed-off-by: Dan Willemsen <dwillemsen@nvidia.com>
Diffstat (limited to 'block/genhd.c')
-rw-r--r-- | block/genhd.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/block/genhd.c b/block/genhd.c index df9816ede75b..dba026281a3e 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -1107,6 +1107,22 @@ static void disk_release(struct device *dev) blk_put_queue(disk->queue); kfree(disk); } + +static int disk_uevent(struct device *dev, struct kobj_uevent_env *env) +{ + struct gendisk *disk = dev_to_disk(dev); + struct disk_part_iter piter; + struct hd_struct *part; + int cnt = 0; + + disk_part_iter_init(&piter, disk, 0); + while((part = disk_part_iter_next(&piter))) + cnt++; + disk_part_iter_exit(&piter); + add_uevent_var(env, "NPARTS=%u", cnt); + return 0; +} + struct class block_class = { .name = "block", }; @@ -1125,6 +1141,7 @@ static struct device_type disk_type = { .groups = disk_attr_groups, .release = disk_release, .devnode = block_devnode, + .uevent = disk_uevent, }; #ifdef CONFIG_PROC_FS |