| .. | .. |
|---|
| 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 |
|---|
| .. | .. |
|---|
| 456 | 452 | |
|---|
| 457 | 453 | usb_pcwd_keepalive(usb_pcwd_device); |
|---|
| 458 | 454 | } |
|---|
| 459 | | - /* fall through */ |
|---|
| 455 | + fallthrough; |
|---|
| 460 | 456 | |
|---|
| 461 | 457 | case WDIOC_GETTIMEOUT: |
|---|
| 462 | 458 | return put_user(heartbeat, p); |
|---|
| .. | .. |
|---|
| 485 | 481 | /* Activate */ |
|---|
| 486 | 482 | usb_pcwd_start(usb_pcwd_device); |
|---|
| 487 | 483 | usb_pcwd_keepalive(usb_pcwd_device); |
|---|
| 488 | | - return nonseekable_open(inode, file); |
|---|
| 484 | + return stream_open(inode, file); |
|---|
| 489 | 485 | } |
|---|
| 490 | 486 | |
|---|
| 491 | 487 | static int usb_pcwd_release(struct inode *inode, struct file *file) |
|---|
| .. | .. |
|---|
| 524 | 520 | |
|---|
| 525 | 521 | static int usb_pcwd_temperature_open(struct inode *inode, struct file *file) |
|---|
| 526 | 522 | { |
|---|
| 527 | | - return nonseekable_open(inode, file); |
|---|
| 523 | + return stream_open(inode, file); |
|---|
| 528 | 524 | } |
|---|
| 529 | 525 | |
|---|
| 530 | 526 | static int usb_pcwd_temperature_release(struct inode *inode, struct file *file) |
|---|
| .. | .. |
|---|
| 554 | 550 | .llseek = no_llseek, |
|---|
| 555 | 551 | .write = usb_pcwd_write, |
|---|
| 556 | 552 | .unlocked_ioctl = usb_pcwd_ioctl, |
|---|
| 553 | + .compat_ioctl = compat_ptr_ioctl, |
|---|
| 557 | 554 | .open = usb_pcwd_open, |
|---|
| 558 | 555 | .release = usb_pcwd_release, |
|---|
| 559 | 556 | }; |
|---|
| .. | .. |
|---|
| 588 | 585 | static inline void usb_pcwd_delete(struct usb_pcwd_private *usb_pcwd) |
|---|
| 589 | 586 | { |
|---|
| 590 | 587 | 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); |
|---|
| 588 | + usb_free_coherent(usb_pcwd->udev, usb_pcwd->intr_size, |
|---|
| 589 | + usb_pcwd->intr_buffer, usb_pcwd->intr_dma); |
|---|
| 594 | 590 | kfree(usb_pcwd); |
|---|
| 595 | 591 | } |
|---|
| 596 | 592 | |
|---|
| .. | .. |
|---|
| 660 | 656 | |
|---|
| 661 | 657 | /* set up the memory buffer's */ |
|---|
| 662 | 658 | usb_pcwd->intr_buffer = usb_alloc_coherent(udev, usb_pcwd->intr_size, |
|---|
| 663 | | - GFP_ATOMIC, &usb_pcwd->intr_dma); |
|---|
| 659 | + GFP_KERNEL, &usb_pcwd->intr_dma); |
|---|
| 664 | 660 | if (!usb_pcwd->intr_buffer) { |
|---|
| 665 | 661 | pr_err("Out of memory\n"); |
|---|
| 666 | 662 | goto error; |
|---|