Skip to content

Commit 3c2bf17

Browse files
rddunlapGreg Ungerer
authored andcommitted
m68k: coldfire/device.c: protect FLEXCAN blocks
When CAN_FLEXCAN=y and M5441x is not set/enabled, there are build errors in coldfire/device.c: ../arch/m68k/coldfire/device.c:595:26: error: 'MCFFLEXCAN_BASE0' undeclared here (not in a function); did you mean 'MCFDMA_BASE0'? 595 | .start = MCFFLEXCAN_BASE0, ../arch/m68k/coldfire/device.c:596:43: error: 'MCFFLEXCAN_SIZE' undeclared here (not in a function) 596 | .end = MCFFLEXCAN_BASE0 + MCFFLEXCAN_SIZE, ../arch/m68k/coldfire/device.c:600:26: error: 'MCF_IRQ_IFL0' undeclared here (not in a function); did you mean 'MCF_IRQ_I2C0'? 600 | .start = MCF_IRQ_IFL0, ../arch/m68k/coldfire/device.c:605:26: error: 'MCF_IRQ_BOFF0' undeclared here (not in a function); did you mean 'MCF_IRQ_I2C0'? 605 | .start = MCF_IRQ_BOFF0, ../arch/m68k/coldfire/device.c:610:26: error: 'MCF_IRQ_ERR0' undeclared here (not in a function); did you mean 'MCF_IRQ_I2C0'? 610 | .start = MCF_IRQ_ERR0, Protect the FLEXCAN code blocks by checking if MCFFLEXCAN_SIZE is defined. Fixes: 35a9f93 ("m68k: m5441x: add flexcan support") Signed-off-by: Randy Dunlap <[email protected]> Cc: Greg Ungerer <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Cc: [email protected] Cc: [email protected] Cc: Angelo Dureghello <[email protected]> Signed-off-by: Greg Ungerer <[email protected]>
1 parent e0dccc3 commit 3c2bf17

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
@@ -581,7 +581,7 @@ static struct platform_device mcf_esdhc = {
581581
};
582582
#endif /* MCFSDHC_BASE */
583583

584-
#if IS_ENABLED(CONFIG_CAN_FLEXCAN)
584+
#ifdef MCFFLEXCAN_SIZE
585585

586586
#include <linux/can/platform/flexcan.h>
587587

@@ -620,7 +620,7 @@ static struct platform_device mcf_flexcan0 = {
620620
.resource = mcf5441x_flexcan0_resource,
621621
.dev.platform_data = &mcf5441x_flexcan_info,
622622
};
623-
#endif /* IS_ENABLED(CONFIG_CAN_FLEXCAN) */
623+
#endif /* MCFFLEXCAN_SIZE */
624624

625625
static struct platform_device *mcf_devices[] __initdata = {
626626
&mcf_uart,
@@ -657,7 +657,7 @@ static struct platform_device *mcf_devices[] __initdata = {
657657
#ifdef MCFSDHC_BASE
658658
&mcf_esdhc,
659659
#endif
660-
#if IS_ENABLED(CONFIG_CAN_FLEXCAN)
660+
#ifdef MCFFLEXCAN_SIZE
661661
&mcf_flexcan0,
662662
#endif
663663
};

0 commit comments

Comments
 (0)