diff mbox series

[v2,3/4] i2c: designware: Use the correct name of device-managed function

Message ID 20210216141810.747678-4-zhengdejin5@gmail.com
State New
Headers show
Series Introduce pcim_alloc_irq_vectors() | expand

Commit Message

Dejin Zheng Feb. 16, 2021, 2:18 p.m. UTC
Use the new function pcim_alloc_irq_vectors() to allocate IRQ vectors,
the pcim_alloc_irq_vectors() function, an explicit device-managed version
of pci_alloc_irq_vectors(). If pcim_enable_device() has been called
before, then pci_alloc_irq_vectors() is actually a device-managed
function. It is used here as a device-managed function, So replace it
with pcim_alloc_irq_vectors().

Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com>
---
v1 -> v2:
	- Modify some commit messages.

 drivers/i2c/busses/i2c-designware-pcidrv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andy Shevchenko Feb. 16, 2021, 2:39 p.m. UTC | #1
On Tue, Feb 16, 2021 at 10:18:09PM +0800, Dejin Zheng wrote:
> Use the new function pcim_alloc_irq_vectors() to allocate IRQ vectors,
> the pcim_alloc_irq_vectors() function, an explicit device-managed version
> of pci_alloc_irq_vectors(). If pcim_enable_device() has been called
> before, then pci_alloc_irq_vectors() is actually a device-managed
> function. It is used here as a device-managed function, So replace it
> with pcim_alloc_irq_vectors().

...

> -	r = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES);
> +	r = pcim_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES);
>  	if (r < 0)
>  		return r;

It's good, but now why do we have pci_free_irq_vectors() in the same file?
Dejin Zheng Feb. 16, 2021, 4:11 p.m. UTC | #2
On Tue, Feb 16, 2021 at 04:39:09PM +0200, Andy Shevchenko wrote:
> On Tue, Feb 16, 2021 at 10:18:09PM +0800, Dejin Zheng wrote:
> > Use the new function pcim_alloc_irq_vectors() to allocate IRQ vectors,
> > the pcim_alloc_irq_vectors() function, an explicit device-managed version
> > of pci_alloc_irq_vectors(). If pcim_enable_device() has been called
> > before, then pci_alloc_irq_vectors() is actually a device-managed
> > function. It is used here as a device-managed function, So replace it
> > with pcim_alloc_irq_vectors().
> 
> ...
> 
> > -	r = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES);
> > +	r = pcim_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES);
> >  	if (r < 0)
> >  		return r;
> 
> It's good, but now why do we have pci_free_irq_vectors() in the same file?
>
Done. and thank you for your careful inspection.


> 
> -- 
> With Best Regards,
> Andy Shevchenko
> 
>
diff mbox series

Patch

diff --git a/drivers/i2c/busses/i2c-designware-pcidrv.c b/drivers/i2c/busses/i2c-designware-pcidrv.c
index 55c83a7a24f3..444533be49ee 100644
--- a/drivers/i2c/busses/i2c-designware-pcidrv.c
+++ b/drivers/i2c/busses/i2c-designware-pcidrv.c
@@ -219,7 +219,7 @@  static int i2c_dw_pci_probe(struct pci_dev *pdev,
 	if (!dev)
 		return -ENOMEM;
 
-	r = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES);
+	r = pcim_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES);
 	if (r < 0)
 		return r;