Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp316510pxj; Thu, 20 May 2021 09:59:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4UHCmblnKOR8L+MH1hG4qlSQow9s5TYX8CRa+HmfQSMzvAsNbDJ+jxKLR4H3QEd2gERXZ X-Received: by 2002:a05:6e02:e41:: with SMTP id l1mr6307392ilk.141.1621529955021; Thu, 20 May 2021 09:59:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621529955; cv=none; d=google.com; s=arc-20160816; b=dzPw0nFQPSqgmglLxY/fjCKS0RuZB8ScLe88FH4sHcJ0OfVWRpr0SN5eIf77bm+fAQ wulCMFR+qCKJEdlud/8PIprEQKEdTELhed2VyUT05NuA8by1Rh862wN1xLlr+my0yhbX afk+yKUfaYuetIvzZmfpJXR81PqGDTWzZRm4RFbx1nRLiBTC3wkjuembFFoPERyXBRak o6ySwcsvHLP0bGZ9nABXMo0eq2gH7YbQQwmipAkj/yBbRM1NWOVXHfbHlYinavESg9Hh kn6ejI8xJvPx3nrFTSPlS/bF4RAfLeN88cncUMH+aBbIPQhm3jFcbzPYSYQA/PwI9+V2 5YQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8OWuxAY/KlHxF7RQVqmX9Ddi2ahkot22/heVad2+DME=; b=VRk+Vv59m93La2byDm13THX0CcgC3JyVNL9PnBYZBC3Z/gtsDr0/f+TSMxHGsnd3s6 F4J4qydNr1nTx7/+6bu42zyJZ1mts1q4GJUYWHOMjNFI9uF3iqyXxM9KZWQYq6pFdesP anEjVbmBuiqe7Jyi43/GiP+ZBFSs9tHpqZFuO0AqbXDegz9/WU4Q2sFnaNF85fniDKpG VbEOV2nzMLlUGIxn6VsLQoor+awEh4Cv6VRonPhEvqOYZ/e1lkE7++BHAqFBwDPjkBIY BEehkrUu8C3t0bA5qIGRu1iO0eUKvtiNfikTMeVfTGhAiMccmpLXLhA80jv5bvBltxAt nZ9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zjlF1b0H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j3si2619545jak.80.2021.05.20.09.59.02; Thu, 20 May 2021 09:59:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zjlF1b0H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231849AbhETKBM (ORCPT + 99 others); Thu, 20 May 2021 06:01:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:60376 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234604AbhETJ4j (ORCPT ); Thu, 20 May 2021 05:56:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 167E961418; Thu, 20 May 2021 09:37:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621503460; bh=ViUhsG7ihVLMRZP+IwYEc5P+52bbMLlx7R4NnNka/no=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zjlF1b0HsJU+Rq2TsJotL1BhItwl0+hEWs+DkPZpJ5GqLoZknPI2ckmhoZfgSZ/ze zpqio+AIXO73Vj2bL1gIONZiL2YvHdT7rCONbE0bcoWew3KphBR3fdiHgDKokjwrlZ OX2XEcLqblaP5UfcEV9rNQKbitjBnf2+UtgwA/Lo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sergey Shtylyov , Jens Axboe , Sasha Levin Subject: [PATCH 4.19 232/425] pata_ipx4xx_cf: fix IRQ check Date: Thu, 20 May 2021 11:20:01 +0200 Message-Id: <20210520092139.057495196@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092131.308959589@linuxfoundation.org> References: <20210520092131.308959589@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sergey Shtylyov [ Upstream commit e379b40cc0f179403ce0b82b7e539f635a568da5 ] The driver's probe() method is written as if platform_get_irq() returns 0 on error, while actually it returns a negative error code (with all the other values considered valid IRQs). Rewrite the driver's IRQ checking code to pass the positive IRQ #s to ata_host_activate(), propagate errors upstream, and treat IRQ0 as error, returning -EINVAL, as the libata code treats 0 as an indication that polling should be used anyway... Fixes: 0df0d0a0ea9f ("[libata] ARM: add ixp4xx PATA driver") Signed-off-by: Sergey Shtylyov Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- drivers/ata/pata_ixp4xx_cf.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/ata/pata_ixp4xx_cf.c b/drivers/ata/pata_ixp4xx_cf.c index 0b0d93065f5a..867621f8c387 100644 --- a/drivers/ata/pata_ixp4xx_cf.c +++ b/drivers/ata/pata_ixp4xx_cf.c @@ -169,8 +169,12 @@ static int ixp4xx_pata_probe(struct platform_device *pdev) return -ENOMEM; irq = platform_get_irq(pdev, 0); - if (irq) + if (irq > 0) irq_set_irq_type(irq, IRQ_TYPE_EDGE_RISING); + else if (irq < 0) + return irq; + else + return -EINVAL; /* Setup expansion bus chip selects */ *data->cs0_cfg = data->cs0_bits; -- 2.30.2