]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[media] ml86v7667: fix the querystd implementation
authorHans Verkuil <hans.verkuil@cisco.com>
Fri, 31 May 2013 08:15:17 +0000 (05:15 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 13 Jun 2013 14:38:50 +0000 (11:38 -0300)
The *std should be set to V4L2_STD_UNKNOWN, not the function's return code.
Also, *std should be ANDed with 525_60 or 625_50.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/i2c/ml86v7667.c

index 0f256d3cc62b1d14416f3c247b5f0aa03a888cfc..cd9f86e743b24753f841404a4ee4211d32284c53 100644 (file)
@@ -169,10 +169,10 @@ static int ml86v7667_querystd(struct v4l2_subdev *sd, v4l2_std_id *std)
        if (status < 0)
                return status;
 
-       if (!(status & STATUS_HLOCK_DETECT))
-               return V4L2_STD_UNKNOWN;
-
-       *std = status & STATUS_NTSCPAL ? V4L2_STD_625_50 : V4L2_STD_525_60;
+       if (status & STATUS_HLOCK_DETECT)
+               *std &= status & STATUS_NTSCPAL ? V4L2_STD_625_50 : V4L2_STD_525_60;
+       else
+               *std = V4L2_STD_UNKNOWN;
 
        return 0;
 }