[PATCH 05/17] [m68k] Atari: fix EtherNAT interrupt number; conditionalize EtherNAT platform device register Signed-off-by: Michael Schmitz <schmitz@xxxxxxxxxx> --- arch/m68k/atari/config.c | 17 ++++++++++++++--- 1 files changed, 14 insertions(+), 3 deletions(-) diff --git a/arch/m68k/atari/config.c b/arch/m68k/atari/config.c index 4fc7396..e7aa0f7 100644 --- a/arch/m68k/atari/config.c +++ b/arch/m68k/atari/config.c @@ -662,7 +662,7 @@ static void atari_get_hardware_list(struct seq_file *m) */ #define ATARI_ETHERNAT_PHYS_ADDR 0x80000000 -#define ATARI_ETHERNAT_IRQ 0xc3 +#define ATARI_ETHERNAT_IRQ 140 static struct resource smc91x_resources[] = { [0] = { @@ -686,16 +686,27 @@ static struct platform_device smc91x_device = { .resource = smc91x_resources, }; -static struct platform_device *atari_platform_devices[] __initdata = { +static struct platform_device *atari_ethernat_devices[] __initdata = { &smc91x_device }; int __init atari_platform_init(void) { + unsigned char *enatc_virt; + int rv = -ENODEV; + if (!MACH_IS_ATARI) return -ENODEV; - return platform_add_devices(atari_platform_devices, ARRAY_SIZE(atari_platform_devices)); +#if IS_ENABLED(CONFIG_ATARI_ETHERNAT) + enatc_virt = (unsigned char *)ioremap((ATARI_ETHERNAT_PHYS_ADDR+0x23), 0xf); + if (hwreg_present(enatc_virt)) { + rv = platform_add_devices(atari_ethernat_devices, ARRAY_SIZE(atari_ethernat_devices)); + } + iounmap(enatc_virt); +#endif + + return rv; } arch_initcall(atari_platform_init); -- 1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-m68k" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html