Skip to content

Commit a51f589

Browse files
prabhakarladWim Van Sebroeck
authored andcommitted
watchdog: s3c2410: Use platform_get_irq() to get the interrupt
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(). Signed-off-by: Lad Prabhakar <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] [groeck: Fixed context conflicts] Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
1 parent af5bb1c commit a51f589

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

drivers/watchdog/s3c2410_wdt.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -661,8 +661,8 @@ static int s3c2410wdt_probe(struct platform_device *pdev)
661661
{
662662
struct device *dev = &pdev->dev;
663663
struct s3c2410_wdt *wdt;
664-
struct resource *wdt_irq;
665664
unsigned int wtcon;
665+
int wdt_irq;
666666
int ret;
667667

668668
wdt = devm_kzalloc(dev, sizeof(*wdt), GFP_KERNEL);
@@ -686,11 +686,9 @@ static int s3c2410wdt_probe(struct platform_device *pdev)
686686
}
687687
}
688688

689-
wdt_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
690-
if (wdt_irq == NULL) {
691-
dev_err(dev, "no irq resource specified\n");
692-
return -ENOENT;
693-
}
689+
wdt_irq = platform_get_irq(pdev, 0);
690+
if (wdt_irq < 0)
691+
return wdt_irq;
694692

695693
/* get the memory region for the watchdog timer */
696694
wdt->reg_base = devm_platform_ioremap_resource(pdev, 0);
@@ -754,8 +752,8 @@ static int s3c2410wdt_probe(struct platform_device *pdev)
754752
}
755753
}
756754

757-
ret = devm_request_irq(dev, wdt_irq->start, s3c2410wdt_irq, 0,
758-
pdev->name, pdev);
755+
ret = devm_request_irq(dev, wdt_irq, s3c2410wdt_irq, 0,
756+
pdev->name, pdev);
759757
if (ret != 0) {
760758
dev_err(dev, "failed to install irq (%d)\n", ret);
761759
goto err_cpufreq;

0 commit comments

Comments
 (0)