From patchwork Wed Nov 17 10:35:25 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Kaiser X-Patchwork-Id: 331491 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oAHAiKBA006320 for ; Wed, 17 Nov 2010 10:44:21 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753977Ab0KQKhy (ORCPT ); Wed, 17 Nov 2010 05:37:54 -0500 Received: from webhosting01.bon.m2soft.com ([195.38.20.32]:46393 "EHLO webhosting01.bon.m2soft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751443Ab0KQKhx (ORCPT ); Wed, 17 Nov 2010 05:37:53 -0500 Received: from absol.kitzblitz ([91.119.2.199]) (authenticated bits=0) by webhosting01.bon.m2soft.com (8.13.8/8.13.8) with ESMTP id oAHAZL7G018985; Wed, 17 Nov 2010 11:35:21 +0100 Date: Wed, 17 Nov 2010 11:35:25 +0100 From: Nicolas Kaiser To: Mauro Carvalho Chehab Cc: Jarod Wilson , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] drivers/media: nuvoton: fix chip id probe Message-ID: <20101117113525.1ded029c@absol.kitzblitz> In-Reply-To: <4CE33527.8090800@infradead.org> References: <20101116211953.238012db@absol.kitzblitz> <20101116215408.GA17140@redhat.com> <4CE33527.8090800@infradead.org> Organization: - X-Face: "fF&[w2"Nws:JNH4'g|:gVhgGKLhj|X}}&w&V?]0=, 7n`jy8D6e[Jh=7+ca|4~t5e[ItpL5 N'y~Mvi-vJm`"1T5fi1^b!&EG]6nW~C!FN},=$G?^U2t~n[3;u\"5-|~H{-5]IQ2 X-Mailer: Claws Mail (Linux) Mime-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Wed, 17 Nov 2010 10:44:21 +0000 (UTC) diff --git a/drivers/media/IR/nuvoton-cir.c b/drivers/media/IR/nuvoton-cir.c index 301be53..92d32c8 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: chip id mismatch: 0x%02x 0x%02x", + chip_id, chip_major, chip_minor); ret = -ENODEV; + } nvt_efm_disable(nvt);