Skip to content

Commit c3b2f91

Browse files
prabhakarladwsakernel
authored andcommitted
i2c: bcm2835: 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]> Reviewed-by: Florian Fainelli <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent 653bece commit c3b2f91

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

drivers/i2c/busses/i2c-bcm2835.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ static const struct i2c_adapter_quirks bcm2835_i2c_quirks = {
402402
static int bcm2835_i2c_probe(struct platform_device *pdev)
403403
{
404404
struct bcm2835_i2c_dev *i2c_dev;
405-
struct resource *mem, *irq;
405+
struct resource *mem;
406406
int ret;
407407
struct i2c_adapter *adap;
408408
struct clk *mclk;
@@ -452,12 +452,9 @@ static int bcm2835_i2c_probe(struct platform_device *pdev)
452452
return ret;
453453
}
454454

455-
irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
456-
if (!irq) {
457-
dev_err(&pdev->dev, "No IRQ resource\n");
458-
return -ENODEV;
459-
}
460-
i2c_dev->irq = irq->start;
455+
i2c_dev->irq = platform_get_irq(pdev, 0);
456+
if (i2c_dev->irq < 0)
457+
return i2c_dev->irq;
461458

462459
ret = request_irq(i2c_dev->irq, bcm2835_i2c_isr, IRQF_SHARED,
463460
dev_name(&pdev->dev), i2c_dev);

0 commit comments

Comments
 (0)