ARM: orion5x: fix d2net gpio initialization
authorArnd Bergmann <arnd@arndb.de>
Tue, 16 May 2023 15:31:05 +0000 (17:31 +0200)
committerArnd Bergmann <arnd@arndb.de>
Fri, 26 May 2023 11:33:05 +0000 (13:33 +0200)
The DT version of this board has a custom file with the gpio
device. However, it does nothing because the d2net_init()
has no caller or prototype:

arch/arm/mach-orion5x/board-d2net.c:101:13: error: no previous prototype for 'd2net_init'

Call it from the board-dt file as intended.

Fixes: 94b0bd366e36 ("ARM: orion5x: convert d2net to Device Tree")
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20230516153109.514251-10-arnd@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
arch/arm/mach-orion5x/board-dt.c
arch/arm/mach-orion5x/common.h

index e3736ffc8347789c8c8ed78ea0d29df62f598c5b..be47492c6640d482fc64de48937a1e98cfd208da 100644 (file)
@@ -60,6 +60,9 @@ static void __init orion5x_dt_init(void)
        if (of_machine_is_compatible("maxtor,shared-storage-2"))
                mss2_init();
 
+       if (of_machine_is_compatible("lacie,d2-network"))
+               d2net_init();
+
        of_platform_default_populate(NULL, orion5x_auxdata_lookup, NULL);
 }
 
index f2e0577bf50f4ec25edd138e81448b136e5e6d81..8df70e23aa82a26956575a50c9ff6ea71ade3b99 100644 (file)
@@ -73,6 +73,12 @@ extern void mss2_init(void);
 static inline void mss2_init(void) {}
 #endif
 
+#ifdef CONFIG_MACH_D2NET_DT
+void d2net_init(void);
+#else
+static inline void d2net_init(void) {}
+#endif
+
 /*****************************************************************************
  * Helpers to access Orion registers
  ****************************************************************************/