diff options
author | Kay Sievers <kay.sievers@suse.de> | 2006-06-15 09:31:56 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-06-21 15:40:49 -0400 |
commit | b9d9c82b4d081feb464f62dfc786c8621d09ecd2 (patch) | |
tree | 511d15b4d7aaba80a2c0fe49622a3224ca386122 /fs/partitions/check.c | |
parent | 23681e479129854305da1da32f7f1eaf635ef22c (diff) |
[PATCH] Driver core: add generic "subsystem" link to all devices
Like the SUBSYTEM= key we find in the environment of the uevent, this
creates a generic "subsystem" link in sysfs for every device. Userspace
usually doesn't care at all if its a "class" or a "bus" device. This
provides an unified way to determine the subsytem of a device, regardless
of the way the driver core has created it.
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs/partitions/check.c')
-rw-r--r-- | fs/partitions/check.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/partitions/check.c b/fs/partitions/check.c index 7ef1f094de91..8851b81e7c5a 100644 --- a/fs/partitions/check.c +++ b/fs/partitions/check.c | |||
@@ -329,6 +329,7 @@ void delete_partition(struct gendisk *disk, int part) | |||
329 | p->ios[0] = p->ios[1] = 0; | 329 | p->ios[0] = p->ios[1] = 0; |
330 | p->sectors[0] = p->sectors[1] = 0; | 330 | p->sectors[0] = p->sectors[1] = 0; |
331 | devfs_remove("%s/part%d", disk->devfs_name, part); | 331 | devfs_remove("%s/part%d", disk->devfs_name, part); |
332 | sysfs_remove_link(&p->kobj, "subsystem"); | ||
332 | if (p->holder_dir) | 333 | if (p->holder_dir) |
333 | kobject_unregister(p->holder_dir); | 334 | kobject_unregister(p->holder_dir); |
334 | kobject_uevent(&p->kobj, KOBJ_REMOVE); | 335 | kobject_uevent(&p->kobj, KOBJ_REMOVE); |
@@ -363,6 +364,7 @@ void add_partition(struct gendisk *disk, int part, sector_t start, sector_t len) | |||
363 | kobject_add(&p->kobj); | 364 | kobject_add(&p->kobj); |
364 | if (!disk->part_uevent_suppress) | 365 | if (!disk->part_uevent_suppress) |
365 | kobject_uevent(&p->kobj, KOBJ_ADD); | 366 | kobject_uevent(&p->kobj, KOBJ_ADD); |
367 | sysfs_create_link(&p->kobj, &block_subsys.kset.kobj, "subsystem"); | ||
366 | partition_sysfs_add_subdir(p); | 368 | partition_sysfs_add_subdir(p); |
367 | disk->part[part-1] = p; | 369 | disk->part[part-1] = p; |
368 | } | 370 | } |
@@ -398,6 +400,7 @@ static void disk_sysfs_symlinks(struct gendisk *disk) | |||
398 | kfree(disk_name); | 400 | kfree(disk_name); |
399 | } | 401 | } |
400 | } | 402 | } |
403 | sysfs_create_link(&disk->kobj, &block_subsys.kset.kobj, "subsystem"); | ||
401 | } | 404 | } |
402 | 405 | ||
403 | /* Not exported, helper to add_disk(). */ | 406 | /* Not exported, helper to add_disk(). */ |
@@ -548,5 +551,6 @@ void del_gendisk(struct gendisk *disk) | |||
548 | put_device(disk->driverfs_dev); | 551 | put_device(disk->driverfs_dev); |
549 | disk->driverfs_dev = NULL; | 552 | disk->driverfs_dev = NULL; |
550 | } | 553 | } |
554 | sysfs_remove_link(&disk->kobj, "subsystem"); | ||
551 | kobject_del(&disk->kobj); | 555 | kobject_del(&disk->kobj); |
552 | } | 556 | } |