diff mbox series

[v5,02/44] ata: add HAS_IOPORT dependencies

Message ID 20230522105049.1467313-3-schnelle@linux.ibm.com (mailing list archive)
State Handled Elsewhere
Headers show
Series treewide: Remove I/O port accessors for HAS_IOPORT=n | expand

Commit Message

Niklas Schnelle May 22, 2023, 10:50 a.m. UTC
In a future patch HAS_IOPORT=n will result in inb()/outb() and friends
not being declared. We thus need to add HAS_IOPORT as dependency for
those drivers using them.

Co-developed-by: Arnd Bergmann <arnd@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@kernel.org>
Acked-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
---
 drivers/ata/Kconfig      | 28 ++++++++++++++--------------
 drivers/ata/libata-sff.c |  4 ++++
 2 files changed, 18 insertions(+), 14 deletions(-)

Comments

Damien Le Moal May 22, 2023, 11:49 a.m. UTC | #1
On 5/22/23 19:50, Niklas Schnelle wrote:
> In a future patch HAS_IOPORT=n will result in inb()/outb() and friends
> not being declared. We thus need to add HAS_IOPORT as dependency for
> those drivers using them.
> 
> Co-developed-by: Arnd Bergmann <arnd@kernel.org>
> Signed-off-by: Arnd Bergmann <arnd@kernel.org>
> Acked-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>

This new version looks much nicer !

Please change my Ack to:

Acked-by: Damien Le Moal <dlemoal@kernel.org>

> Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
> ---
>  drivers/ata/Kconfig      | 28 ++++++++++++++--------------
>  drivers/ata/libata-sff.c |  4 ++++
>  2 files changed, 18 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
> index 42b51c9812a0..c521cdc51f8c 100644
> --- a/drivers/ata/Kconfig
> +++ b/drivers/ata/Kconfig
> @@ -557,7 +557,7 @@ comment "PATA SFF controllers with BMDMA"
>  
>  config PATA_ALI
>  	tristate "ALi PATA support"
> -	depends on PCI
> +	depends on PCI && HAS_IOPORT
>  	select PATA_TIMINGS
>  	help
>  	  This option enables support for the ALi ATA interfaces
> @@ -567,7 +567,7 @@ config PATA_ALI
>  
>  config PATA_AMD
>  	tristate "AMD/NVidia PATA support"
> -	depends on PCI
> +	depends on PCI && HAS_IOPORT
>  	select PATA_TIMINGS
>  	help
>  	  This option enables support for the AMD and NVidia PATA
> @@ -585,7 +585,7 @@ config PATA_ARASAN_CF
>  
>  config PATA_ARTOP
>  	tristate "ARTOP 6210/6260 PATA support"
> -	depends on PCI
> +	depends on PCI && HAS_IOPORT
>  	help
>  	  This option enables support for ARTOP PATA controllers.
>  
> @@ -612,7 +612,7 @@ config PATA_ATP867X
>  
>  config PATA_CMD64X
>  	tristate "CMD64x PATA support"
> -	depends on PCI
> +	depends on PCI && HAS_IOPORT
>  	select PATA_TIMINGS
>  	help
>  	  This option enables support for the CMD64x series chips
> @@ -659,7 +659,7 @@ config PATA_CS5536
>  
>  config PATA_CYPRESS
>  	tristate "Cypress CY82C693 PATA support (Very Experimental)"
> -	depends on PCI
> +	depends on PCI && HAS_IOPORT
>  	select PATA_TIMINGS
>  	help
>  	  This option enables support for the Cypress/Contaq CY82C693
> @@ -707,7 +707,7 @@ config PATA_HPT366
>  
>  config PATA_HPT37X
>  	tristate "HPT 370/370A/371/372/374/302 PATA support"
> -	depends on PCI
> +	depends on PCI && HAS_IOPORT
>  	help
>  	  This option enables support for the majority of the later HPT
>  	  PATA controllers via the new ATA layer.
> @@ -716,7 +716,7 @@ config PATA_HPT37X
>  
>  config PATA_HPT3X2N
>  	tristate "HPT 371N/372N/302N PATA support"
> -	depends on PCI
> +	depends on PCI && HAS_IOPORT
>  	help
>  	  This option enables support for the N variant HPT PATA
>  	  controllers via the new ATA layer.
> @@ -819,7 +819,7 @@ config PATA_MPC52xx
>  
>  config PATA_NETCELL
>  	tristate "NETCELL Revolution RAID support"
> -	depends on PCI
> +	depends on PCI && HAS_IOPORT
>  	help
>  	  This option enables support for the Netcell Revolution RAID
>  	  PATA controller.
> @@ -855,7 +855,7 @@ config PATA_OLDPIIX
>  
>  config PATA_OPTIDMA
>  	tristate "OPTI FireStar PATA support (Very Experimental)"
> -	depends on PCI
> +	depends on PCI && HAS_IOPORT
>  	help
>  	  This option enables DMA/PIO support for the later OPTi
>  	  controllers found on some old motherboards and in some
> @@ -865,7 +865,7 @@ config PATA_OPTIDMA
>  
>  config PATA_PDC2027X
>  	tristate "Promise PATA 2027x support"
> -	depends on PCI
> +	depends on PCI && HAS_IOPORT
>  	help
>  	  This option enables support for Promise PATA pdc20268 to pdc20277 host adapters.
>  
> @@ -873,7 +873,7 @@ config PATA_PDC2027X
>  
>  config PATA_PDC_OLD
>  	tristate "Older Promise PATA controller support"
> -	depends on PCI
> +	depends on PCI && HAS_IOPORT
>  	help
>  	  This option enables support for the Promise 20246, 20262, 20263,
>  	  20265 and 20267 adapters.
> @@ -901,7 +901,7 @@ config PATA_RDC
>  
>  config PATA_SC1200
>  	tristate "SC1200 PATA support"
> -	depends on PCI && (X86_32 || COMPILE_TEST)
> +	depends on PCI && (X86_32 || COMPILE_TEST) && HAS_IOPORT
>  	help
>  	  This option enables support for the NatSemi/AMD SC1200 SoC
>  	  companion chip used with the Geode processor family.
> @@ -919,7 +919,7 @@ config PATA_SCH
>  
>  config PATA_SERVERWORKS
>  	tristate "SERVERWORKS OSB4/CSB5/CSB6/HT1000 PATA support"
> -	depends on PCI
> +	depends on PCI && HAS_IOPORT
>  	help
>  	  This option enables support for the Serverworks OSB4/CSB5/CSB6 and
>  	  HT1000 PATA controllers, via the new ATA layer.
> @@ -1183,7 +1183,7 @@ config ATA_GENERIC
>  
>  config PATA_LEGACY
>  	tristate "Legacy ISA PATA support (Experimental)"
> -	depends on (ISA || PCI)
> +	depends on (ISA || PCI) && HAS_IOPORT
>  	select PATA_TIMINGS
>  	help
>  	  This option enables support for ISA/VLB/PCI bus legacy PATA
> diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
> index 9d28badfe41d..c8cb7ed28f83 100644
> --- a/drivers/ata/libata-sff.c
> +++ b/drivers/ata/libata-sff.c
> @@ -3042,6 +3042,7 @@ EXPORT_SYMBOL_GPL(ata_bmdma_port_start32);
>   */
>  int ata_pci_bmdma_clear_simplex(struct pci_dev *pdev)
>  {
> +#ifdef CONFIG_HAS_IOPORT
>  	unsigned long bmdma = pci_resource_start(pdev, 4);
>  	u8 simplex;
>  
> @@ -3054,6 +3055,9 @@ int ata_pci_bmdma_clear_simplex(struct pci_dev *pdev)
>  	if (simplex & 0x80)
>  		return -EOPNOTSUPP;
>  	return 0;
> +#else
> +	return -ENOENT;
> +#endif /* CONFIG_HAS_IOPORT */
>  }
>  EXPORT_SYMBOL_GPL(ata_pci_bmdma_clear_simplex);
>
diff mbox series

Patch

diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index 42b51c9812a0..c521cdc51f8c 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -557,7 +557,7 @@  comment "PATA SFF controllers with BMDMA"
 
 config PATA_ALI
 	tristate "ALi PATA support"
-	depends on PCI
+	depends on PCI && HAS_IOPORT
 	select PATA_TIMINGS
 	help
 	  This option enables support for the ALi ATA interfaces
@@ -567,7 +567,7 @@  config PATA_ALI
 
 config PATA_AMD
 	tristate "AMD/NVidia PATA support"
-	depends on PCI
+	depends on PCI && HAS_IOPORT
 	select PATA_TIMINGS
 	help
 	  This option enables support for the AMD and NVidia PATA
@@ -585,7 +585,7 @@  config PATA_ARASAN_CF
 
 config PATA_ARTOP
 	tristate "ARTOP 6210/6260 PATA support"
-	depends on PCI
+	depends on PCI && HAS_IOPORT
 	help
 	  This option enables support for ARTOP PATA controllers.
 
@@ -612,7 +612,7 @@  config PATA_ATP867X
 
 config PATA_CMD64X
 	tristate "CMD64x PATA support"
-	depends on PCI
+	depends on PCI && HAS_IOPORT
 	select PATA_TIMINGS
 	help
 	  This option enables support for the CMD64x series chips
