Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C165AC43219 for ; Tue, 21 Dec 2021 20:00:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231579AbhLUUA2 (ORCPT ); Tue, 21 Dec 2021 15:00:28 -0500 Received: from relmlor1.renesas.com ([210.160.252.171]:37799 "EHLO relmlie5.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230350AbhLUUAZ (ORCPT ); Tue, 21 Dec 2021 15:00:25 -0500 X-IronPort-AV: E=Sophos;i="5.88,224,1635174000"; d="scan'208";a="104261932" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 22 Dec 2021 05:00:24 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 6736640EF4C5; Wed, 22 Dec 2021 05:00:22 +0900 (JST) From: Lad Prabhakar To: Wolfgang Grandegger , Marc Kleine-Budde , "David S. Miller" , Jakub Kicinski Cc: linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Prabhakar , Lad Prabhakar Subject: [PATCH] can: sja1000: Use platform_get_irq() Date: Tue, 21 Dec 2021 20:00:16 +0000 Message-Id: <20211221200016.13459-1-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It is preferred that drivers use platform_get_irq() instead of irq_of_parse_and_map(), so replace. Signed-off-by: Lad Prabhakar --- drivers/net/can/sja1000/sja1000_platform.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/net/can/sja1000/sja1000_platform.c b/drivers/net/can/sja1000/sja1000_platform.c index d7c2ec529b8f..f9ec7bd8dfac 100644 --- a/drivers/net/can/sja1000/sja1000_platform.c +++ b/drivers/net/can/sja1000/sja1000_platform.c @@ -17,7 +17,6 @@ #include #include #include -#include #include "sja1000.h" @@ -234,13 +233,15 @@ static int sp_probe(struct platform_device *pdev) if (!addr) return -ENOMEM; - if (of) - irq = irq_of_parse_and_map(of, 0); - else + if (of) { + irq = platform_get_irq(pdev, 0); + if (irq < 0) + return irq; + } else { res_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); - - if (!irq && !res_irq) - return -ENODEV; + if (!res_irq) + return -ENODEV; + } of_id = of_match_device(sp_of_table, &pdev->dev); if (of_id && of_id->data) { -- 2.17.1