aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog/watchdog_core.c
diff options
context:
space:
mode:
authorPratyush Anand <panand@redhat.com>2015-12-17 17:53:58 +0530
committerWim Van Sebroeck <wim@iguana.be>2015-12-27 16:54:54 +0100
commit906d7a5cfeda508e7361f021605579a00cd82815 (patch)
tree4dfcbf80d6209a1215ee5f4932e9ebcf860303e0 /drivers/watchdog/watchdog_core.c
parentwatchdog: w83627hf_wdt: use core reboot notifier (diff)
downloadlinux-dev-906d7a5cfeda508e7361f021605579a00cd82815.tar.xz
linux-dev-906d7a5cfeda508e7361f021605579a00cd82815.zip
watchdog: Use static struct class watchdog_class in stead of pointer
We need few sysfs attributes to know different status of a watchdog device. To do that, we need to associate .dev_groups with watchdog_class. So convert it from pointer to static. Putting this static struct in watchdog_dev.c, so that static device attributes defined in that file can be attached to it. Signed-off-by: Pratyush Anand <panand@redhat.com> Suggested-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/watchdog/watchdog_core.c')
-rw-r--r--drivers/watchdog/watchdog_core.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/drivers/watchdog/watchdog_core.c b/drivers/watchdog/watchdog_core.c
index 0bb32a487f46..357d23c79545 100644
--- a/drivers/watchdog/watchdog_core.c
+++ b/drivers/watchdog/watchdog_core.c
@@ -370,19 +370,9 @@ static int __init watchdog_deferred_registration(void)
static int __init watchdog_init(void)
{
- int err;
-
- watchdog_class = class_create(THIS_MODULE, "watchdog");
- if (IS_ERR(watchdog_class)) {
- pr_err("couldn't create class\n");
+ watchdog_class = watchdog_dev_init();
+ if (IS_ERR(watchdog_class))
return PTR_ERR(watchdog_class);
- }
-
- err = watchdog_dev_init();
- if (err < 0) {
- class_destroy(watchdog_class);
- return err;
- }
watchdog_deferred_registration();
return 0;
@@ -391,7 +381,6 @@ static int __init watchdog_init(void)
static void __exit watchdog_exit(void)
{
watchdog_dev_exit();
- class_destroy(watchdog_class);
ida_destroy(&watchdog_ida);
}