Skip to content

Commit

Permalink
[media] drivers/media: nuvoton: fix chip id probe v2
Browse files Browse the repository at this point in the history
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: Nicolas Kaiser <[email protected]>
Acked-by: Jarod Wilson <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
nikai3d authored and Mauro Carvalho Chehab committed Dec 29, 2010
1 parent ecfc95e commit 5df465d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/media/rc/nuvoton-cir.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,12 @@ static int nvt_hw_detect(struct nvt_dev *nvt)
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);

if (chip_major != CHIP_ID_HIGH &&
(chip_minor != CHIP_ID_LOW || chip_minor != CHIP_ID_LOW2))
if (chip_major != CHIP_ID_HIGH ||
(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;
}

nvt_efm_disable(nvt);

Expand Down

0 comments on commit 5df465d

Please sign in to comment.