]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
i2c: thunderx: Replace pci_enable_msix()
authorJan Glauber <jglauber@cavium.com>
Tue, 21 Feb 2017 13:07:50 +0000 (14:07 +0100)
committerWolfram Sang <wsa@the-dreams.de>
Thu, 23 Feb 2017 12:03:56 +0000 (13:03 +0100)
Using pci_alloc_irq_vectors() instead of the deprecated
pci_enable_msix() allows to remove the msix_entry from
struct octeon_i2c and thus to get rid of the config symbol check.

Signed-off-by: Jan Glauber <jglauber@cavium.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-octeon-core.h
drivers/i2c/busses/i2c-thunderx-pcidrv.c

index e160f838c25461f111f89871eac87beebca61a09..aa3c8f4771c1b60538f046526be52a27ce1baca2 100644 (file)
@@ -6,7 +6,6 @@
 #include <linux/i2c-smbus.h>
 #include <linux/io.h>
 #include <linux/kernel.h>
-#include <linux/pci.h>
 
 /* Controller command patterns */
 #define SW_TWSI_V              BIT_ULL(63)     /* Valid bit */
@@ -118,9 +117,6 @@ struct octeon_i2c {
        void (*hlc_int_disable)(struct octeon_i2c *);
        atomic_t int_enable_cnt;
        atomic_t hlc_int_enable_cnt;
-#if IS_ENABLED(CONFIG_I2C_THUNDERX)
-       struct msix_entry i2c_msix;
-#endif
        struct i2c_smbus_alert_setup alert_data;
        struct i2c_client *ara;
 };
index bba5b429f69c92e21a1b4934319ad78fc388ef0a..1d4c2beacf2e7044011110593fbeafa2f839bb37 100644 (file)
@@ -188,11 +188,11 @@ static int thunder_i2c_probe_pci(struct pci_dev *pdev,
        i2c->hlc_int_enable = thunder_i2c_hlc_int_enable;
        i2c->hlc_int_disable = thunder_i2c_hlc_int_disable;
 
-       ret = pci_enable_msix(pdev, &i2c->i2c_msix, 1);
-       if (ret)
+       ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_MSIX);
+       if (ret < 0)
                goto error;
 
-       ret = devm_request_irq(dev, i2c->i2c_msix.vector, octeon_i2c_isr, 0,
+       ret = devm_request_irq(dev, pci_irq_vector(pdev, 0), octeon_i2c_isr, 0,
                               DRV_NAME, i2c);
        if (ret)
                goto error;