.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0+ |
---|
1 | 2 | /* |
---|
2 | 3 | * Berkshire USB-PC Watchdog Card Driver |
---|
3 | 4 | * |
---|
.. | .. |
---|
9 | 10 | * Matt Domsch <Matt_Domsch@dell.com>, |
---|
10 | 11 | * Rob Radez <rob@osinvestor.com>, |
---|
11 | 12 | * Greg Kroah-Hartman <greg@kroah.com> |
---|
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 | 13 | * |
---|
18 | 14 | * Neither Wim Van Sebroeck nor Iguana vzw. admit liability nor |
---|
19 | 15 | * provide warranty for any of this software. This material is |
---|
.. | .. |
---|
329 | 325 | static int usb_pcwd_get_temperature(struct usb_pcwd_private *usb_pcwd, |
---|
330 | 326 | int *temperature) |
---|
331 | 327 | { |
---|
332 | | - unsigned char msb, lsb; |
---|
| 328 | + unsigned char msb = 0x00; |
---|
| 329 | + unsigned char lsb = 0x00; |
---|
333 | 330 | |
---|
334 | 331 | usb_pcwd_send_command(usb_pcwd, CMD_READ_TEMP, &msb, &lsb); |
---|
335 | 332 | |
---|
.. | .. |
---|
345 | 342 | static int usb_pcwd_get_timeleft(struct usb_pcwd_private *usb_pcwd, |
---|
346 | 343 | int *time_left) |
---|
347 | 344 | { |
---|
348 | | - unsigned char msb, lsb; |
---|
| 345 | + unsigned char msb = 0x00; |
---|
| 346 | + unsigned char lsb = 0x00; |
---|
349 | 347 | |
---|
350 | 348 | /* Read the time that's left before rebooting */ |
---|
351 | 349 | /* Note: if the board is not yet armed then we will read 0xFFFF */ |
---|
.. | .. |
---|
456 | 454 | |
---|
457 | 455 | usb_pcwd_keepalive(usb_pcwd_device); |
---|
458 | 456 | } |
---|
459 | | - /* fall through */ |
---|
| 457 | + fallthrough; |
---|
460 | 458 | |
---|
461 | 459 | case WDIOC_GETTIMEOUT: |
---|
462 | 460 | return put_user(heartbeat, p); |
---|
.. | .. |
---|
485 | 483 | /* Activate */ |
---|
486 | 484 | usb_pcwd_start(usb_pcwd_device); |
---|
487 | 485 | usb_pcwd_keepalive(usb_pcwd_device); |
---|
488 | | - return nonseekable_open(inode, file); |
---|
| 486 | + return stream_open(inode, file); |
---|
489 | 487 | } |
---|
490 | 488 | |
---|
491 | 489 | static int usb_pcwd_release(struct inode *inode, struct file *file) |
---|
.. | .. |
---|
524 | 522 | |
---|
525 | 523 | static int usb_pcwd_temperature_open(struct inode *inode, struct file *file) |
---|
526 | 524 | { |
---|
527 | | - return nonseekable_open(inode, file); |
---|
| 525 | + return stream_open(inode, file); |
---|
528 | 526 | } |
---|
529 | 527 | |
---|
530 | 528 | static int usb_pcwd_temperature_release(struct inode *inode, struct file *file) |
---|
.. | .. |
---|
554 | 552 | .llseek = no_llseek, |
---|
555 | 553 | .write = usb_pcwd_write, |
---|
556 | 554 | .unlocked_ioctl = usb_pcwd_ioctl, |
---|
| 555 | + .compat_ioctl = compat_ptr_ioctl, |
---|
557 | 556 | .open = usb_pcwd_open, |
---|
558 | 557 | .release = usb_pcwd_release, |
---|
559 | 558 | }; |
---|
.. | .. |
---|
588 | 587 | static inline void usb_pcwd_delete(struct usb_pcwd_private *usb_pcwd) |
---|
589 | 588 | { |
---|
590 | 589 | usb_free_urb(usb_pcwd->intr_urb); |
---|
591 | | - if (usb_pcwd->intr_buffer != NULL) |
---|
592 | | - usb_free_coherent(usb_pcwd->udev, usb_pcwd->intr_size, |
---|
593 | | - usb_pcwd->intr_buffer, usb_pcwd->intr_dma); |
---|
| 590 | + usb_free_coherent(usb_pcwd->udev, usb_pcwd->intr_size, |
---|
| 591 | + usb_pcwd->intr_buffer, usb_pcwd->intr_dma); |
---|
594 | 592 | kfree(usb_pcwd); |
---|
595 | 593 | } |
---|
596 | 594 | |
---|
.. | .. |
---|
660 | 658 | |
---|
661 | 659 | /* set up the memory buffer's */ |
---|
662 | 660 | usb_pcwd->intr_buffer = usb_alloc_coherent(udev, usb_pcwd->intr_size, |
---|
663 | | - GFP_ATOMIC, &usb_pcwd->intr_dma); |
---|
| 661 | + GFP_KERNEL, &usb_pcwd->intr_dma); |
---|
664 | 662 | if (!usb_pcwd->intr_buffer) { |
---|
665 | 663 | pr_err("Out of memory\n"); |
---|
666 | 664 | goto error; |
---|