Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1585306 > unrolled thread

[PATCH] i2c: thunderx: Replace pci_enable_msix()

Started byJan Glauber <jglauber@cavium.com>
First post2017-02-21 14:10 +0100
Last post2017-02-23 13:10 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] i2c: thunderx: Replace pci_enable_msix() Jan Glauber <jglauber@cavium.com> - 2017-02-21 14:10 +0100
    Re: [PATCH] i2c: thunderx: Replace pci_enable_msix() Wolfram Sang <wsa@the-dreams.de> - 2017-02-23 13:10 +0100

#1585306 — [PATCH] i2c: thunderx: Replace pci_enable_msix()

FromJan Glauber <jglauber@cavium.com>
Date2017-02-21 14:10 +0100
Subject[PATCH] i2c: thunderx: Replace pci_enable_msix()
Message-ID<tdimD-30G-59@gated-at.bofh.it>
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>
---
 drivers/i2c/busses/i2c-octeon-core.h     | 4 ----
 drivers/i2c/busses/i2c-thunderx-pcidrv.c | 6 +++---
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/i2c/busses/i2c-octeon-core.h b/drivers/i2c/busses/i2c-octeon-core.h
index e160f83..aa3c8f4 100644
--- a/drivers/i2c/busses/i2c-octeon-core.h
+++ b/drivers/i2c/busses/i2c-octeon-core.h
@@ -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;
 };
diff --git a/drivers/i2c/busses/i2c-thunderx-pcidrv.c b/drivers/i2c/busses/i2c-thunderx-pcidrv.c
index bba5b42..1d4c2be 100644
--- a/drivers/i2c/busses/i2c-thunderx-pcidrv.c
+++ b/drivers/i2c/busses/i2c-thunderx-pcidrv.c
@@ -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;
-- 
2.9.0.rc0.21.g7777322

[toc] | [next] | [standalone]


#1586848

FromWolfram Sang <wsa@the-dreams.de>
Date2017-02-23 13:10 +0100
Message-ID<te0nD-15h-5@gated-at.bofh.it>
In reply to#1585306

[Multipart message — attachments visible in raw view] — view raw

On Tue, Feb 21, 2017 at 02:07:50PM +0100, Jan Glauber wrote:
> 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>

Applied to for-next (will be in this merge window), thanks!

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web