summaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorMagnus Damm <damm@opensource.se>2010-02-09 17:40:40 +0900
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-02-26 15:11:00 -0300
commitd74f841c32f0b00a513d87bba646d019ef7d1f67 (patch)
tree0e030502949d32f69d6226f7965fa093501e6221 /drivers/media/video
parent6b727c68ea7083acd008da7c9734a19a4cdd52dc (diff)
downloadlinux-d74f841c32f0b00a513d87bba646d019ef7d1f67.tar.bz2
soc-camera: return -ENODEV if sensor is missing
Update the soc-camera i2c code to return -ENODEV if a camera sensor is missing instead of -ENOMEM. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/soc_camera.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/media/video/soc_camera.c b/drivers/media/video/soc_camera.c
index 6b3fbcca7747..b91d568f3ac5 100644
--- a/drivers/media/video/soc_camera.c
+++ b/drivers/media/video/soc_camera.c
@@ -846,10 +846,8 @@ static int soc_camera_init_i2c(struct soc_camera_device *icd,
struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
struct i2c_adapter *adap = i2c_get_adapter(icl->i2c_adapter_id);
struct v4l2_subdev *subdev;
- int ret;
if (!adap) {
- ret = -ENODEV;
dev_err(&icd->dev, "Cannot get I2C adapter #%d. No driver?\n",
icl->i2c_adapter_id);
goto ei2cga;
@@ -859,10 +857,8 @@ static int soc_camera_init_i2c(struct soc_camera_device *icd,
subdev = v4l2_i2c_new_subdev_board(&ici->v4l2_dev, adap,
icl->module_name, icl->board_info, NULL);
- if (!subdev) {
- ret = -ENOMEM;
+ if (!subdev)
goto ei2cnd;
- }
client = subdev->priv;
@@ -873,7 +869,7 @@ static int soc_camera_init_i2c(struct soc_camera_device *icd,
ei2cnd:
i2c_put_adapter(adap);
ei2cga:
- return ret;
+ return -ENODEV;
}
static void soc_camera_free_i2c(struct soc_camera_device *icd)