hc
2024-05-14 bedbef8ad3e75a304af6361af235302bcc61d06b
kernel/drivers/watchdog/mt7621_wdt.c
....@@ -1,13 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Ralink MT7621/MT7628 built-in hardware watchdog timer
34 *
45 * Copyright (C) 2014 John Crispin <john@phrozen.org>
56 *
67 * This driver was based on: drivers/watchdog/rt2880_wdt.c
7
- *
8
- * This program is free software; you can redistribute it and/or modify it
9
- * under the terms of the GNU General Public License version 2 as published
10
- * by the Free Software Foundation.
118 */
129
1310 #include <linux/clk.h>
....@@ -133,21 +130,19 @@
133130
134131 static int mt7621_wdt_probe(struct platform_device *pdev)
135132 {
136
- struct resource *res;
137
-
138
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
139
- mt7621_wdt_base = devm_ioremap_resource(&pdev->dev, res);
133
+ struct device *dev = &pdev->dev;
134
+ mt7621_wdt_base = devm_platform_ioremap_resource(pdev, 0);
140135 if (IS_ERR(mt7621_wdt_base))
141136 return PTR_ERR(mt7621_wdt_base);
142137
143
- mt7621_wdt_reset = devm_reset_control_get_exclusive(&pdev->dev, NULL);
138
+ mt7621_wdt_reset = devm_reset_control_get_exclusive(dev, NULL);
144139 if (!IS_ERR(mt7621_wdt_reset))
145140 reset_control_deassert(mt7621_wdt_reset);
146141
147142 mt7621_wdt_dev.bootstatus = mt7621_wdt_bootcause();
148143
149144 watchdog_init_timeout(&mt7621_wdt_dev, mt7621_wdt_dev.max_timeout,
150
- &pdev->dev);
145
+ dev);
151146 watchdog_set_nowayout(&mt7621_wdt_dev, nowayout);
152147 if (mt7621_wdt_is_running(&mt7621_wdt_dev)) {
153148 /*
....@@ -164,7 +159,7 @@
164159 set_bit(WDOG_HW_RUNNING, &mt7621_wdt_dev.status);
165160 }
166161
167
- return devm_watchdog_register_device(&pdev->dev, &mt7621_wdt_dev);
162
+ return devm_watchdog_register_device(dev, &mt7621_wdt_dev);
168163 }
169164
170165 static void mt7621_wdt_shutdown(struct platform_device *pdev)