Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 79f10b62 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab
Browse files

[media] hdpvr: code cleanup



Remove an unnecessary 'else' and invert a condition which makes the code
more readable.

Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent ab6e134a
Loading
Loading
Loading
Loading
+27 −27
Original line number Diff line number Diff line
@@ -281,12 +281,17 @@ static int hdpvr_start_streaming(struct hdpvr_device *dev)

	if (dev->status == STATUS_STREAMING)
		return 0;
	else if (dev->status != STATUS_IDLE)
	if (dev->status != STATUS_IDLE)
		return -EAGAIN;

	ret = get_video_info(dev, &vidinf);
	if (ret) {
		msleep(250);
		v4l2_dbg(MSG_INFO, hdpvr_debug, &dev->v4l2_dev,
				"no video signal at input %d\n", dev->options.video_input);
		return -EAGAIN;
	}

	if (!ret) {
	v4l2_dbg(MSG_BUFFER, hdpvr_debug, &dev->v4l2_dev,
			"video signal: %dx%d@%dhz\n", vidinf.width,
			vidinf.height, vidinf.fps);
@@ -314,11 +319,6 @@ static int hdpvr_start_streaming(struct hdpvr_device *dev)

	return 0;
}
	msleep(250);
	v4l2_dbg(MSG_INFO, hdpvr_debug, &dev->v4l2_dev,
		 "no video signal at input %d\n", dev->options.video_input);
	return -EAGAIN;
}


/* function expects dev->io_mutex to be hold by caller */