Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2744376pxp; Tue, 8 Mar 2022 00:31:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJzFepiXOyIJ7ArbQXP/o6jwl61Z4C6YQmZF74YLxObR3f9MUGIjqjFIWAreZ1t6OXZ20nJa X-Received: by 2002:a50:d4d2:0:b0:410:9fa2:60d6 with SMTP id e18-20020a50d4d2000000b004109fa260d6mr15272889edj.35.1646728261765; Tue, 08 Mar 2022 00:31:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646728261; cv=none; d=google.com; s=arc-20160816; b=n1tpMNTAR9Mg1QetkiFOvncyu1aPsDrfzJrxYRGfun2K4zAZIkoHjauzicnmRm6JAv m7HkfxMOZU8PhQ4OfMmd/hp9PQGMxOPwBc0DqDYLVKspnEfntYrS3KOIowIWLWMi9iV7 mBnebQdL1Gh/7m9rCE8dhpFoA1i6ydp2mAzW1mGYWnTKa86y5vFZ6nv2qeLchJBKz5Pk D8lR7SA9TtNmiICggp45OuVo2E5dpoTReVWONYJByg0BgU0kfFTkvs+7/lCD/YHVe5BA I1iTT1xDu+CcxXC8w8ULOTHiMlpLiaWYejheWEsAfbbkZcKNQBFVDgiFA1ler1iPzC+p EkTQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=scNswzEZv4MR4mtcF8eE5kR5X8n3XY2Kg0/OJ8AWaD4=; b=BRcZSHwmJ5BSSm7p1YEvimY19y/tz+kpnxige6rrZLvhOYMA3hZdbPINVx/e6A52AA 6I1reh5A/Q0zfNpcpK9VN82+f2Gqr10ie8WJhfl5LX4mc32SJ1KCM2VVme965k0U0zqs wrqD2tfscZcbRtJdIYNVCEy/NqeACePjwQm9wxwxfZagQQw7TrdAOT9c94kdZJN6knoO 5SM5rsBNy4fn+ZmAUqxylxHl8s+3Bg3+el2WYyS+apr0JzTPfm5NtG5p8idHFgY+9G6i HvYBQ9+pwJzFRnt+VfeQShL7F7FU5ymBjgSTvogHq854Ev/XilpULrEZoI6ijgjwI3CL Zicg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=gzkIwK2t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q27-20020a1709066b1b00b00697f95a67ffsi9268563ejr.578.2022.03.08.00.30.39; Tue, 08 Mar 2022 00:31:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=gzkIwK2t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244797AbiCHDAo (ORCPT + 99 others); Mon, 7 Mar 2022 22:00:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229681AbiCHDAn (ORCPT ); Mon, 7 Mar 2022 22:00:43 -0500 Received: from mail-qv1-xf36.google.com (mail-qv1-xf36.google.com [IPv6:2607:f8b0:4864:20::f36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2356FD0C; Mon, 7 Mar 2022 18:59:47 -0800 (PST) Received: by mail-qv1-xf36.google.com with SMTP id kl20so3989254qvb.10; Mon, 07 Mar 2022 18:59:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=scNswzEZv4MR4mtcF8eE5kR5X8n3XY2Kg0/OJ8AWaD4=; b=gzkIwK2tIdhodziZcR7DZaSsv/0AlG9pY0kCg86NC7VcmUv3kzyjDHTNQhYUY1Xpwg IHWZAoLGhb1uAbA4ob/E0kboymL6IFiGZhCnclTFKlWRX4XDaEzuy6FKjJvAp1Hc1xVD MSqe99/R9DpBLTlc5qE6H81fXoc9C688DhVgTZ+ykr5PW7r4d2UitMn+Rbb/C0jXRt+c 7pEBLOx0MVJTkXmBcq0wfyJIczaD23aM13e4Do5lRBmRJadd6pJNORnqekS1AuvySXSg kdgSxlcd3CWXVX+/Ay9xjNQWfSadveJ0xr3rqAHK5nnA9hrktMr/7wmrDmJTyGXj3suz Kw2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=scNswzEZv4MR4mtcF8eE5kR5X8n3XY2Kg0/OJ8AWaD4=; b=j77lduyOsaEWwd+1jLfVbJ1N+MN0QEegRt1/CRBazemJGyZq1qR4No395Oqdii36om pBrCLjla3Tj1JMkQJn0nHZYSPP5ynYOlh52lN0DI4VWiSCcsH5rX7h7qF7jMFs9ZyzWO WCJ1pc8eOs8Coj/DZbEb90RIheCbwnCD5AovvNMoau3HiHeQCUKwT+GTDXdIoPAAv0ec OTma3qSvb2LZNePLDfMjOkd1imJUOdIs2eoqPpPHwq6AY8e10Ca3zqNzdCHAROE46tGF dUQ9E3B5A/AHDQlrOlqBmOTCdX38WFRwKsJ56lHJEL1caG+gDdFGloBWovGSSV5laGA1 8Hag== X-Gm-Message-State: AOAM5327ORDytR1yeaQZgFgHgAlHxY7hcvmH741ERvtA7TgHB1AQjFpa mE7E7lPYKJxKEHwIui7UT5M= X-Received: by 2002:a05:6214:21ef:b0:435:79f1:73a with SMTP id p15-20020a05621421ef00b0043579f1073amr7934663qvj.48.1646708386843; Mon, 07 Mar 2022 18:59:46 -0800 (PST) Received: from localhost.localdomain ([193.203.214.57]) by smtp.gmail.com with ESMTPSA id l6-20020ac87246000000b002dcec453e42sm8784730qtp.32.2022.03.07.18.59.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 18:59:46 -0800 (PST) From: cgel.zte@gmail.com X-Google-Original-From: chi.minghao@zte.com.cn To: s.shtylyov@omp.ru Cc: damien.lemoal@opensource.wdc.com, linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, Minghao Chi , Zeal Robot Subject: [PATCH] ata: Use platform_get_irq() to get the interrupt Date: Tue, 8 Mar 2022 02:59:40 +0000 Message-Id: <20220308025940.2077329-1-chi.minghao@zte.com.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Minghao Chi (CGEL ZTE) platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypassed the hierarchical setup and messed up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). Reported-by: Zeal Robot Signed-off-by: Minghao Chi (CGEL ZTE) --- drivers/ata/pata_pxa.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/ata/pata_pxa.c b/drivers/ata/pata_pxa.c index 41430f79663c..6394ab4cbc1b 100644 --- a/drivers/ata/pata_pxa.c +++ b/drivers/ata/pata_pxa.c @@ -164,10 +164,10 @@ static int pxa_ata_probe(struct platform_device *pdev) struct resource *cmd_res; struct resource *ctl_res; struct resource *dma_res; - struct resource *irq_res; struct pata_pxa_pdata *pdata = dev_get_platdata(&pdev->dev); struct dma_slave_config config; int ret = 0; + int irq; /* * Resource validation, three resources are needed: @@ -205,8 +205,8 @@ static int pxa_ata_probe(struct platform_device *pdev) /* * IRQ pin */ - irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); - if (unlikely(irq_res == NULL)) + irq = platform_get_irq(pdev, 0); + if (unlikely(irq < 0)) return -EINVAL; /* @@ -287,7 +287,7 @@ static int pxa_ata_probe(struct platform_device *pdev) /* * Activate the ATA host */ - ret = ata_host_activate(host, irq_res->start, ata_sff_interrupt, + ret = ata_host_activate(host, irq, ata_sff_interrupt, pdata->irq_flags, &pxa_ata_sht); if (ret) dma_release_channel(data->dma_chan); -- 2.25.1