Skip to content

Commit bbb8f57

Browse files
6by9popcornmix
authored andcommitted
i2c: brcmstb: The interrupt line is optional, so use platform_get_irq_optional
If there is no interrupt defined then an error is logged due to the use of platform_get_irq. The driver handles not having the interrupt by falling back to polling, therefore make the appropriate call when claiming it. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
1 parent 00dd474 commit bbb8f57

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

‎drivers/i2c/busses/i2c-brcmstb.c‎

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -647,20 +647,22 @@ static int brcmstb_i2c_probe(struct platform_device *pdev)
647647
int_name = NULL;
648648

649649
/* Get the interrupt number */
650-
dev->irq = platform_get_irq(pdev, 0);
650+
dev->irq = platform_get_irq_optional(pdev, 0);
651651

652652
/* disable the bsc interrupt line */
653653
brcmstb_i2c_enable_disable_irq(dev, INT_DISABLE);
654654

655655
/* register the ISR handler */
656-
rc = devm_request_irq(&pdev->dev, dev->irq, brcmstb_i2c_isr,
657-
IRQF_SHARED,
658-
int_name ? int_name : pdev->name,
659-
dev);
660-
661-
if (rc) {
662-
dev_dbg(dev->device, "falling back to polling mode");
663-
dev->irq = -1;
656+
if (dev->irq >= 0) {
657+
rc = devm_request_irq(&pdev->dev, dev->irq, brcmstb_i2c_isr,
658+
IRQF_SHARED,
659+
int_name ? int_name : pdev->name,
660+
dev);
661+
662+
if (rc) {
663+
dev_dbg(dev->device, "falling back to polling mode");
664+
dev->irq = -1;
665+
}
664666
}
665667

666668
if (of_property_read_u32(dev->device->of_node,

0 commit comments

Comments
 (0)