hc
2024-05-14 bedbef8ad3e75a304af6361af235302bcc61d06b
kernel/drivers/watchdog/rc32434_wdt.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * IDT Interprise 79RC32434 watchdog driver
34 *
....@@ -9,12 +10,6 @@
910 *
1011 * (c) Copyright 1996 Alan Cox <alan@lxorguk.ukuu.org.uk>,
1112 * All Rights Reserved.
12
- *
13
- * This program is free software; you can redistribute it and/or
14
- * modify it under the terms of the GNU General Public License
15
- * as published by the Free Software Foundation; either version
16
- * 2 of the License, or (at your option) any later version.
17
- *
1813 */
1914
2015 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
....@@ -31,7 +26,7 @@
3126 #include <linux/platform_device.h> /* For platform_driver framework */
3227 #include <linux/spinlock.h> /* For spin_lock/spin_unlock/... */
3328 #include <linux/uaccess.h> /* For copy_to_user/put_user/... */
34
-#include <linux/io.h> /* For devm_ioremap_nocache */
29
+#include <linux/io.h> /* For devm_ioremap */
3530
3631 #include <asm/mach-rc32434/integ.h> /* For the Watchdog registers */
3732
....@@ -150,7 +145,7 @@
150145 rc32434_wdt_start();
151146 rc32434_wdt_ping();
152147
153
- return nonseekable_open(inode, file);
148
+ return stream_open(inode, file);
154149 }
155150
156151 static int rc32434_wdt_release(struct inode *inode, struct file *file)
....@@ -235,7 +230,7 @@
235230 return -EFAULT;
236231 if (rc32434_wdt_set(new_timeout))
237232 return -EINVAL;
238
- /* Fall through */
233
+ fallthrough;
239234 case WDIOC_GETTIMEOUT:
240235 return copy_to_user(argp, &timeout, sizeof(int)) ? -EFAULT : 0;
241236 default:
....@@ -250,6 +245,7 @@
250245 .llseek = no_llseek,
251246 .write = rc32434_wdt_write,
252247 .unlocked_ioctl = rc32434_wdt_ioctl,
248
+ .compat_ioctl = compat_ptr_ioctl,
253249 .open = rc32434_wdt_open,
254250 .release = rc32434_wdt_release,
255251 };
....@@ -271,7 +267,7 @@
271267 return -ENODEV;
272268 }
273269
274
- wdt_reg = devm_ioremap_nocache(&pdev->dev, r->start, resource_size(r));
270
+ wdt_reg = devm_ioremap(&pdev->dev, r->start, resource_size(r));
275271 if (!wdt_reg) {
276272 pr_err("failed to remap I/O resources\n");
277273 return -ENXIO;