Skip to content

Commit

Permalink
i2c: i801: Fallback to polling if request_irq() fails
Browse files Browse the repository at this point in the history
The i2c-i801 driver can work without interrupts, so there is no reason
to make a request_irq failure fatal. Instead we can simply fallback
to polling.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
  • Loading branch information
Jean Delvare authored and Wolfram Sang committed Nov 12, 2014
1 parent b3b8df9 commit ae94471
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/i2c/busses/i2c-i801.c
Original file line number Diff line number Diff line change
Expand Up @@ -1239,10 +1239,11 @@ static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id)
if (err) {
dev_err(&dev->dev, "Failed to allocate irq %d: %d\n",
dev->irq, err);
goto exit_release;
priv->features &= ~FEATURE_IRQ;
}
dev_info(&dev->dev, "SMBus using PCI Interrupt\n");
}
dev_info(&dev->dev, "SMBus using %s\n",
priv->features & FEATURE_IRQ ? "PCI interrupt" : "polling");

/* set up the sysfs linkage to our parent device */
priv->adapter.dev.parent = &dev->dev;
Expand All @@ -1269,7 +1270,6 @@ static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id)
exit_free_irq:
if (priv->features & FEATURE_IRQ)
free_irq(dev->irq, priv);
exit_release:
pci_release_region(dev, SMBBAR);
exit:
kfree(priv);
Expand Down

0 comments on commit ae94471

Please sign in to comment.