Skip to content

Commit 322c512

Browse files
author
Greg Ungerer
committed
m68knommu: include SDHC support only when hardware has it
The mere fact that the kernel has the MMC subsystem enabled (CONFIG_MMC enabled) does not mean that the underlying hardware platform has the SDHC hardware present. Within the ColdFire hardware defines that is signified by MCFSDHC_BASE being defined with an address. The platform data for the ColdFire parts is including the SDHC hardware if CONFIG_MMC is enabled, instead of MCFSDHC_BASE. This means that if you are compiling for a ColdFire target that does not support SDHC but enable CONFIG_MMC you will fail to compile with errors like this: arch/m68k/coldfire/device.c:565:12: error: ‘MCFSDHC_BASE’ undeclared here (not in a function) .start = MCFSDHC_BASE, ^ arch/m68k/coldfire/device.c:566:25: error: ‘MCFSDHC_SIZE’ undeclared here (not in a function) .end = MCFSDHC_BASE + MCFSDHC_SIZE - 1, ^ arch/m68k/coldfire/device.c:569:12: error: ‘MCF_IRQ_SDHC’ undeclared here (not in a function) .start = MCF_IRQ_SDHC, ^ Make the SDHC platform support depend on MCFSDHC_BASE, that is only include it if the specific ColdFire SoC has that hardware module. Fixes: 991f5c4 ("m68k: mcf5441x: add support for esdhc mmc controller") Signed-off-by: Greg Ungerer <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Reviewed-by: Angelo Dureghello <[email protected]> Tested-by: Angelo Dureghello <[email protected]>
1 parent 0069674 commit 322c512

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

arch/m68k/coldfire/device.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ static struct platform_device mcf_edma = {
554554
};
555555
#endif /* IS_ENABLED(CONFIG_MCF_EDMA) */
556556

557-
#if IS_ENABLED(CONFIG_MMC)
557+
#ifdef MCFSDHC_BASE
558558
static struct mcf_esdhc_platform_data mcf_esdhc_data = {
559559
.max_bus_width = 4,
560560
.cd_type = ESDHC_CD_NONE,
@@ -579,7 +579,7 @@ static struct platform_device mcf_esdhc = {
579579
.resource = mcf_esdhc_resources,
580580
.dev.platform_data = &mcf_esdhc_data,
581581
};
582-
#endif /* IS_ENABLED(CONFIG_MMC) */
582+
#endif /* MCFSDHC_BASE */
583583

584584
static struct platform_device *mcf_devices[] __initdata = {
585585
&mcf_uart,
@@ -613,7 +613,7 @@ static struct platform_device *mcf_devices[] __initdata = {
613613
#if IS_ENABLED(CONFIG_MCF_EDMA)
614614
&mcf_edma,
615615
#endif
616-
#if IS_ENABLED(CONFIG_MMC)
616+
#ifdef MCFSDHC_BASE
617617
&mcf_esdhc,
618618
#endif
619619
};

0 commit comments

Comments
 (0)