Skip to content

Commit 57a0c1e

Browse files
committed
Merge tag 'edac_fixes_for_3.8' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp
Pull EDAC fixes from Borislav Petkov: "Two error path fixes causing a crash and a Kconfig fix for an issue which spilled all EDAC suboptions into the 'Device Drivers' menu." * tag 'edac_fixes_for_3.8' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp: EDAC: Cleanup device deregistering path EDAC: Fix EDAC Kconfig menu EDAC: Fix kernel panic on module unloading
2 parents e53289c + 44d22e2 commit 57a0c1e

File tree

2 files changed

+9
-18
lines changed

2 files changed

+9
-18
lines changed

drivers/edac/Kconfig

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
# Licensed and distributed under the GPL
55
#
66

7+
config EDAC_SUPPORT
8+
bool
9+
710
menuconfig EDAC
811
bool "EDAC (Error Detection And Correction) reporting"
912
depends on HAS_IOMEM
@@ -27,13 +30,8 @@ menuconfig EDAC
2730
There is also a mailing list for the EDAC project, which can
2831
be found via the sourceforge page.
2932

30-
config EDAC_SUPPORT
31-
bool
32-
3333
if EDAC
3434

35-
comment "Reporting subsystems"
36-
3735
config EDAC_LEGACY_SYSFS
3836
bool "EDAC legacy sysfs"
3937
default y

drivers/edac/edac_mc_sysfs.c

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -472,8 +472,7 @@ static void edac_delete_csrow_objects(struct mem_ctl_info *mci)
472472
device_remove_file(&csrow->dev,
473473
dynamic_csrow_ce_count_attr[chan]);
474474
}
475-
put_device(&mci->csrows[i]->dev);
476-
device_del(&mci->csrows[i]->dev);
475+
device_unregister(&mci->csrows[i]->dev);
477476
}
478477
}
479478
#endif
@@ -1055,11 +1054,9 @@ int edac_create_sysfs_mci_device(struct mem_ctl_info *mci)
10551054
struct dimm_info *dimm = mci->dimms[i];
10561055
if (dimm->nr_pages == 0)
10571056
continue;
1058-
put_device(&dimm->dev);
1059-
device_del(&dimm->dev);
1057+
device_unregister(&dimm->dev);
10601058
}
1061-
put_device(&mci->dev);
1062-
device_del(&mci->dev);
1059+
device_unregister(&mci->dev);
10631060
bus_unregister(&mci->bus);
10641061
kfree(mci->bus.name);
10651062
return err;
@@ -1086,16 +1083,14 @@ void edac_remove_sysfs_mci_device(struct mem_ctl_info *mci)
10861083
if (dimm->nr_pages == 0)
10871084
continue;
10881085
edac_dbg(0, "removing device %s\n", dev_name(&dimm->dev));
1089-
put_device(&dimm->dev);
1090-
device_del(&dimm->dev);
1086+
device_unregister(&dimm->dev);
10911087
}
10921088
}
10931089

10941090
void edac_unregister_sysfs(struct mem_ctl_info *mci)
10951091
{
10961092
edac_dbg(1, "Unregistering device %s\n", dev_name(&mci->dev));
1097-
put_device(&mci->dev);
1098-
device_del(&mci->dev);
1093+
device_unregister(&mci->dev);
10991094
bus_unregister(&mci->bus);
11001095
kfree(mci->bus.name);
11011096
}
@@ -1159,8 +1154,6 @@ int __init edac_mc_sysfs_init(void)
11591154

11601155
void __exit edac_mc_sysfs_exit(void)
11611156
{
1162-
put_device(mci_pdev);
1163-
device_del(mci_pdev);
1157+
device_unregister(mci_pdev);
11641158
edac_put_sysfs_subsys();
1165-
kfree(mci_pdev);
11661159
}

0 commit comments

Comments
 (0)