Skip to contentSkip to conversation

PCI: Remove pci_enable_device_io()

PATCH Applied Heiner Kallweit 4 participants 7 messages Mar 23, 2024 – Mar 28, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover PCI: Remove pci_enable_device_io()

The call to pci_enable_device_io() in cs5520 isn't needed and can be removed. This was the last user, so the function itself can be removed afterwards.

I'd propose to apply the series through the PCI tree.

Heiner Kallweit (2):
ata: pata_cs5520: Remove not needed call to pci_enable_device_io
PCI: Remove pci_enable_device_io()

 drivers/ata/pata_cs5520.c |  6 ------
 drivers/pci/pci.c         | 14 --------------
 include/linux/pci.h       |  1 -
 3 files changed, 21 deletions(-)
Signature · 1 line
2.44.0
#1 lore raw

PATCH 1/2 ata: pata_cs5520: Remove not needed call to pci_enable_device_io

A few lines earlier pcim_enable_device() is called, which includes the functionality of pci_enable_device_io(). Therefore we can safely remove the call to pci_enable_device_io().

---
 drivers/ata/pata_cs5520.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/ata/pata_cs5520.c +0 -6
index 38795508c..027cf6710 100644
@@ -151,12 +151,6 @@ static int cs5520_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
 	if (!host)
 		return -ENOMEM;
 
-	/* Perform set up for DMA */
-	if (pci_enable_device_io(pdev)) {
-		dev_err(&pdev->dev, "unable to configure BAR2.\n");
-		return -ENODEV;
-	}
-
 	if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32))) {
 		dev_err(&pdev->dev, "unable to configure DMA mask.\n");
 		return -ENODEV;
Signature · 1 line
2.44.0
Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] ata: pata_cs5520: Remove not needed call to pci_enable_device_io

Hello!

Quoted 5 lines · Heiner Kallweit

A few lines earlier pcim_enable_device() is called, which includes the functionality of pci_enable_device_io(). Therefore we can safely remove the call to pci_enable_device_io().

[...]

MBR, Sergey

maintainer Acked-by on v1 1/2
#3 lore raw

Re: [PATCH 1/2] ata: pata_cs5520: Remove not needed call to pci_enable_device_io

In reply to Heiner Kallweit
Quoted 5 lines · Heiner Kallweit

A few lines earlier pcim_enable_device() is called, which includes the functionality of pci_enable_device_io(). Therefore we can safely remove the call to pci_enable_device_io().

Looks OK to me.

Signature · 2 lines
Damien Le Moal
Western Digital Research
#4 lore raw

PATCH 2/2 PCI: Remove pci_enable_device_io()

In reply to Heiner Kallweit

After the last user was removed, remove this PCI core function. It's very unlikely that we'll see a new device requiring io space access, even though memory space access is supported.

---
 drivers/pci/pci.c   | 14 --------------
 include/linux/pci.h |  1 -
 2 files changed, 15 deletions(-)
drivers/pci/pci.c +0 -14
index e5f243dd4..a26d00bf1 100644
@@ -2110,20 +2110,6 @@ static int pci_enable_device_flags(struct pci_dev *dev, unsigned long flags)
 	return err;
 }
 
-/**
- * pci_enable_device_io - Initialize a device for use with IO space
- * @dev: PCI device to be initialized
- *
- * Initialize device before it's used by a driver. Ask low-level code
- * to enable I/O resources. Wake up the device if it was suspended.
- * Beware, this function can fail.
- */
-int pci_enable_device_io(struct pci_dev *dev)
-{
-	return pci_enable_device_flags(dev, IORESOURCE_IO);
-}
-EXPORT_SYMBOL(pci_enable_device_io);
-
 /**
  * pci_enable_device_mem - Initialize a device for use with Memory space
  * @dev: PCI device to be initialized
include/linux/pci.h +0 -1
index 16493426a..ba1275778 100644
@@ -1315,7 +1315,6 @@ int pci_user_write_config_word(struct pci_dev *dev, int where, u16 val);
 int pci_user_write_config_dword(struct pci_dev *dev, int where, u32 val);
 
 int __must_check pci_enable_device(struct pci_dev *dev);
-int __must_check pci_enable_device_io(struct pci_dev *dev);
 int __must_check pci_enable_device_mem(struct pci_dev *dev);
 int __must_check pci_reenable_device(struct pci_dev *);
 int __must_check pcim_enable_device(struct pci_dev *pdev);
Signature · 1 line
2.44.0
maintainer Reviewed-by on v1 2/2
#5 lore raw
Quoted 5 lines · Heiner Kallweit

After the last user was removed, remove this PCI core function. It's very unlikely that we'll see a new device requiring io space access, even though memory space access is supported.

Looks OK to me.

Signature · 2 lines
Damien Le Moal
Western Digital Research
#6 lore raw
In reply to Heiner Kallweit
Quoted 6 lines · Heiner Kallweit

The call to pci_enable_device_io() in cs5520 isn't needed and can be removed. This was the last user, so the function itself can be removed afterwards.

I'd propose to apply the series through the PCI tree.

Quoted 8 lines

Heiner Kallweit (2):
ata: pata_cs5520: Remove not needed call to pci_enable_device_io
PCI: Remove pci_enable_device_io()

 drivers/ata/pata_cs5520.c |  6 ------
 drivers/pci/pci.c         | 14 --------------
 include/linux/pci.h       |  1 -
 3 files changed, 21 deletions(-)

Applied to pci/enumeration with acks/reviewed-by from Damien and Sergey, thank you!