aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac/edac_stub.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/edac/edac_stub.c')
-rw-r--r--drivers/edac/edac_stub.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/drivers/edac/edac_stub.c b/drivers/edac/edac_stub.c
index 86ad2eee1201..670c4481453b 100644
--- a/drivers/edac/edac_stub.c
+++ b/drivers/edac/edac_stub.c
@@ -26,7 +26,7 @@ EXPORT_SYMBOL_GPL(edac_handlers);
26int edac_err_assert = 0; 26int edac_err_assert = 0;
27EXPORT_SYMBOL_GPL(edac_err_assert); 27EXPORT_SYMBOL_GPL(edac_err_assert);
28 28
29static atomic_t edac_class_valid = ATOMIC_INIT(0); 29static atomic_t edac_subsys_valid = ATOMIC_INIT(0);
30 30
31/* 31/*
32 * called to determine if there is an EDAC driver interested in 32 * called to determine if there is an EDAC driver interested in
@@ -54,36 +54,37 @@ EXPORT_SYMBOL_GPL(edac_atomic_assert_error);
54 * sysfs object: /sys/devices/system/edac 54 * sysfs object: /sys/devices/system/edac
55 * need to export to other files 55 * need to export to other files
56 */ 56 */
57struct sysdev_class edac_class = { 57struct bus_type edac_subsys = {
58 .name = "edac", 58 .name = "edac",
59 .dev_name = "edac",
59}; 60};
60EXPORT_SYMBOL_GPL(edac_class); 61EXPORT_SYMBOL_GPL(edac_subsys);
61 62
62/* return pointer to the 'edac' node in sysfs */ 63/* return pointer to the 'edac' node in sysfs */
63struct sysdev_class *edac_get_sysfs_class(void) 64struct bus_type *edac_get_sysfs_subsys(void)
64{ 65{
65 int err = 0; 66 int err = 0;
66 67
67 if (atomic_read(&edac_class_valid)) 68 if (atomic_read(&edac_subsys_valid))
68 goto out; 69 goto out;
69 70
70 /* create the /sys/devices/system/edac directory */ 71 /* create the /sys/devices/system/edac directory */
71 err = sysdev_class_register(&edac_class); 72 err = subsys_system_register(&edac_subsys, NULL);
72 if (err) { 73 if (err) {
73 printk(KERN_ERR "Error registering toplevel EDAC sysfs dir\n"); 74 printk(KERN_ERR "Error registering toplevel EDAC sysfs dir\n");
74 return NULL; 75 return NULL;
75 } 76 }
76 77
77out: 78out:
78 atomic_inc(&edac_class_valid); 79 atomic_inc(&edac_subsys_valid);
79 return &edac_class; 80 return &edac_subsys;
80} 81}
81EXPORT_SYMBOL_GPL(edac_get_sysfs_class); 82EXPORT_SYMBOL_GPL(edac_get_sysfs_subsys);
82 83
83void edac_put_sysfs_class(void) 84void edac_put_sysfs_subsys(void)
84{ 85{
85 /* last user unregisters it */ 86 /* last user unregisters it */
86 if (atomic_dec_and_test(&edac_class_valid)) 87 if (atomic_dec_and_test(&edac_subsys_valid))
87 sysdev_class_unregister(&edac_class); 88 bus_unregister(&edac_subsys);
88} 89}
89EXPORT_SYMBOL_GPL(edac_put_sysfs_class); 90EXPORT_SYMBOL_GPL(edac_put_sysfs_subsys);