summaryrefslogtreecommitdiff
path: root/drivers/platform/x86/ibm_rtl.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/platform/x86/ibm_rtl.c')
-rw-r--r--drivers/platform/x86/ibm_rtl.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/drivers/platform/x86/ibm_rtl.c b/drivers/platform/x86/ibm_rtl.c
index 5fc665f7d9b3..231b37909801 100644
--- a/drivers/platform/x86/ibm_rtl.c
+++ b/drivers/platform/x86/ibm_rtl.c
@@ -29,6 +29,7 @@ static bool debug;
module_param(debug, bool, 0644);
MODULE_PARM_DESC(debug, "Show debug output");
+MODULE_DESCRIPTION("IBM Premium Real Time Mode (PRTM) driver");
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Keith Mannthey <kmmanth@us.ibm.com>");
MODULE_AUTHOR("Vernon Mauery <vernux@us.ibm.com>");
@@ -179,7 +180,7 @@ static ssize_t rtl_set_state(struct device *dev,
return ret;
}
-static struct bus_type rtl_subsys = {
+static const struct bus_type rtl_subsys = {
.name = "ibm_rtl",
.dev_name = "ibm_rtl",
};
@@ -199,16 +200,26 @@ static int rtl_setup_sysfs(void) {
ret = subsys_system_register(&rtl_subsys, NULL);
if (!ret) {
- for (i = 0; rtl_attributes[i]; i ++)
- device_create_file(rtl_subsys.dev_root, rtl_attributes[i]);
+ struct device *dev_root = bus_get_dev_root(&rtl_subsys);
+
+ if (dev_root) {
+ for (i = 0; rtl_attributes[i]; i ++)
+ device_create_file(dev_root, rtl_attributes[i]);
+ put_device(dev_root);
+ }
}
return ret;
}
static void rtl_teardown_sysfs(void) {
+ struct device *dev_root = bus_get_dev_root(&rtl_subsys);
int i;
- for (i = 0; rtl_attributes[i]; i ++)
- device_remove_file(rtl_subsys.dev_root, rtl_attributes[i]);
+
+ if (dev_root) {
+ for (i = 0; rtl_attributes[i]; i ++)
+ device_remove_file(dev_root, rtl_attributes[i]);
+ put_device(dev_root);
+ }
bus_unregister(&rtl_subsys);
}