staging: gpib: Return -EINTR on device clear

When the ATN (Attention) line is asserted during a read we get a
NIUSB_ATN_STATE_ERROR during a read. For the controller to send a
device clear it asserts ATN. Normally this is an error but in the case
of a device clear it should be regarded as an interrupt.

Return -EINTR when the Device Clear Active State (DCAS) is entered
else signal an error with dev_dbg with status instead of just dev_err.

Signed-off-by: Dave Penkler <dpenkler@gmail.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by Dave Penkler and committed by Greg Kroah-Hartman aaf2af1e 92a2b74a

Changed files
+6 -2
drivers
staging
gpib
ni_usb
+6 -2
drivers/staging/gpib/ni_usb/ni_usb_gpib.c
··· 697 697 */ 698 698 break; 699 699 case NIUSB_ATN_STATE_ERROR: 700 - retval = -EIO; 701 - dev_err(&usb_dev->dev, "read when ATN set\n"); 700 + if (status.ibsta & DCAS) { 701 + retval = -EINTR; 702 + } else { 703 + retval = -EIO; 704 + dev_dbg(&usb_dev->dev, "read when ATN set stat: 0x%06x\n", status.ibsta); 705 + } 702 706 break; 703 707 case NIUSB_ADDRESSING_ERROR: 704 708 retval = -EIO;