edac: core fix static to dynamic kset

Static kobjects and ksets are not supported in Linux kernel. Convert the
mc_kset from static to dynamic. This patch depends on my previous patch
to remove the module parameter attributes from mc...

Signed-off-by: Arthur Jones <ajones@riverbed.com>
Signed-off-by: Doug Thompson <dougthompson@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Arthur Jones and committed by
Linus Torvalds
f9fc82ad 327dafb1

+6 -9
+6 -9
drivers/edac/edac_mc_sysfs.c
··· 645 /* EDAC memory controller sysfs kset: 646 * /sys/devices/system/edac/mc 647 */ 648 - static struct kset mc_kset; 649 650 /* 651 * edac_mc_register_sysfs_main_kobj ··· 676 } 677 678 /* this instance become part of the mc_kset */ 679 - kobj_mci->kset = &mc_kset; 680 681 /* register the mc<id> kobject to the mc_kset */ 682 err = kobject_init_and_add(kobj_mci, &ktype_mci, NULL, ··· 906 } 907 908 /* Init the MC's kobject */ 909 - kobject_set_name(&mc_kset.kobj, "mc"); 910 - mc_kset.kobj.parent = &edac_class->kset.kobj; 911 - 912 - /* register the mc_kset */ 913 - err = kset_register(&mc_kset); 914 - if (err) { 915 debugf1("%s() Failed to register '.../edac/mc'\n", __func__); 916 goto fail_out; 917 } ··· 930 */ 931 void edac_sysfs_teardown_mc_kset(void) 932 { 933 - kset_unregister(&mc_kset); 934 } 935
··· 645 /* EDAC memory controller sysfs kset: 646 * /sys/devices/system/edac/mc 647 */ 648 + static struct kset *mc_kset; 649 650 /* 651 * edac_mc_register_sysfs_main_kobj ··· 676 } 677 678 /* this instance become part of the mc_kset */ 679 + kobj_mci->kset = mc_kset; 680 681 /* register the mc<id> kobject to the mc_kset */ 682 err = kobject_init_and_add(kobj_mci, &ktype_mci, NULL, ··· 906 } 907 908 /* Init the MC's kobject */ 909 + mc_kset = kset_create_and_add("mc", NULL, &edac_class->kset.kobj); 910 + if (!mc_kset) { 911 + err = -ENOMEM; 912 debugf1("%s() Failed to register '.../edac/mc'\n", __func__); 913 goto fail_out; 914 } ··· 933 */ 934 void edac_sysfs_teardown_mc_kset(void) 935 { 936 + kset_unregister(mc_kset); 937 } 938