hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
kernel/drivers/watchdog/machzwd.c
....@@ -1,11 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * MachZ ZF-Logic Watchdog Timer driver for Linux
3
- *
4
- *
5
- * This program is free software; you can redistribute it and/or
6
- * modify it under the terms of the GNU General Public License
7
- * as published by the Free Software Foundation; either version
8
- * 2 of the License, or (at your option) any later version.
94 *
105 * The author does NOT admit liability nor provide warranty for
116 * any of this software. This material is provided "AS-IS" in
....@@ -14,7 +9,6 @@
149 * Author: Fernando Fuganti <fuganti@conectiva.com.br>
1510 *
1611 * Based on sbc60xxwdt.c by Jakob Oestergaard
17
- *
1812 *
1913 * We have two timers (wd#1, wd#2) driven by a 32 KHz clock with the
2014 * following periods:
....@@ -177,6 +171,7 @@
177171 switch (n) {
178172 case WD1:
179173 zf_writew(COUNTER_1, new);
174
+ fallthrough;
180175 case WD2:
181176 zf_writeb(COUNTER_2, new > 0xff ? 0xff : new);
182177 default:
....@@ -318,7 +313,7 @@
318313 case WDIOC_GETBOOTSTATUS:
319314 return put_user(0, p);
320315 case WDIOC_KEEPALIVE:
321
- zf_ping(0);
316
+ zf_ping(NULL);
322317 break;
323318 default:
324319 return -ENOTTY;
....@@ -333,7 +328,7 @@
333328 if (nowayout)
334329 __module_get(THIS_MODULE);
335330 zf_timer_on();
336
- return nonseekable_open(inode, file);
331
+ return stream_open(inode, file);
337332 }
338333
339334 static int zf_close(struct inode *inode, struct file *file)
....@@ -366,6 +361,7 @@
366361 .llseek = no_llseek,
367362 .write = zf_write,
368363 .unlocked_ioctl = zf_ioctl,
364
+ .compat_ioctl = compat_ptr_ioctl,
369365 .open = zf_open,
370366 .release = zf_close,
371367 };