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

2010-11-19 Thread Nicolas Kaiser
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 ni...@nikai.net
---
 drivers/media/IR/nuvoton-cir.c |7 +--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/media/IR/nuvoton-cir.c b/drivers/media/IR/nuvoton-cir.c
index 301be53..e3274ef 100644
--- a/drivers/media/IR/nuvoton-cir.c
+++ b/drivers/media/IR/nuvoton-cir.c
@@ -249,9 +249,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);
 
-- 
1.7.2.2
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

2010-11-19 Thread Jarod Wilson
On Fri, Nov 19, 2010 at 09:42:40PM +0100, Nicolas Kaiser wrote:
 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 ni...@nikai.net

That works for me, thanks much.

Acked-by: Jarod Wilson ja...@redhat.com

-- 
Jarod Wilson
ja...@redhat.com

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html