ChangeSet 1.1504.2.17, 2003/12/09 09:53:21-08:00, oliver@neukum.org [PATCH] USB: fix error return codes in usblp this fixes the questionable error return codes Paulo noticed in usblp. I hope I really got all cases now. drivers/usb/class/usblp.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff -Nru a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c --- a/drivers/usb/class/usblp.c Mon Dec 29 14:25:10 2003 +++ b/drivers/usb/class/usblp.c Mon Dec 29 14:25:10 2003 @@ -610,7 +610,7 @@ if (!usblp->wcomplete) { barrier(); if (file->f_flags & O_NONBLOCK) - return -EAGAIN; + return writecount ? writecount : -EAGAIN; timeout = USBLP_WRITE_TIMEOUT; add_wait_queue(&usblp->wait, &wait); @@ -673,8 +673,8 @@ usblp->writeurb->dev = usblp->dev; usblp->wcomplete = 0; - if (usb_submit_urb(usblp->writeurb, GFP_KERNEL)) { - count = -EIO; + if (err = usb_submit_urb(usblp->writeurb, GFP_KERNEL)) { + count = err != -ENOMEM ? -EIO : (writecount ? writecount : -ENOMEM); up (&usblp->sem); break; }