diff mbox

[v2,2/9] Zero dev in main()

Message ID 1397167605-29956-2-git-send-email-sakari.ailus@iki.fi (mailing list archive)
State New, archived
Headers show

Commit Message

Sakari Ailus April 10, 2014, 10:06 p.m. UTC
This is necessary since video_open() may not be always called soon

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
---
 yavta.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox

Patch

diff --git a/yavta.c b/yavta.c
index d7bccfd..18e1709 100644
--- a/yavta.c
+++ b/yavta.c
@@ -226,7 +226,6 @@  static int video_open(struct device *dev, const char *devname, int no_query)
 	unsigned int capabilities;
 	int ret;
 
-	memset(dev, 0, sizeof *dev);
 	dev->fd = -1;
 	dev->memtype = V4L2_MEMORY_MMAP;
 	dev->buffers = NULL;
@@ -1562,7 +1561,7 @@  static struct option opts[] = {
 int main(int argc, char *argv[])
 {
 	struct sched_param sched;
-	struct device dev;
+	struct device dev = { 0 };
 	int ret;
 
 	/* Options parsings */