diff options
-rw-r--r-- | drivers/edac/edac_mc_sysfs.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c index cbe1a17e42f7..479492819dba 100644 --- a/drivers/edac/edac_mc_sysfs.c +++ b/drivers/edac/edac_mc_sysfs.c | |||
@@ -645,7 +645,7 @@ static struct kobj_type ktype_mci = { | |||
645 | /* EDAC memory controller sysfs kset: | 645 | /* EDAC memory controller sysfs kset: |
646 | * /sys/devices/system/edac/mc | 646 | * /sys/devices/system/edac/mc |
647 | */ | 647 | */ |
648 | static struct kset mc_kset; | 648 | static struct kset *mc_kset; |
649 | 649 | ||
650 | /* | 650 | /* |
651 | * edac_mc_register_sysfs_main_kobj | 651 | * edac_mc_register_sysfs_main_kobj |
@@ -676,7 +676,7 @@ int edac_mc_register_sysfs_main_kobj(struct mem_ctl_info *mci) | |||
676 | } | 676 | } |
677 | 677 | ||
678 | /* this instance become part of the mc_kset */ | 678 | /* this instance become part of the mc_kset */ |
679 | kobj_mci->kset = &mc_kset; | 679 | kobj_mci->kset = mc_kset; |
680 | 680 | ||
681 | /* register the mc<id> kobject to the mc_kset */ | 681 | /* register the mc<id> kobject to the mc_kset */ |
682 | err = kobject_init_and_add(kobj_mci, &ktype_mci, NULL, | 682 | err = kobject_init_and_add(kobj_mci, &ktype_mci, NULL, |
@@ -906,12 +906,9 @@ int edac_sysfs_setup_mc_kset(void) | |||
906 | } | 906 | } |
907 | 907 | ||
908 | /* Init the MC's kobject */ | 908 | /* Init the MC's kobject */ |
909 | kobject_set_name(&mc_kset.kobj, "mc"); | 909 | mc_kset = kset_create_and_add("mc", NULL, &edac_class->kset.kobj); |
910 | mc_kset.kobj.parent = &edac_class->kset.kobj; | 910 | if (!mc_kset) { |
911 | 911 | err = -ENOMEM; | |
912 | /* register the mc_kset */ | ||
913 | err = kset_register(&mc_kset); | ||
914 | if (err) { | ||
915 | debugf1("%s() Failed to register '.../edac/mc'\n", __func__); | 912 | debugf1("%s() Failed to register '.../edac/mc'\n", __func__); |
916 | goto fail_out; | 913 | goto fail_out; |
917 | } | 914 | } |
@@ -933,6 +930,6 @@ fail_out: | |||
933 | */ | 930 | */ |
934 | void edac_sysfs_teardown_mc_kset(void) | 931 | void edac_sysfs_teardown_mc_kset(void) |
935 | { | 932 | { |
936 | kset_unregister(&mc_kset); | 933 | kset_unregister(mc_kset); |
937 | } | 934 | } |
938 | 935 | ||