diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2008-12-17 14:05:38 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-12-30 09:40:14 -0200 |
commit | 297a7ef700ce2e91ed0f941034541d1563ef0a7d (patch) | |
tree | 923b2e5c500f20c615ba5da1826c809b3043e801 /drivers/media/video/mt9v022.c | |
parent | 88f4b8990fd2b4d856f63c3689bb4df18029da06 (diff) | |
download | kernel_samsung_aries-297a7ef700ce2e91ed0f941034541d1563ef0a7d.zip kernel_samsung_aries-297a7ef700ce2e91ed0f941034541d1563ef0a7d.tar.gz kernel_samsung_aries-297a7ef700ce2e91ed0f941034541d1563ef0a7d.tar.bz2 |
V4L/DVB (10066): mt9m001 mt9v022: fix bus-width switch GPIO availability test
Testing for non-NULL platform-data is not enough, we have to check if the GPIO
in the platform data is valid or not. Also see my earlier patch:
[ARM] pxa/pcm990: use negative number for an invalid GPIO in camera data
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/mt9v022.c')
-rw-r--r-- | drivers/media/video/mt9v022.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/media/video/mt9v022.c b/drivers/media/video/mt9v022.c index 3a39f02..82e1a33 100644 --- a/drivers/media/video/mt9v022.c +++ b/drivers/media/video/mt9v022.c @@ -690,6 +690,7 @@ static int mt9v022_set_control(struct soc_camera_device *icd, static int mt9v022_video_probe(struct soc_camera_device *icd) { struct mt9v022 *mt9v022 = container_of(icd, struct mt9v022, icd); + struct soc_camera_link *icl = mt9v022->client->dev.platform_data; s32 data; int ret; @@ -725,7 +726,7 @@ static int mt9v022_video_probe(struct soc_camera_device *icd) ret = reg_write(icd, MT9V022_PIXEL_OPERATION_MODE, 4 | 0x11); mt9v022->model = V4L2_IDENT_MT9V022IX7ATC; icd->formats = mt9v022_colour_formats; - if (mt9v022->client->dev.platform_data) + if (gpio_is_valid(icl->gpio)) icd->num_formats = ARRAY_SIZE(mt9v022_colour_formats); else icd->num_formats = 1; @@ -733,7 +734,7 @@ static int mt9v022_video_probe(struct soc_camera_device *icd) ret = reg_write(icd, MT9V022_PIXEL_OPERATION_MODE, 0x11); mt9v022->model = V4L2_IDENT_MT9V022IX7ATM; icd->formats = mt9v022_monochrome_formats; - if (mt9v022->client->dev.platform_data) + if (gpio_is_valid(icl->gpio)) icd->num_formats = ARRAY_SIZE(mt9v022_monochrome_formats); else icd->num_formats = 1; |