Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp444075pxj; Thu, 20 May 2021 13:04:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzr2vuIO6u9h8rcovyB0Ai3dI07GrRTl0BxLAE7fFTYlRoa5VpJ5QNCl01GwEOLPI/7gjBf X-Received: by 2002:a05:6402:3488:: with SMTP id v8mr6679739edc.51.1621541075222; Thu, 20 May 2021 13:04:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621541075; cv=none; d=google.com; s=arc-20160816; b=uKNNpihuD0wBKlNlmXhPZMLEdQzJ8z1cpzNR3cHiTA9yJNyuITIIdGeV9tr99kUbmy PaC50LDXW6zIXDEA/TkbKdNO9wc6VRkfr/gcIzt6GdzNPFdFEnECYa8Dw+OimAZdvgqv EZY09wTB3QwKTmwas889t2c8xG1HdG+OwzsV3Y3WuHr0/6dBBHGqxa7mCJrDbie6JHHt 3plPswq361uTv1Zqn1jFJafJO09fy2FKWfi7HdJ3XxMxJzZuNsXdwt3kTUums61G5VOK V5hRke6tI1KMNIpiM+hBjNsE3qwcmhGvNMTPPG18lMWGtwyqijlBaek+2A0sd/vnHk9Q i9og== 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=KAqSgZKNjfcn7pKjDZBxY+aTKRAWNQ3wlZknVw7LF3+XhyOP4civVMvLUwkYEZFsK3 rstGz2Bvm3hoIIAiLpPL+binTiIDKTO0gyzMUBDCObBq8ALktpy/ebuQKvZdmPMaRRRE wUqA1+0aDl4gKC2oFOUz59Qy+j/R/q4ThSb+kkywQV+thPwZkRYmqOxpJ50eDwn557WS Gsf8a/ym09rXZXMYgPdPIVPWmqTVviyrBJK1dKD5iUWQp9l6rToVlEzfmu7a1eG/N2bB wN0e1oVx9YRPtST/I+e/Nq74yaBd8lEUkJNJRmySz9Gg12zjk+46mt5CszuBglrEti48 RXcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0IdAU+Rf; 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 b11si3296942ejd.10.2021.05.20.13.04.11; Thu, 20 May 2021 13:04:35 -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=0IdAU+Rf; 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 S237061AbhETKp7 (ORCPT + 99 others); Thu, 20 May 2021 06:45:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:60508 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237186AbhETK3m (ORCPT ); Thu, 20 May 2021 06:29:42 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D889661584; Thu, 20 May 2021 09:51:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621504301; bh=ViUhsG7ihVLMRZP+IwYEc5P+52bbMLlx7R4NnNka/no=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0IdAU+Rfiz0vkReOvhx/QxnzZVGgqRQMK4jaq52rDa0pNPNqt1vUQQxVWODpLury7 E7b44fGDveOwlp582tMuHZeonTrP9C+UzKP9doo/+Ky7dLBAd4MZ7t2ojl9BujV9Go 2VS6tn6NFn0aRFnQX2vFsmGUzWNrPQMJOHLNpmqc= 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.14 184/323] pata_ipx4xx_cf: fix IRQ check Date: Thu, 20 May 2021 11:21:16 +0200 Message-Id: <20210520092126.414017738@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092120.115153432@linuxfoundation.org> References: <20210520092120.115153432@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