Skip to content

Commit 5acb78d

Browse files
prabhakarladgregkh
authored andcommitted
tty: goldfish: 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 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(). Signed-off-by: Lad Prabhakar <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent d8e9a40 commit 5acb78d

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

drivers/tty/goldfish.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ static int goldfish_tty_probe(struct platform_device *pdev)
298298
struct resource *r;
299299
struct device *ttydev;
300300
void __iomem *base;
301-
u32 irq;
301+
int irq;
302302
unsigned int line;
303303

304304
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -313,14 +313,12 @@ static int goldfish_tty_probe(struct platform_device *pdev)
313313
return -ENOMEM;
314314
}
315315

316-
r = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
317-
if (!r) {
318-
pr_err("goldfish_tty: No IRQ resource available!\n");
316+
irq = platform_get_irq(pdev, 0);
317+
if (irq < 0) {
318+
ret = irq;
319319
goto err_unmap;
320320
}
321321

322-
irq = r->start;
323-
324322
mutex_lock(&goldfish_tty_lock);
325323

326324
if (pdev->id == PLATFORM_DEVID_NONE)

0 commit comments

Comments
 (0)