Commit 5df465df authored by Nicolas Kaiser's avatar Nicolas Kaiser Committed by Mauro Carvalho Chehab

[media] drivers/media: nuvoton: fix chip id probe v2

Make sure we have a matching chip id high and one or the other
of the chip id low values.
Print the values if the probe fails.
Signed-off-by: default avatarNicolas Kaiser <nikai@nikai.net>
Acked-by: default avatarJarod Wilson <jarod@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent ecfc95eb
...@@ -248,9 +248,12 @@ static int nvt_hw_detect(struct nvt_dev *nvt) ...@@ -248,9 +248,12 @@ static int nvt_hw_detect(struct nvt_dev *nvt)
chip_minor = nvt_cr_read(nvt, CR_CHIP_ID_LO); chip_minor = nvt_cr_read(nvt, CR_CHIP_ID_LO);
nvt_dbg("%s: chip id: 0x%02x 0x%02x", chip_id, chip_major, chip_minor); nvt_dbg("%s: chip id: 0x%02x 0x%02x", chip_id, chip_major, chip_minor);
if (chip_major != CHIP_ID_HIGH && if (chip_major != CHIP_ID_HIGH ||
(chip_minor != CHIP_ID_LOW || chip_minor != CHIP_ID_LOW2)) (chip_minor != CHIP_ID_LOW && chip_minor != CHIP_ID_LOW2)) {
nvt_pr(KERN_ERR, "%s: unsupported chip, id: 0x%02x 0x%02x",
chip_id, chip_major, chip_minor);
ret = -ENODEV; ret = -ENODEV;
}
nvt_efm_disable(nvt); nvt_efm_disable(nvt);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment