diff options
author | Magnus Damm <damm@opensource.se> | 2010-02-09 03:40:40 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-02-26 13:11:00 -0500 |
commit | d74f841c32f0b00a513d87bba646d019ef7d1f67 (patch) | |
tree | 0e030502949d32f69d6226f7965fa093501e6221 | |
parent | 6b727c68ea7083acd008da7c9734a19a4cdd52dc (diff) |
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>
-rw-r--r-- | drivers/media/video/soc_camera.c | 8 |
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, | |||
846 | struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); | 846 | struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); |
847 | struct i2c_adapter *adap = i2c_get_adapter(icl->i2c_adapter_id); | 847 | struct i2c_adapter *adap = i2c_get_adapter(icl->i2c_adapter_id); |
848 | struct v4l2_subdev *subdev; | 848 | struct v4l2_subdev *subdev; |
849 | int ret; | ||
850 | 849 | ||
851 | if (!adap) { | 850 | if (!adap) { |
852 | ret = -ENODEV; | ||
853 | dev_err(&icd->dev, "Cannot get I2C adapter #%d. No driver?\n", | 851 | dev_err(&icd->dev, "Cannot get I2C adapter #%d. No driver?\n", |
854 | icl->i2c_adapter_id); | 852 | icl->i2c_adapter_id); |
855 | goto ei2cga; | 853 | goto ei2cga; |
@@ -859,10 +857,8 @@ static int soc_camera_init_i2c(struct soc_camera_device *icd, | |||
859 | 857 | ||
860 | subdev = v4l2_i2c_new_subdev_board(&ici->v4l2_dev, adap, | 858 | subdev = v4l2_i2c_new_subdev_board(&ici->v4l2_dev, adap, |
861 | icl->module_name, icl->board_info, NULL); | 859 | icl->module_name, icl->board_info, NULL); |
862 | if (!subdev) { | 860 | if (!subdev) |
863 | ret = -ENOMEM; | ||
864 | goto ei2cnd; | 861 | goto ei2cnd; |
865 | } | ||
866 | 862 | ||
867 | client = subdev->priv; | 863 | client = subdev->priv; |
868 | 864 | ||
@@ -873,7 +869,7 @@ static int soc_camera_init_i2c(struct soc_camera_device *icd, | |||
873 | ei2cnd: | 869 | ei2cnd: |
874 | i2c_put_adapter(adap); | 870 | i2c_put_adapter(adap); |
875 | ei2cga: | 871 | ei2cga: |
876 | return ret; | 872 | return -ENODEV; |
877 | } | 873 | } |
878 | 874 | ||
879 | static void soc_camera_free_i2c(struct soc_camera_device *icd) | 875 | static void soc_camera_free_i2c(struct soc_camera_device *icd) |