| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * 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. |
|---|
| 9 | 4 | * |
|---|
| 10 | 5 | * The author does NOT admit liability nor provide warranty for |
|---|
| 11 | 6 | * any of this software. This material is provided "AS-IS" in |
|---|
| .. | .. |
|---|
| 14 | 9 | * Author: Fernando Fuganti <fuganti@conectiva.com.br> |
|---|
| 15 | 10 | * |
|---|
| 16 | 11 | * Based on sbc60xxwdt.c by Jakob Oestergaard |
|---|
| 17 | | - * |
|---|
| 18 | 12 | * |
|---|
| 19 | 13 | * We have two timers (wd#1, wd#2) driven by a 32 KHz clock with the |
|---|
| 20 | 14 | * following periods: |
|---|
| .. | .. |
|---|
| 177 | 171 | switch (n) { |
|---|
| 178 | 172 | case WD1: |
|---|
| 179 | 173 | zf_writew(COUNTER_1, new); |
|---|
| 174 | + fallthrough; |
|---|
| 180 | 175 | case WD2: |
|---|
| 181 | 176 | zf_writeb(COUNTER_2, new > 0xff ? 0xff : new); |
|---|
| 182 | 177 | default: |
|---|
| .. | .. |
|---|
| 318 | 313 | case WDIOC_GETBOOTSTATUS: |
|---|
| 319 | 314 | return put_user(0, p); |
|---|
| 320 | 315 | case WDIOC_KEEPALIVE: |
|---|
| 321 | | - zf_ping(0); |
|---|
| 316 | + zf_ping(NULL); |
|---|
| 322 | 317 | break; |
|---|
| 323 | 318 | default: |
|---|
| 324 | 319 | return -ENOTTY; |
|---|
| .. | .. |
|---|
| 333 | 328 | if (nowayout) |
|---|
| 334 | 329 | __module_get(THIS_MODULE); |
|---|
| 335 | 330 | zf_timer_on(); |
|---|
| 336 | | - return nonseekable_open(inode, file); |
|---|
| 331 | + return stream_open(inode, file); |
|---|
| 337 | 332 | } |
|---|
| 338 | 333 | |
|---|
| 339 | 334 | static int zf_close(struct inode *inode, struct file *file) |
|---|
| .. | .. |
|---|
| 366 | 361 | .llseek = no_llseek, |
|---|
| 367 | 362 | .write = zf_write, |
|---|
| 368 | 363 | .unlocked_ioctl = zf_ioctl, |
|---|
| 364 | + .compat_ioctl = compat_ptr_ioctl, |
|---|
| 369 | 365 | .open = zf_open, |
|---|
| 370 | 366 | .release = zf_close, |
|---|
| 371 | 367 | }; |
|---|