diff options
Diffstat (limited to 'drivers/edac/edac_stub.c')
-rw-r--r-- | drivers/edac/edac_stub.c | 27 |
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); | |||
26 | int edac_err_assert = 0; | 26 | int edac_err_assert = 0; |
27 | EXPORT_SYMBOL_GPL(edac_err_assert); | 27 | EXPORT_SYMBOL_GPL(edac_err_assert); |
28 | 28 | ||
29 | static atomic_t edac_class_valid = ATOMIC_INIT(0); | 29 | static 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 | */ |
57 | struct sysdev_class edac_class = { | 57 | struct bus_type edac_subsys = { |
58 | .name = "edac", | 58 | .name = "edac", |
59 | .dev_name = "edac", | ||
59 | }; | 60 | }; |
60 | EXPORT_SYMBOL_GPL(edac_class); | 61 | EXPORT_SYMBOL_GPL(edac_subsys); |
61 | 62 | ||
62 | /* return pointer to the 'edac' node in sysfs */ | 63 | /* return pointer to the 'edac' node in sysfs */ |
63 | struct sysdev_class *edac_get_sysfs_class(void) | 64 | struct 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 | ||
77 | out: | 78 | out: |
78 | atomic_inc(&edac_class_valid); | 79 | atomic_inc(&edac_subsys_valid); |
79 | return &edac_class; | 80 | return &edac_subsys; |
80 | } | 81 | } |
81 | EXPORT_SYMBOL_GPL(edac_get_sysfs_class); | 82 | EXPORT_SYMBOL_GPL(edac_get_sysfs_subsys); |
82 | 83 | ||
83 | void edac_put_sysfs_class(void) | 84 | void 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 | } |
89 | EXPORT_SYMBOL_GPL(edac_put_sysfs_class); | 90 | EXPORT_SYMBOL_GPL(edac_put_sysfs_subsys); |