Kobject: convert arch/* from kobject_unregister() to kobject_put()
authorGreg Kroah-Hartman <gregkh@suse.de>
Thu, 20 Dec 2007 16:13:05 +0000 (08:13 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 25 Jan 2008 04:40:39 +0000 (20:40 -0800)
There is no need for kobject_unregister() anymore, thanks to Kay's
kobject cleanup changes, so replace all instances of it with
kobject_put().

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/ia64/kernel/topology.c
arch/s390/hypfs/inode.c
arch/sh/kernel/cpu/sh4/sq.c
arch/x86/kernel/cpu/intel_cacheinfo.c
arch/x86/kernel/cpu/mcheck/mce_amd_64.c

index c4311e3adf552cb2c21cecd0328d38eb25715d40..a2484fc1a06c43482e575888ca1991d45faf43e7 100644 (file)
@@ -366,10 +366,9 @@ static int __cpuinit cache_add_dev(struct sys_device * sys_dev)
                                              "index%1lu", i);
                if (unlikely(retval)) {
                        for (j = 0; j < i; j++) {
-                               kobject_unregister(
-                                       &(LEAF_KOBJECT_PTR(cpu,j)->kobj));
+                               kobject_put(&(LEAF_KOBJECT_PTR(cpu,j)->kobj));
                        }
-                       kobject_unregister(&all_cpu_cache_info[cpu].kobj);
+                       kobject_put(&all_cpu_cache_info[cpu].kobj);
                        cpu_cache_sysfs_exit(cpu);
                        break;
                }
@@ -386,10 +385,10 @@ static int __cpuinit cache_remove_dev(struct sys_device * sys_dev)
        unsigned long i;
 
        for (i = 0; i < all_cpu_cache_info[cpu].num_cache_leaves; i++)
-               kobject_unregister(&(LEAF_KOBJECT_PTR(cpu,i)->kobj));
+               kobject_put(&(LEAF_KOBJECT_PTR(cpu,i)->kobj));
 
        if (all_cpu_cache_info[cpu].kobj.parent) {
-               kobject_unregister(&all_cpu_cache_info[cpu].kobj);
+               kobject_put(&all_cpu_cache_info[cpu].kobj);
                memset(&all_cpu_cache_info[cpu].kobj,
                        0,
                        sizeof(struct kobject));
index 631a6109f642ff623b28f2473a67596dcf499688..4b010ff814c9caa3f439cb7e849aa8c501bdace1 100644 (file)
@@ -517,7 +517,7 @@ static int __init hypfs_init(void)
        return 0;
 
 fail_filesystem:
-       kobject_unregister(s390_kobj);
+       kobject_put(s390_kobj);
 fail_sysfs:
        if (!MACHINE_IS_VM)
                hypfs_diag_exit();
@@ -531,7 +531,7 @@ static void __exit hypfs_exit(void)
        if (!MACHINE_IS_VM)
                hypfs_diag_exit();
        unregister_filesystem(&hypfs_type);
-       kobject_unregister(s390_kobj);
+       kobject_put(s390_kobj);
 }
 
 module_init(hypfs_init)
index 97fd9b9a4820f6746a0db08b1bf388fef2862de5..3008c00eea6b6c269e7fa6bde3e2e43ca4d0f4b8 100644 (file)
@@ -360,7 +360,7 @@ static int __devexit sq_sysdev_remove(struct sys_device *sysdev)
        unsigned int cpu = sysdev->id;
        struct kobject *kobj = sq_kobject[cpu];
 
-       kobject_unregister(kobj);
+       kobject_put(kobj);
        return 0;
 }
 
index 3509542eed87881f18d460d3ff03ec6a64da5479..8b4507b8469b18ed09f906e35b94ba6649e75b8a 100644 (file)
@@ -749,10 +749,9 @@ static int __cpuinit cache_add_dev(struct sys_device * sys_dev)
                                              "index%1lu", i);
                if (unlikely(retval)) {
                        for (j = 0; j < i; j++) {
-                               kobject_unregister(
-                                       &(INDEX_KOBJECT_PTR(cpu,j)->kobj));
+                               kobject_put(&(INDEX_KOBJECT_PTR(cpu,j)->kobj));
                        }
-                       kobject_unregister(cache_kobject[cpu]);
+                       kobject_put(cache_kobject[cpu]);
                        cpuid4_cache_sysfs_exit(cpu);
                        break;
                }
@@ -777,8 +776,8 @@ static void __cpuinit cache_remove_dev(struct sys_device * sys_dev)
        cpu_clear(cpu, cache_dev_map);
 
        for (i = 0; i < num_cache_leaves; i++)
-               kobject_unregister(&(INDEX_KOBJECT_PTR(cpu,i)->kobj));
-       kobject_unregister(cache_kobject[cpu]);
+               kobject_put(&(INDEX_KOBJECT_PTR(cpu,i)->kobj));
+       kobject_put(cache_kobject[cpu]);
        cpuid4_cache_sysfs_exit(cpu);
 }
 
index ef15f35b10ed3a72811362f2e6524adf63cca263..753588755feeb6d76d079cefe64d39236438a86e 100644 (file)
@@ -456,7 +456,7 @@ recurse:
 
 out_free:
        if (b) {
-               kobject_unregister(&b->kobj);
+               kobject_put(&b->kobj);
                kfree(b);
        }
        return err;
@@ -581,7 +581,7 @@ static void deallocate_threshold_block(unsigned int cpu,
                return;
 
        list_for_each_entry_safe(pos, tmp, &head->blocks->miscj, miscj) {
-               kobject_unregister(&pos->kobj);
+               kobject_put(&pos->kobj);
                list_del(&pos->miscj);
                kfree(pos);
        }
@@ -627,7 +627,7 @@ static void threshold_remove_bank(unsigned int cpu, int bank)
        deallocate_threshold_block(cpu, bank);
 
 free_out:
-       kobject_unregister(b->kobj);
+       kobject_put(b->kobj);
        kfree(b);
        per_cpu(threshold_banks, cpu)[bank] = NULL;
 }