.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * 60xx Single Board Computer Watchdog Timer driver for Linux 2.2.x |
---|
3 | 4 | * |
---|
4 | 5 | * Based on acquirewdt.c by Alan Cox. |
---|
5 | | - * |
---|
6 | | - * This program is free software; you can redistribute it and/or |
---|
7 | | - * modify it under the terms of the GNU General Public License |
---|
8 | | - * as published by the Free Software Foundation; either version |
---|
9 | | - * 2 of the License, or (at your option) any later version. |
---|
10 | 6 | * |
---|
11 | 7 | * The author does NOT admit liability nor provide warranty for |
---|
12 | 8 | * any of this software. This material is provided "AS-IS" in |
---|
.. | .. |
---|
38 | 34 | * added extra printk's for startup problems |
---|
39 | 35 | * added MODULE_AUTHOR and MODULE_DESCRIPTION info |
---|
40 | 36 | * |
---|
41 | | - * |
---|
42 | 37 | * This WDT driver is different from the other Linux WDT |
---|
43 | 38 | * drivers in the following ways: |
---|
44 | 39 | * *) The driver will ping the watchdog by itself, because this |
---|
45 | 40 | * particular WDT has a very short timeout (one second) and it |
---|
46 | 41 | * would be insane to count on any userspace daemon always |
---|
47 | 42 | * getting scheduled within that time frame. |
---|
48 | | - * |
---|
49 | 43 | */ |
---|
50 | 44 | |
---|
51 | 45 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
---|
.. | .. |
---|
208 | 202 | |
---|
209 | 203 | /* Good, fire up the show */ |
---|
210 | 204 | wdt_startup(); |
---|
211 | | - return nonseekable_open(inode, file); |
---|
| 205 | + return stream_open(inode, file); |
---|
212 | 206 | } |
---|
213 | 207 | |
---|
214 | 208 | static int fop_close(struct inode *inode, struct file *file) |
---|
.. | .. |
---|
270 | 264 | |
---|
271 | 265 | timeout = new_timeout; |
---|
272 | 266 | wdt_keepalive(); |
---|
273 | | - /* Fall through */ |
---|
274 | 267 | } |
---|
| 268 | + fallthrough; |
---|
275 | 269 | case WDIOC_GETTIMEOUT: |
---|
276 | 270 | return put_user(timeout, p); |
---|
277 | 271 | default: |
---|
.. | .. |
---|
286 | 280 | .open = fop_open, |
---|
287 | 281 | .release = fop_close, |
---|
288 | 282 | .unlocked_ioctl = fop_ioctl, |
---|
| 283 | + .compat_ioctl = compat_ptr_ioctl, |
---|
289 | 284 | }; |
---|
290 | 285 | |
---|
291 | 286 | static struct miscdevice wdt_miscdev = { |
---|