.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Atheros AR71XX/AR724X/AR913X built-in hardware watchdog timer. |
---|
3 | 4 | * |
---|
.. | .. |
---|
10 | 11 | * |
---|
11 | 12 | * which again was based on sa1100 driver, |
---|
12 | 13 | * Copyright (C) 2000 Oleg Drokin <green@crimea.edu> |
---|
13 | | - * |
---|
14 | | - * This program is free software; you can redistribute it and/or modify it |
---|
15 | | - * under the terms of the GNU General Public License version 2 as published |
---|
16 | | - * by the Free Software Foundation. |
---|
17 | | - * |
---|
18 | 14 | */ |
---|
19 | 15 | |
---|
20 | 16 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
---|
.. | .. |
---|
132 | 128 | clear_bit(WDT_FLAGS_EXPECT_CLOSE, &wdt_flags); |
---|
133 | 129 | ath79_wdt_enable(); |
---|
134 | 130 | |
---|
135 | | - return nonseekable_open(inode, file); |
---|
| 131 | + return stream_open(inode, file); |
---|
136 | 132 | } |
---|
137 | 133 | |
---|
138 | 134 | static int ath79_wdt_release(struct inode *inode, struct file *file) |
---|
.. | .. |
---|
219 | 215 | err = ath79_wdt_set_timeout(t); |
---|
220 | 216 | if (err) |
---|
221 | 217 | break; |
---|
| 218 | + fallthrough; |
---|
222 | 219 | |
---|
223 | | - /* fallthrough */ |
---|
224 | 220 | case WDIOC_GETTIMEOUT: |
---|
225 | 221 | err = put_user(timeout, p); |
---|
226 | 222 | break; |
---|
.. | .. |
---|
238 | 234 | .llseek = no_llseek, |
---|
239 | 235 | .write = ath79_wdt_write, |
---|
240 | 236 | .unlocked_ioctl = ath79_wdt_ioctl, |
---|
| 237 | + .compat_ioctl = compat_ptr_ioctl, |
---|
241 | 238 | .open = ath79_wdt_open, |
---|
242 | 239 | .release = ath79_wdt_release, |
---|
243 | 240 | }; |
---|
.. | .. |
---|
250 | 247 | |
---|
251 | 248 | static int ath79_wdt_probe(struct platform_device *pdev) |
---|
252 | 249 | { |
---|
253 | | - struct resource *res; |
---|
254 | 250 | u32 ctrl; |
---|
255 | 251 | int err; |
---|
256 | 252 | |
---|
257 | 253 | if (wdt_base) |
---|
258 | 254 | return -EBUSY; |
---|
259 | 255 | |
---|
260 | | - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
---|
261 | | - wdt_base = devm_ioremap_resource(&pdev->dev, res); |
---|
| 256 | + wdt_base = devm_platform_ioremap_resource(pdev, 0); |
---|
262 | 257 | if (IS_ERR(wdt_base)) |
---|
263 | 258 | return PTR_ERR(wdt_base); |
---|
264 | 259 | |
---|
.. | .. |
---|
308 | 303 | return 0; |
---|
309 | 304 | } |
---|
310 | 305 | |
---|
311 | | -static void ath97_wdt_shutdown(struct platform_device *pdev) |
---|
| 306 | +static void ath79_wdt_shutdown(struct platform_device *pdev) |
---|
312 | 307 | { |
---|
313 | 308 | ath79_wdt_disable(); |
---|
314 | 309 | } |
---|
.. | .. |
---|
324 | 319 | static struct platform_driver ath79_wdt_driver = { |
---|
325 | 320 | .probe = ath79_wdt_probe, |
---|
326 | 321 | .remove = ath79_wdt_remove, |
---|
327 | | - .shutdown = ath97_wdt_shutdown, |
---|
| 322 | + .shutdown = ath79_wdt_shutdown, |
---|
328 | 323 | .driver = { |
---|
329 | 324 | .name = DRIVER_NAME, |
---|
330 | 325 | .of_match_table = of_match_ptr(ath79_wdt_match), |
---|