Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp169267pxp; Tue, 8 Mar 2022 23:52:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJw0kJJvm8LghsX9P6SBHzlvCf2Ao2STNYXbL4AWDcNfiKUow2m6XcKv7LTuxy47CxGCQW9V X-Received: by 2002:a17:90a:a087:b0:1b9:157f:4cc1 with SMTP id r7-20020a17090aa08700b001b9157f4cc1mr8941238pjp.117.1646812351903; Tue, 08 Mar 2022 23:52:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646812351; cv=none; d=google.com; s=arc-20160816; b=rA1Lwa0/yHyv1QT55N1E1VISnvJzkx/wSS1R0tFTS8ETzvwQFAnMgZYJKazsT4067B VLqGwYvNCExlqN3JsQzj/yPo032yj2nl4VwFNFJ5U9GxIfYlVl3dAroqpr0izjsszszQ hKY9d2tr9GpKRitAvrsKC5xAR5BUwas4lotQ6yBpKS+zRjNIXbEt860EMPwYyNk0OdnS CW1BCznNQIM4Y0GGI3QTu5wvmewuGZIODF3q2qCwG+iCcCvClpYi/xDL5GhYfWbKGygm n18jJE7lw5qCAnVeq/v7dvJVE5ml7GgawYOXAOVNUmlzlmi5ns52+C/7afrV4s2IRREc EUzg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=YZMQi1dTUUmaGTUhCGnhkFEO6/MDe8Ns2I3nt0C9fxY=; b=PZNWWovU7hxfNIKUYT91gZL5h0HdDGd8pW9AnQpMOqoa+UZhd+QXvBoNy1xzBh0qwm LEqW2YEroURubjKzXkIL9xUdK2RWwOA6CMmKKqGejJudbgZ+6Y6/kszt2Su+5BZijOwS M7ajbigpv94U/ZI17GztWnwg5P+TxsUPj0MpkEivUDcMmLYhrWyvYb2bkHiJNxsriIir NNhedTsFhwKz34AiFPHQmhTfyHlvDbTwqSMjYN2M7E/vfeQ9/dpX46EYRFqHtVd48jJD nZyaznrXJl++E4QNk3pIWXzY/EhyOasQXl+A2bIGOaJzNoxOTJY03YvZoO9Xc5Jtf6NY 0Lig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=IcN8kfEh; 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 o21-20020a635d55000000b003737c6010f6si1167773pgm.692.2022.03.08.23.52.17; Tue, 08 Mar 2022 23:52:31 -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=IcN8kfEh; 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 S230341AbiCIH3o (ORCPT + 99 others); Wed, 9 Mar 2022 02:29:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230126AbiCIH3n (ORCPT ); Wed, 9 Mar 2022 02:29:43 -0500 Received: from mail-qt1-x82d.google.com (mail-qt1-x82d.google.com [IPv6:2607:f8b0:4864:20::82d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D62422B00; Tue, 8 Mar 2022 23:28:42 -0800 (PST) Received: by mail-qt1-x82d.google.com with SMTP id a14so1175096qtx.12; Tue, 08 Mar 2022 23:28:42 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=YZMQi1dTUUmaGTUhCGnhkFEO6/MDe8Ns2I3nt0C9fxY=; b=IcN8kfEhoFTfTkLExogeKr09YGIgSjN8GaI7E0SsYEgK/ytG2966CBacG35NrS1OEN 6Xrw3AxLQzPBXY3g5ZgnWnyvi9hlFNGdmm7pIWjfq5KGQS3kOMqR43yfhj8WAtbRPLZq Ef+R19OlhhlbYXEgPcHpTaW3fjE3CZ97ia7Z7VvhHZCdM6VKbbA5MyKmqvvjE2+4x+oz LRH3WsnWZwuto6Xsb8UiMXaYfEkfHgyZ3F98y7XgPy5PUjzp7FYJvFt0dIyW+2aoS+mB 3/xerNfNmZlpVjJej1mJoeKsFhFsIsl2VEqLNKzbEB3TGUD17vyZCVSEkq7KCnDpaRIS QLVg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=YZMQi1dTUUmaGTUhCGnhkFEO6/MDe8Ns2I3nt0C9fxY=; b=hjNw92nw7y0UnLzM9JcMvjuaX4k2XNYG8S3HTmN4Q6BL+7FhbCjlHFLDKpZ5DdDoST gbpMACx4/AeHj0+AO3ZL7oui5AMity4qbcPlu7sDbOc4SRgXy4iRRo0wyZs4dujgB3nE AQggEmVnFYtA/z4lk+60A8eiV68PABjE6rMlyRvqqwbKt2L5ZdN2JfRtxYreBwejon5E /ANy9ojciAJPPJu6zJ8A5iFzf2nEA9fycBNB1YAAeB5yFICe5d2OfaYFJ5BNaz+cBusi W/sNkQqJPHw/5ODAAO32vS5nO3czYJ/Zof6coehIrkcDBZ4zENNag+NxXSQ0sPA6gQ21 PY8Q== X-Gm-Message-State: AOAM531xwnozEMCUB9cBo9yQEAJf+CmP0yiifSHXaiTfQiTVilkBfy4S Zgt0zuSRY3BXCyHOxeap4Hc= X-Received: by 2002:a05:622a:1b8b:b0:2dc:4f1:faf7 with SMTP id bp11-20020a05622a1b8b00b002dc04f1faf7mr16764636qtb.325.1646810921466; Tue, 08 Mar 2022 23:28:41 -0800 (PST) Received: from localhost.localdomain ([193.203.214.57]) by smtp.gmail.com with ESMTPSA id a6-20020ae9e806000000b0067ba5a8a2a7sm581301qkg.134.2022.03.08.23.28.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 23:28:40 -0800 (PST) From: cgel.zte@gmail.com X-Google-Original-From: chi.minghao@zte.com.cn To: damien.lemoal@opensource.wdc.com Cc: cgel.zte@gmail.com, chi.minghao@zte.com.cn, linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, s.shtylyov@omp.ru, zealci@zte.com.cn Subject: [PATCH V3] ata: pata_pxa: Use platform_get_irq() to get the interrupt Date: Wed, 9 Mar 2022 07:28:34 +0000 Message-Id: <20220309072834.2081944-1-chi.minghao@zte.com.cn> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: 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 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 bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). v1->v2: - Use more specific in the subject: ata: pata_pxa: - Switch to returning 'irq' v2->v3: - drop the unlikely() Reported-by: Zeal Robot Signed-off-by: Minghao Chi --- drivers/ata/pata_pxa.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/ata/pata_pxa.c b/drivers/ata/pata_pxa.c index 41430f79663c..985f42c4fd70 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,9 +205,9 @@ 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)) - return -EINVAL; + irq = platform_get_irq(pdev, 0); + if (irq < 0) + return irq; /* * Allocate the host @@ -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