mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] irqchip/pruss-intc: Use match data directly
@ 2026-09-03 18:52 Andrew Davis
  2026-09-03 18:52 ` [PATCH 2/2] irqchip/pruss-intc: Use scoped lock guard and devm_mutex_init Andrew Davis
  2026-09-05 14:02 ` [PATCH 1/2] irqchip/pruss-intc: Use match data directly Radu Rendec
  0 siblings, 2 replies; 4+ messages in thread
From: Andrew Davis @ 2026-09-03 18:52 UTC (permalink / raw)
  To: Thomas Gleixner, Radu Rendec, linux-kernel; +Cc: Andrew Davis

The match data is fetched before the instance data is available, but it is
not used until after. Skip the temporary variable and fetch the match data
after it has a place to be stored.

Signed-off-by: Andrew Davis <afd@ti.com>
---
 drivers/irqchip/irq-pruss-intc.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/irqchip/irq-pruss-intc.c b/drivers/irqchip/irq-pruss-intc.c
index 81078d56f38dc..cc3a7c21c2904 100644
--- a/drivers/irqchip/irq-pruss-intc.c
+++ b/drivers/irqchip/irq-pruss-intc.c
@@ -516,24 +516,21 @@ static const char * const irq_names[MAX_NUM_HOST_IRQS] = {
 
 static int pruss_intc_probe(struct platform_device *pdev)
 {
-	const struct pruss_intc_match_data *data;
 	struct device *dev = &pdev->dev;
 	struct pruss_intc *intc;
 	struct pruss_host_irq_data *host_data;
 	int i, irq, ret;
 	u8 max_system_events, irqs_reserved = 0;
 
-	data = of_device_get_match_data(dev);
-	if (!data)
-		return -ENODEV;
-
-	max_system_events = data->num_system_events;
-
 	intc = devm_kzalloc(dev, sizeof(*intc), GFP_KERNEL);
 	if (!intc)
 		return -ENOMEM;
 
-	intc->soc_config = data;
+	intc->soc_config = of_device_get_match_data(dev);
+	if (!intc->soc_config)
+		return -ENODEV;
+	max_system_events = intc->soc_config->num_system_events;
+
 	intc->dev = dev;
 	platform_set_drvdata(pdev, intc);
 
-- 
2.39.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-09-05 16:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-03 18:52 [PATCH 1/2] irqchip/pruss-intc: Use match data directly Andrew Davis
2026-09-03 18:52 ` [PATCH 2/2] irqchip/pruss-intc: Use scoped lock guard and devm_mutex_init Andrew Davis
2026-09-05 16:01   ` Radu Rendec
2026-09-05 14:02 ` [PATCH 1/2] irqchip/pruss-intc: Use match data directly Radu Rendec

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®