From: Nicolas Kaiser <nikai@nikai.net>
To: Jarod Wilson <jarod@redhat.com>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] drivers/media: nuvoton: fix chip id probe v2
Date: Fri, 19 Nov 2010 21:42:40 +0100 [thread overview]
Message-ID: <20101119214240.6b87dad7@absol.kitzblitz> (raw)
In-Reply-To: <20101119191644.GF5022@redhat.com>
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>
---
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
next prev parent reply other threads:[~2010-11-19 20:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-16 20:19 [PATCH] drivers/media: nuvoton: always true expression Nicolas Kaiser
2010-11-16 21:54 ` Jarod Wilson
2010-11-17 1:51 ` Mauro Carvalho Chehab
2010-11-17 10:35 ` [PATCH] drivers/media: nuvoton: fix chip id probe Nicolas Kaiser
2010-11-19 19:16 ` Jarod Wilson
2010-11-19 20:42 ` Nicolas Kaiser [this message]
2010-11-19 21:39 ` [PATCH] drivers/media: nuvoton: fix chip id probe v2 Jarod Wilson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20101119214240.6b87dad7@absol.kitzblitz \
--to=nikai@nikai.net \
--cc=jarod@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox