diff --git a/drivers/media/i2c/ov9282.c b/drivers/media/i2c/ov9282.c index 068c7449f50ed5..0b092a425cfc8c 100644 --- a/drivers/media/i2c/ov9282.c +++ b/drivers/media/i2c/ov9282.c @@ -1078,12 +1078,16 @@ static int ov9282_set_stream(struct v4l2_subdev *sd, int enable) static int ov9282_detect(struct ov9282 *ov9282) { int ret; - u32 val; + u32 val, msb; - ret = ov9282_read_reg(ov9282, OV9282_REG_ID, 2, &val); + ret = ov9282_read_reg(ov9282, OV9282_REG_ID + 1, 1, &val); + if (ret) + return ret; + ret = ov9282_read_reg(ov9282, OV9282_REG_ID, 1, &msb); if (ret) return ret; + val |= (msb << 8); if (val != OV9282_ID) { dev_err(ov9282->dev, "chip id mismatch: %x!=%x", OV9282_ID, val);