| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * IDT Interprise 79RC32434 watchdog driver |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 9 | 10 | * |
|---|
| 10 | 11 | * (c) Copyright 1996 Alan Cox <alan@lxorguk.ukuu.org.uk>, |
|---|
| 11 | 12 | * 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 | | - * |
|---|
| 18 | 13 | */ |
|---|
| 19 | 14 | |
|---|
| 20 | 15 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
|---|
| .. | .. |
|---|
| 31 | 26 | #include <linux/platform_device.h> /* For platform_driver framework */ |
|---|
| 32 | 27 | #include <linux/spinlock.h> /* For spin_lock/spin_unlock/... */ |
|---|
| 33 | 28 | #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 */ |
|---|
| 35 | 30 | |
|---|
| 36 | 31 | #include <asm/mach-rc32434/integ.h> /* For the Watchdog registers */ |
|---|
| 37 | 32 | |
|---|
| .. | .. |
|---|
| 150 | 145 | rc32434_wdt_start(); |
|---|
| 151 | 146 | rc32434_wdt_ping(); |
|---|
| 152 | 147 | |
|---|
| 153 | | - return nonseekable_open(inode, file); |
|---|
| 148 | + return stream_open(inode, file); |
|---|
| 154 | 149 | } |
|---|
| 155 | 150 | |
|---|
| 156 | 151 | static int rc32434_wdt_release(struct inode *inode, struct file *file) |
|---|
| .. | .. |
|---|
| 235 | 230 | return -EFAULT; |
|---|
| 236 | 231 | if (rc32434_wdt_set(new_timeout)) |
|---|
| 237 | 232 | return -EINVAL; |
|---|
| 238 | | - /* Fall through */ |
|---|
| 233 | + fallthrough; |
|---|
| 239 | 234 | case WDIOC_GETTIMEOUT: |
|---|
| 240 | 235 | return copy_to_user(argp, &timeout, sizeof(int)) ? -EFAULT : 0; |
|---|
| 241 | 236 | default: |
|---|
| .. | .. |
|---|
| 250 | 245 | .llseek = no_llseek, |
|---|
| 251 | 246 | .write = rc32434_wdt_write, |
|---|
| 252 | 247 | .unlocked_ioctl = rc32434_wdt_ioctl, |
|---|
| 248 | + .compat_ioctl = compat_ptr_ioctl, |
|---|
| 253 | 249 | .open = rc32434_wdt_open, |
|---|
| 254 | 250 | .release = rc32434_wdt_release, |
|---|
| 255 | 251 | }; |
|---|
| .. | .. |
|---|
| 271 | 267 | return -ENODEV; |
|---|
| 272 | 268 | } |
|---|
| 273 | 269 | |
|---|
| 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)); |
|---|
| 275 | 271 | if (!wdt_reg) { |
|---|
| 276 | 272 | pr_err("failed to remap I/O resources\n"); |
|---|
| 277 | 273 | return -ENXIO; |
|---|