diff options
author | Mariusz Kozlowski <m.kozlowski@tuxland.pl> | 2007-02-14 21:03:39 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-02-16 15:19:17 -0800 |
commit | b92be9f1ecd3c8b16e9bb22d55bb97b3d89f091a (patch) | |
tree | 6f5b561fd2268214d3b511f6dc8e0c1a598f24b7 /fs/partitions/check.c | |
parent | 1350770112bd9bd5696cb52deb712370012d80e0 (diff) |
Driver: remove redundant kobject_unregister checks
Here is a patch that removes all redundant kobject_unregister argument checks.
Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs/partitions/check.c')
-rw-r--r-- | fs/partitions/check.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/partitions/check.c b/fs/partitions/check.c index ac32a2e8540c..22d38ffc9ef0 100644 --- a/fs/partitions/check.c +++ b/fs/partitions/check.c @@ -358,8 +358,7 @@ void delete_partition(struct gendisk *disk, int part) p->ios[0] = p->ios[1] = 0; p->sectors[0] = p->sectors[1] = 0; sysfs_remove_link(&p->kobj, "subsystem"); - if (p->holder_dir) - kobject_unregister(p->holder_dir); + kobject_unregister(p->holder_dir); kobject_uevent(&p->kobj, KOBJ_REMOVE); kobject_del(&p->kobj); kobject_put(&p->kobj); @@ -603,10 +602,8 @@ void del_gendisk(struct gendisk *disk) disk->stamp = 0; kobject_uevent(&disk->kobj, KOBJ_REMOVE); - if (disk->holder_dir) - kobject_unregister(disk->holder_dir); - if (disk->slave_dir) - kobject_unregister(disk->slave_dir); + kobject_unregister(disk->holder_dir); + kobject_unregister(disk->slave_dir); if (disk->driverfs_dev) { char *disk_name = make_block_name(disk); sysfs_remove_link(&disk->kobj, "device"); |