[PATCH 1/1] hdpvr: code cleanup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a code cleanup after recent changes introduced by commit a503ff812430e104f591287b512aa4e3a83f20b1.

Signed-off-by: Jonathan Sims <jonathan.625266@xxxxxxxxxxxxx>
---

 drivers/media/usb/hdpvr/hdpvr-video.c | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/drivers/media/usb/hdpvr/hdpvr-video.c b/drivers/media/usb/hdpvr/hdpvr-video.c
index 7fb036d6a86e..b2ce5c0807fb 100644
--- a/drivers/media/usb/hdpvr/hdpvr-video.c
+++ b/drivers/media/usb/hdpvr/hdpvr-video.c
@@ -449,7 +449,7 @@ static ssize_t hdpvr_read(struct file *file, char __user *buffer, size_t count,
 
 		if (buf->status != BUFSTAT_READY &&
 		    dev->status != STATUS_DISCONNECTED) {
-			int err;
+
 			/* return nonblocking */
 			if (file->f_flags & O_NONBLOCK) {
 				if (!ret)
@@ -457,23 +457,19 @@ static ssize_t hdpvr_read(struct file *file, char
__user *buffer, size_t count, goto err;
 			}
 
-			err =
wait_event_interruptible_timeout(dev->wait_data,
+			ret =
wait_event_interruptible_timeout(dev->wait_data, buf->status ==
BUFSTAT_READY, msecs_to_jiffies(1000));
-			if (err < 0) {
-				ret = err;
+			if (ret < 0)
 				goto err;
-			}
-			if (!err) {
+			if (!ret) {
 				v4l2_dbg(MSG_INFO, hdpvr_debug,
&dev->v4l2_dev, "timeout: restart streaming\n");
 				hdpvr_stop_streaming(dev);
-				msecs_to_jiffies(4000);
-				err = hdpvr_start_streaming(dev);
-				if (err) {
-					ret = err;
+				msleep(4000);
+				ret = hdpvr_start_streaming(dev);
+				if (ret)
 					goto err;
-				}
 			}
 		}
 
-- 
2.11.1



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux