hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/watchdog/twl4030_wdt.c
....@@ -1,21 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Copyright (C) Nokia Corporation
34 *
45 * Written by Timo Kokkonen <timo.t.kokkonen at nokia.com>
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License as published by
8
- * the Free Software Foundation; either version 2 of the License, or
9
- * (at your option) any later version.
10
- *
11
- * This program is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- * GNU General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU General Public License
17
- * along with this program; if not, write to the Free Software
18
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
196 */
207
218 #include <linux/module.h>
....@@ -70,10 +57,10 @@
7057
7158 static int twl4030_wdt_probe(struct platform_device *pdev)
7259 {
73
- int ret = 0;
60
+ struct device *dev = &pdev->dev;
7461 struct watchdog_device *wdt;
7562
76
- wdt = devm_kzalloc(&pdev->dev, sizeof(*wdt), GFP_KERNEL);
63
+ wdt = devm_kzalloc(dev, sizeof(*wdt), GFP_KERNEL);
7764 if (!wdt)
7865 return -ENOMEM;
7966
....@@ -83,27 +70,14 @@
8370 wdt->timeout = 30;
8471 wdt->min_timeout = 1;
8572 wdt->max_timeout = 30;
86
- wdt->parent = &pdev->dev;
73
+ wdt->parent = dev;
8774
8875 watchdog_set_nowayout(wdt, nowayout);
8976 platform_set_drvdata(pdev, wdt);
9077
9178 twl4030_wdt_stop(wdt);
9279
93
- ret = watchdog_register_device(wdt);
94
- if (ret)
95
- return ret;
96
-
97
- return 0;
98
-}
99
-
100
-static int twl4030_wdt_remove(struct platform_device *pdev)
101
-{
102
- struct watchdog_device *wdt = platform_get_drvdata(pdev);
103
-
104
- watchdog_unregister_device(wdt);
105
-
106
- return 0;
80
+ return devm_watchdog_register_device(dev, wdt);
10781 }
10882
10983 #ifdef CONFIG_PM
....@@ -137,7 +111,6 @@
137111
138112 static struct platform_driver twl4030_wdt_driver = {
139113 .probe = twl4030_wdt_probe,
140
- .remove = twl4030_wdt_remove,
141114 .suspend = twl4030_wdt_suspend,
142115 .resume = twl4030_wdt_resume,
143116 .driver = {