Skip to content

Commit

Permalink
soc-camera: return -ENODEV if sensor is missing
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Magnus Damm authored and Mauro Carvalho Chehab committed Feb 26, 2010
1 parent 6b727c6 commit d74f841
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions drivers/media/video/soc_camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand All @@ -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)
Expand Down

0 comments on commit d74f841

Please sign in to comment.