diff options
author | Benoit Parrot <[email protected]> | 2019-09-30 10:06:38 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <[email protected]> | 2019-10-01 17:34:12 -0300 |
commit | 1bc06fdbdf540b99db45b4e32669822a8a1d6870 (patch) | |
tree | 7e5f87ba313bd02c6a2211c86d3fe31a5ae80ee7 | |
parent | 7359fac5a47897e6587ac82896257a60c700ac7d (diff) |
media: i2c: ov2659: Fix sensor detection to actually fail when device is not present
Make sure that if the expected sensor device id register
is not recognized properly the failure is propagated
up so devices are not left partially initialized.
Signed-off-by: Benoit Parrot <[email protected]>
Signed-off-by: Jyri Sarha <[email protected]>
Acked-by: Lad, Prabhakar <[email protected]>
Signed-off-by: Sakari Ailus <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
-rw-r--r-- | drivers/media/i2c/ov2659.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/media/i2c/ov2659.c b/drivers/media/i2c/ov2659.c index 17573257097d..efbe6dc720e2 100644 --- a/drivers/media/i2c/ov2659.c +++ b/drivers/media/i2c/ov2659.c @@ -1330,11 +1330,12 @@ static int ov2659_detect(struct v4l2_subdev *sd) unsigned short id; id = OV265X_ID(pid, ver); - if (id != OV2659_ID) + if (id != OV2659_ID) { dev_err(&client->dev, "Sensor detection failed (%04X, %d)\n", id, ret); - else { + ret = -ENODEV; + } else { dev_info(&client->dev, "Found OV%04X sensor\n", id); ret = ov2659_init(sd, 0); } |