hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/drivers/watchdog/ath79_wdt.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Atheros AR71XX/AR724X/AR913X built-in hardware watchdog timer.
34 *
....@@ -10,11 +11,6 @@
1011 *
1112 * which again was based on sa1100 driver,
1213 * Copyright (C) 2000 Oleg Drokin <green@crimea.edu>
13
- *
14
- * This program is free software; you can redistribute it and/or modify it
15
- * under the terms of the GNU General Public License version 2 as published
16
- * by the Free Software Foundation.
17
- *
1814 */
1915
2016 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
....@@ -132,7 +128,7 @@
132128 clear_bit(WDT_FLAGS_EXPECT_CLOSE, &wdt_flags);
133129 ath79_wdt_enable();
134130
135
- return nonseekable_open(inode, file);
131
+ return stream_open(inode, file);
136132 }
137133
138134 static int ath79_wdt_release(struct inode *inode, struct file *file)
....@@ -219,8 +215,8 @@
219215 err = ath79_wdt_set_timeout(t);
220216 if (err)
221217 break;
218
+ fallthrough;
222219
223
- /* fallthrough */
224220 case WDIOC_GETTIMEOUT:
225221 err = put_user(timeout, p);
226222 break;
....@@ -238,6 +234,7 @@
238234 .llseek = no_llseek,
239235 .write = ath79_wdt_write,
240236 .unlocked_ioctl = ath79_wdt_ioctl,
237
+ .compat_ioctl = compat_ptr_ioctl,
241238 .open = ath79_wdt_open,
242239 .release = ath79_wdt_release,
243240 };
....@@ -250,15 +247,13 @@
250247
251248 static int ath79_wdt_probe(struct platform_device *pdev)
252249 {
253
- struct resource *res;
254250 u32 ctrl;
255251 int err;
256252
257253 if (wdt_base)
258254 return -EBUSY;
259255
260
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
261
- wdt_base = devm_ioremap_resource(&pdev->dev, res);
256
+ wdt_base = devm_platform_ioremap_resource(pdev, 0);
262257 if (IS_ERR(wdt_base))
263258 return PTR_ERR(wdt_base);
264259
....@@ -308,7 +303,7 @@
308303 return 0;
309304 }
310305
311
-static void ath97_wdt_shutdown(struct platform_device *pdev)
306
+static void ath79_wdt_shutdown(struct platform_device *pdev)
312307 {
313308 ath79_wdt_disable();
314309 }
....@@ -324,7 +319,7 @@
324319 static struct platform_driver ath79_wdt_driver = {
325320 .probe = ath79_wdt_probe,
326321 .remove = ath79_wdt_remove,
327
- .shutdown = ath97_wdt_shutdown,
322
+ .shutdown = ath79_wdt_shutdown,
328323 .driver = {
329324 .name = DRIVER_NAME,
330325 .of_match_table = of_match_ptr(ath79_wdt_match),