aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2007-09-12 18:06:57 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-10-12 17:51:02 -0400
commit34980ca8faebfcce31094eba6ffbb0113950361f (patch)
tree1339b5a059fdc34e688d5571749577e8f3f96f09 /drivers
parent7e7654a92a5a75a350cc3458389bc76273498f6a (diff)
Drivers: clean up direct setting of the name of a kset
A kset should not have its name set directly, so dynamically set the name at runtime. This is needed to remove the static array in the kobject structure which will be changed in a future patch. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/edac/edac_mc_sysfs.c3
-rw-r--r--drivers/pci/hotplug/rpadlpar_sysfs.c6
2 files changed, 5 insertions, 4 deletions
diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c
index 4a0576bd06fc..3706b2bc0987 100644
--- a/drivers/edac/edac_mc_sysfs.c
+++ b/drivers/edac/edac_mc_sysfs.c
@@ -743,7 +743,7 @@ static struct kobj_type ktype_mc_set_attribs = {
743 * /sys/devices/system/edac/mc 743 * /sys/devices/system/edac/mc
744 */ 744 */
745static struct kset mc_kset = { 745static struct kset mc_kset = {
746 .kobj = {.name = "mc", .ktype = &ktype_mc_set_attribs }, 746 .kobj = {.ktype = &ktype_mc_set_attribs },
747 .ktype = &ktype_mci, 747 .ktype = &ktype_mci,
748}; 748};
749 749
@@ -1010,6 +1010,7 @@ int edac_sysfs_setup_mc_kset(void)
1010 } 1010 }
1011 1011
1012 /* Init the MC's kobject */ 1012 /* Init the MC's kobject */
1013 kobject_set_name(&mc_kset.kobj, "mc");
1013 mc_kset.kobj.parent = &edac_class->kset.kobj; 1014 mc_kset.kobj.parent = &edac_class->kset.kobj;
1014 1015
1015 /* register the mc_kset */ 1016 /* register the mc_kset */
diff --git a/drivers/pci/hotplug/rpadlpar_sysfs.c b/drivers/pci/hotplug/rpadlpar_sysfs.c
index df076064a3e0..a080fedf0332 100644
--- a/drivers/pci/hotplug/rpadlpar_sysfs.c
+++ b/drivers/pci/hotplug/rpadlpar_sysfs.c
@@ -129,17 +129,17 @@ struct kobj_type ktype_dlpar_io = {
129}; 129};
130 130
131struct kset dlpar_io_kset = { 131struct kset dlpar_io_kset = {
132 .kobj = {.name = DLPAR_KOBJ_NAME, 132 .kobj = {.ktype = &ktype_dlpar_io,
133 .ktype = &ktype_dlpar_io,
134 .parent = &pci_hotplug_slots_subsys.kobj}, 133 .parent = &pci_hotplug_slots_subsys.kobj},
135 .ktype = &ktype_dlpar_io, 134 .ktype = &ktype_dlpar_io,
136}; 135};
137 136
138int dlpar_sysfs_init(void) 137int dlpar_sysfs_init(void)
139{ 138{
139 kobject_set_name(&dlpar_io_kset.kobj, DLPAR_KOBJ_NAME);
140 if (kset_register(&dlpar_io_kset)) { 140 if (kset_register(&dlpar_io_kset)) {
141 printk(KERN_ERR "rpadlpar_io: cannot register kset for %s\n", 141 printk(KERN_ERR "rpadlpar_io: cannot register kset for %s\n",
142 dlpar_io_kset.kobj.name); 142 kobject_name(&dlpar_io_kset.kobj));
143 return -EINVAL; 143 return -EINVAL;
144 } 144 }
145 145