Skip to contentSkip to conversation

m68k: coldfire/device.c: only build FEC when HW macros are defined

PATCH In review Antonio Quartulli 2 participants 2 messages Oct 29, 2024 – Nov 4, 2024

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

PATCH 1/1 m68k: coldfire/device.c: only build FEC when HW macros are defined

When CONFIG_FEC is set (due to COMPILE_TEST) along with CONFIG_M54xx, coldfire/device.c has compile errors due to missing MCFEC_* and MCF_IRQ_FEC_* symbols.

Make the whole FEC blocks dependent on having the HW macros defined, rather than on CONFIG_FEC itself.

This fix is very similar to commit e6e1e7b19fa1 ("m68k: coldfire/device.c: only build for MCF_EDMA when h/w macros are defined")

Fixes b7ce7f0d0efc ("m68knommu: merge common ColdFire FEC platform setup code")

To: Greg Ungerer <[email protected]>
To: Geert Uytterhoeven <[email protected]>

---
 arch/m68k/coldfire/device.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
arch/m68k/coldfire/device.c +4 -4
index 7dab46728aed..b6958ec2a220 100644
@@ -93,7 +93,7 @@ static struct platform_device mcf_uart = {
 	.dev.platform_data	= mcf_uart_platform_data,
 };
 
-#if IS_ENABLED(CONFIG_FEC)
+#ifdef MCFFEC_BASE0
 
 #ifdef CONFIG_M5441x
 #define FEC_NAME	"enet-fec"
@@ -145,6 +145,7 @@ static struct platform_device mcf_fec0 = {
 		.platform_data		= FEC_PDATA,
 	}
 };
+#endif /* MCFFEC_BASE0 */
 
 #ifdef MCFFEC_BASE1
 static struct resource mcf_fec1_resources[] = {
@@ -182,7 +183,6 @@ static struct platform_device mcf_fec1 = {
 	}
 };
 #endif /* MCFFEC_BASE1 */
-#endif /* CONFIG_FEC */
 
 #if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
 /*
@@ -624,12 +624,12 @@ static struct platform_device mcf_flexcan0 = {
 
 static struct platform_device *mcf_devices[] __initdata = {
 	&mcf_uart,
-#if IS_ENABLED(CONFIG_FEC)
+#ifdef MCFFEC_BASE0
 	&mcf_fec0,
+#endif
 #ifdef MCFFEC_BASE1
 	&mcf_fec1,
 #endif
-#endif
 #if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
 	&mcf_qspi,
 #endif
Signature · 1 line
2.45.2
maintainer
#1 lore raw

Hi Antonio,

Quoted 7 lines · Antonio Quartulli

When CONFIG_FEC is set (due to COMPILE_TEST) along with CONFIG_M54xx, coldfire/device.c has compile errors due to missing MCFEC_* and MCF_IRQ_FEC_* symbols.

Make the whole FEC blocks dependent on having the HW macros defined, rather than on CONFIG_FEC itself.

Quoted 8 lines

This fix is very similar to commit e6e1e7b19fa1 ("m68k: coldfire/device.c: only build for MCF_EDMA when h/w macros are defined")

Fixes b7ce7f0d0efc ("m68knommu: merge common ColdFire FEC platform setup code")

To: Greg Ungerer <[email protected]>
To: Geert Uytterhoeven <[email protected]>

Thanks, looks good. Applied to the m68knommu git tree, for-next branch.

Regards
Greg

Quoted 48 lines
---
  arch/m68k/coldfire/device.c | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)
arch/m68k/coldfire/device.c +4 -4
index 7dab46728aed..b6958ec2a220 100644
@@ -93,7 +93,7 @@ static struct platform_device mcf_uart = {
  	.dev.platform_data	= mcf_uart_platform_data,
  };
 
-#if IS_ENABLED(CONFIG_FEC)
+#ifdef MCFFEC_BASE0
 
  #ifdef CONFIG_M5441x
  #define FEC_NAME	"enet-fec"
@@ -145,6 +145,7 @@ static struct platform_device mcf_fec0 = {
  		.platform_data		= FEC_PDATA,
  	}
  };
+#endif /* MCFFEC_BASE0 */
 
  #ifdef MCFFEC_BASE1
  static struct resource mcf_fec1_resources[] = {
@@ -182,7 +183,6 @@ static struct platform_device mcf_fec1 = {
  	}
  };
  #endif /* MCFFEC_BASE1 */
-#endif /* CONFIG_FEC */
 
  #if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
  /*
@@ -624,12 +624,12 @@ static struct platform_device mcf_flexcan0 = {
 
  static struct platform_device *mcf_devices[] __initdata = {
  	&mcf_uart,
-#if IS_ENABLED(CONFIG_FEC)
+#ifdef MCFFEC_BASE0
  	&mcf_fec0,
+#endif
  #ifdef MCFFEC_BASE1
  	&mcf_fec1,
  #endif
-#endif
  #if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
  	&mcf_qspi,
  #endif