mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
media: i2c: ov8858: fix unexpected id issue
ov8858 checked unexpected sensor id, while ret may be 0; thus it will continue register, but ov8858_global_regs & supported_modes are still null pointer. This results crash in ov8858_s_power function, when ov8858_global_regs & supported_modes are called; so fix it. Signed-off-by: Wang Panzhenzhuan <randy.wang@rock-chips.com> Change-Id: Idb65a593f526572f4a4423464a1daf0299a3aa5c
This commit is contained in:
committed by
Tao Huang
parent
99e10612ff
commit
2a87dcbb15
@@ -2791,14 +2791,14 @@ static int ov8858_check_sensor_id(struct ov8858 *ov8858,
|
||||
OV8858_REG_VALUE_24BIT, &id);
|
||||
if (id != CHIP_ID) {
|
||||
dev_err(dev, "Unexpected sensor id(%06x), ret(%d)\n", id, ret);
|
||||
return ret;
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
ret = ov8858_read_reg(client, OV8858_CHIP_REVISION_REG,
|
||||
OV8858_REG_VALUE_08BIT, &id);
|
||||
if (ret) {
|
||||
dev_err(dev, "Read chip revision register error\n");
|
||||
return ret;
|
||||
return -ENODEV;
|
||||
}
|
||||
dev_info(dev, "Detected OV%06x sensor, REVISION 0x%x\n", CHIP_ID, id);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user