]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
[media] drivers/media: nuvoton: fix chip id probe v2
authorNicolas Kaiser <nikai@nikai.net>
Fri, 19 Nov 2010 20:42:40 +0000 (17:42 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 29 Dec 2010 10:16:57 +0000 (08:16 -0200)
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 <nikai@nikai.net>
Acked-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/rc/nuvoton-cir.c

index 7fca6d1549ed6e4d6d1156b2a0aacaa9651affd7..dd4caf8ef80b4682ad43196a39428e8ae823c59d 100644 (file)
@@ -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);