All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, kuba@kernel.org, linux-can@vger.kernel.org,
	kernel@pengutronix.de,
	Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>,
	Marc Kleine-Budde <mkl@pengutronix.de>
Subject: [PATCH net-next 04/15] can: ti_hecc: ti_hecc_probe(): use platform_get_irq() to get the interrupt
Date: Wed,  5 Jan 2022 15:43:51 +0100	[thread overview]
Message-ID: <20220105144402.1174191-5-mkl@pengutronix.de> (raw)
In-Reply-To: <20220105144402.1174191-1-mkl@pengutronix.de>

From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

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().

Link: https://lore.kernel.org/all/20211221194508.11737-1-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/ti_hecc.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/net/can/ti_hecc.c b/drivers/net/can/ti_hecc.c
index 353062ead98f..ff31b993ab17 100644
--- a/drivers/net/can/ti_hecc.c
+++ b/drivers/net/can/ti_hecc.c
@@ -859,7 +859,6 @@ static int ti_hecc_probe(struct platform_device *pdev)
 	struct net_device *ndev = (struct net_device *)0;
 	struct ti_hecc_priv *priv;
 	struct device_node *np = pdev->dev.of_node;
-	struct resource *irq;
 	struct regulator *reg_xceiver;
 	int err = -ENODEV;
 
@@ -904,9 +903,9 @@ static int ti_hecc_probe(struct platform_device *pdev)
 		goto probe_exit_candev;
 	}
 
-	irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-	if (!irq) {
-		dev_err(&pdev->dev, "No irq resource\n");
+	ndev->irq = platform_get_irq(pdev, 0);
+	if (ndev->irq < 0) {
+		err = ndev->irq;
 		goto probe_exit_candev;
 	}
 
@@ -920,7 +919,6 @@ static int ti_hecc_probe(struct platform_device *pdev)
 	priv->can.ctrlmode_supported = CAN_CTRLMODE_3_SAMPLES;
 
 	spin_lock_init(&priv->mbx_lock);
-	ndev->irq = irq->start;
 	ndev->flags |= IFF_ECHO;
 	platform_set_drvdata(pdev, ndev);
 	SET_NETDEV_DEV(ndev, &pdev->dev);
-- 
2.34.1



  parent reply	other threads:[~2022-01-05 14:44 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-05 14:43 [PATCH net-next 0/15] pull-request: can-next 2022-01-05 Marc Kleine-Budde
2022-01-05 14:43 ` [PATCH net-next 01/15] can: usb_8dev: remove unused member echo_skb from struct usb_8dev_priv Marc Kleine-Budde
2022-01-05 15:10   ` patchwork-bot+netdevbpf
2022-01-05 14:43 ` [PATCH net-next 02/15] can: mcp251x: mcp251x_gpio_setup(): Get rid of duplicate of_node assignment Marc Kleine-Budde
2022-01-05 14:43 ` [PATCH net-next 03/15] can: kvaser_usb: make use of units.h in assignment of frequency Marc Kleine-Budde
2022-01-05 14:43 ` Marc Kleine-Budde [this message]
2022-01-05 14:43 ` [PATCH net-next 05/15] can: sja1000: sp_probe(): use platform_get_irq() to get the interrupt Marc Kleine-Budde
2022-01-05 14:43 ` [PATCH net-next 06/15] can: etas_es58x: es58x_init_netdev: populate net_device::dev_port Marc Kleine-Budde
2022-01-05 14:43 ` [PATCH net-next 07/15] can: do not increase rx statistics when generating a CAN rx error message frame Marc Kleine-Budde
2022-01-05 14:43 ` [PATCH net-next 08/15] can: kvaser_usb: do not increase tx statistics when sending error message frames Marc Kleine-Budde
2022-01-05 14:43 ` [PATCH net-next 09/15] can: do not copy the payload of RTR frames Marc Kleine-Budde
2022-01-05 14:43 ` [PATCH net-next 10/15] can: do not increase rx_bytes statistics for " Marc Kleine-Budde
2022-01-05 14:43 ` [PATCH net-next 11/15] can: do not increase tx_bytes " Marc Kleine-Budde
2022-01-05 14:43 ` [PATCH net-next 12/15] can: dev: replace can_priv::ctrlmode_static by can_get_static_ctrlmode() Marc Kleine-Budde
2022-01-05 14:44 ` [PATCH net-next 13/15] can: dev: add sanity check in can_set_static_ctrlmode() Marc Kleine-Budde
2022-01-05 14:44 ` [PATCH net-next 14/15] can: dev: reorder struct can_priv members for better packing Marc Kleine-Budde
2022-01-05 14:44 ` [PATCH net-next 15/15] can: netlink: report the CAN controller mode supported flags Marc Kleine-Budde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220105144402.1174191-5-mkl@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=davem@davemloft.net \
    --cc=kernel@pengutronix.de \
    --cc=kuba@kernel.org \
    --cc=linux-can@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.