Skip to content

Commit

Permalink
V4L/DVB (10945): pwc : fix LED and power setup for first open
Browse files Browse the repository at this point in the history
Call pwc_construct before trying to talk to device to obtain vc interface so
that LED and power setup works the first time the video device is opened.

Signed-off-by: Martin Fuzzey <mfuzzey@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Martin Fuzzey authored and Mauro Carvalho Chehab committed Mar 30, 2009
1 parent 76ecf45 commit 5c8e240
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/video/pwc/pwc-if.c
Original file line number Diff line number Diff line change
Expand Up @@ -1125,6 +1125,7 @@ static int pwc_video_open(struct file *file)
}

mutex_lock(&pdev->modlock);
pwc_construct(pdev); /* set min/max sizes correct */
if (!pdev->usb_init) {
PWC_DEBUG_OPEN("Doing first time initialization.\n");
pdev->usb_init = 1;
Expand All @@ -1149,7 +1150,6 @@ static int pwc_video_open(struct file *file)
if (pwc_set_leds(pdev, led_on, led_off) < 0)
PWC_DEBUG_OPEN("Failed to set LED on/off time.\n");

pwc_construct(pdev); /* set min/max sizes correct */

/* So far, so good. Allocate memory. */
i = pwc_allocate_buffers(pdev);
Expand Down

0 comments on commit 5c8e240

Please sign in to comment.