From patchwork Thu Sep 25 08:36:46 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Jian X-Patchwork-Id: 1465 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 0218FDE275 for ; Thu, 25 Sep 2008 18:45:50 +1000 (EST) X-Original-To: linuxppc-dev@ozlabs.org Delivered-To: linuxppc-dev@ozlabs.org Received: from mx.linux.net.cn (unknown [210.82.31.146]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C9018DDDEC for ; Thu, 25 Sep 2008 18:45:36 +1000 (EST) Received: from debian (unknown [218.241.174.18]) by mx.linux.net.cn (Postfix) with ESMTP id 807833ED42 for ; Thu, 25 Sep 2008 16:58:18 +0800 (CST) Date: Thu, 25 Sep 2008 16:36:46 +0800 From: Wang Jian To: linuxppc-dev@ozlabs.org Subject: [PATCH] pata_platform struct resource signness fix Message-ID: <20080925083622.GA2701@debian> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: linuxppc-dev@ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Hi, This patch is to pata_platform.c but at this time, it's powerpc specific because it can only be triggerred using openfirmware, so I post the patch here. The patch is against 2.6.26-rc8. The problem is triggerred when ata device is populated using pata_of_platform.c, and no irq is assigned (poll mode, such as CF card). pata_of_platform_probe() parse device tree and if (ret == NO_IRQ) irq_res.start = irq_res.end = -1; Then irq is 0xffffffff, not NULL. Probe will fail coz irq can't be requested. --- (irq_res->start > 0) will be true even when it is (-1). When the device has no irq, irq_res->start is assigned (-1). Signed-off-by: Wang Jian --- drivers/ata/pata_platform.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/ata/pata_platform.c b/drivers/ata/pata_platform.c index 8f65ad6..b12cd0c 100644 --- a/drivers/ata/pata_platform.c +++ b/drivers/ata/pata_platform.c @@ -123,7 +123,7 @@ int __devinit __pata_platform_probe(struct device *dev, /* * And the IRQ */ - if (irq_res && irq_res->start > 0) { + if (irq_res && irq_res->start != -1) { irq = irq_res->start; irq_flags = irq_res->flags; }