@@ -659,7 +659,7 @@  config PATA_CS5536
 
 config PATA_CYPRESS
 	tristate "Cypress CY82C693 PATA support (Very Experimental)"
-	depends on PCI
+	depends on PCI && HAS_IOPORT
 	select PATA_TIMINGS
 	help
 	  This option enables support for the Cypress/Contaq CY82C693
@@ -707,7 +707,7 @@  config PATA_HPT366
 
 config PATA_HPT37X
 	tristate "HPT 370/370A/371/372/374/302 PATA support"
-	depends on PCI
+	depends on PCI && HAS_IOPORT
 	help
 	  This option enables support for the majority of the later HPT
 	  PATA controllers via the new ATA layer.
@@ -716,7 +716,7 @@  config PATA_HPT37X
 
 config PATA_HPT3X2N
 	tristate "HPT 371N/372N/302N PATA support"
-	depends on PCI
+	depends on PCI && HAS_IOPORT
 	help
 	  This option enables support for the N variant HPT PATA
 	  controllers via the new ATA layer.
@@ -819,7 +819,7 @@  config PATA_MPC52xx
 
 config PATA_NETCELL
 	tristate "NETCELL Revolution RAID support"
-	depends on PCI
+	depends on PCI && HAS_IOPORT
 	help
 	  This option enables support for the Netcell Revolution RAID
 	  PATA controller.
@@ -855,7 +855,7 @@  config PATA_OLDPIIX
 
 config PATA_OPTIDMA
 	tristate "OPTI FireStar PATA support (Very Experimental)"
-	depends on PCI
+	depends on PCI && HAS_IOPORT
 	help
 	  This option enables DMA/PIO support for the later OPTi
 	  controllers found on some old motherboards and in some
@@ -865,7 +865,7 @@  config PATA_OPTIDMA
 
 config PATA_PDC2027X
 	tristate "Promise PATA 2027x support"
-	depends on PCI
+	depends on PCI && HAS_IOPORT
 	help
 	  This option enables support for Promise PATA pdc20268 to pdc20277 host adapters.
 
@@ -873,7 +873,7 @@  config PATA_PDC2027X
 
 config PATA_PDC_OLD
 	tristate "Older Promise PATA controller support"
-	depends on PCI
+	depends on PCI && HAS_IOPORT
 	help
 	  This option enables support for the Promise 20246, 20262, 20263,
 	  20265 and 20267 adapters.
@@ -901,7 +901,7 @@  config PATA_RDC
 
 config PATA_SC1200
 	tristate "SC1200 PATA support"
-	depends on PCI && (X86_32 || COMPILE_TEST)
+	depends on PCI && (X86_32 || COMPILE_TEST) && HAS_IOPORT
 	help
 	  This option enables support for the NatSemi/AMD SC1200 SoC
 	  companion chip used with the Geode processor family.
@@ -919,7 +919,7 @@  config PATA_SCH
 
 config PATA_SERVERWORKS
 	tristate "SERVERWORKS OSB4/CSB5/CSB6/HT1000 PATA support"
-	depends on PCI
+	depends on PCI && HAS_IOPORT
 	help
 	  This option enables support for the Serverworks OSB4/CSB5/CSB6 and
 	  HT1000 PATA controllers, via the new ATA layer.
@@ -1183,7 +1183,7 @@  config ATA_GENERIC
 
 config PATA_LEGACY
 	tristate "Legacy ISA PATA support (Experimental)"
-	depends on (ISA || PCI)
+	depends on (ISA || PCI) && HAS_IOPORT
 	select PATA_TIMINGS
 	help
 	  This option enables support for ISA/VLB/PCI bus legacy PATA
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
index 9d28badfe41d..c8cb7ed28f83 100644
--- a/drivers/ata/libata-sff.c
+++ b/drivers/ata/libata-sff.c
@@ -3042,6 +3042,7 @@  EXPORT_SYMBOL_GPL(ata_bmdma_port_start32);
  */
 int ata_pci_bmdma_clear_simplex(struct pci_dev *pdev)
 {
+#ifdef CONFIG_HAS_IOPORT
 	unsigned long bmdma = pci_resource_start(pdev, 4);
 	u8 simplex;
 
@@ -3054,6 +3055,9 @@  int ata_pci_bmdma_clear_simplex(struct pci_dev *pdev)
 	if (simplex & 0x80)
 		return -EOPNOTSUPP;
 	return 0;
+#else
+	return -ENOENT;
+#endif /* CONFIG_HAS_IOPORT */
 }
 EXPORT_SYMBOL_GPL(ata_pci_bmdma_clear_simplex);