i2c: designware: Disable interrupts before requesting PCI device interrupt
authorJarkko Nikula <jarkko.nikula@linux.intel.com>
Mon, 31 Aug 2015 14:31:29 +0000 (17:31 +0300)
committerWolfram Sang <wsa@the-dreams.de>
Thu, 15 Oct 2015 12:07:38 +0000 (14:07 +0200)
Device must not generate interrupts before registering the interrupt
handler so move i2c_dw_disable_int() before requesting it.

There are no known issues with this. The code has been here since commit
fe20ff5c7e9c ("i2c-designware: Add support for Designware core behind PCI
devices.").

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-designware-pcidrv.c

index e477dddcdae51182364259a975a9e21bced5824b..d9e8937f062fa63646d5b06b1e4035c538602816 100644 (file)
@@ -260,6 +260,7 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev,
 
        snprintf(adap->name, sizeof(adap->name), "i2c-designware-pci");
 
+       i2c_dw_disable_int(dev);
        r = devm_request_irq(&pdev->dev, pdev->irq, i2c_dw_isr,
                        IRQF_SHARED | IRQF_COND_SUSPEND, adap->name, dev);
        if (r) {
@@ -267,7 +268,6 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev,
                return r;
        }
 
-       i2c_dw_disable_int(dev);
        r = i2c_add_numbered_adapter(adap);
        if (r) {
                dev_err(&pdev->dev, "failure adding adapter\n");