]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net: macb: fix use of at91_default_usrio without CONFIG_OF
authorConor Dooley <conor.dooley@microchip.com>
Tue, 31 Mar 2026 13:10:21 +0000 (14:10 +0100)
committerJakub Kicinski <kuba@kernel.org>
Thu, 2 Apr 2026 03:15:19 +0000 (20:15 -0700)
If CONFIG_OF is not enabled, at91_default_usrio is used undeclared in
gem_default_config. Move at91_default_usrio back above the CONFIG_OF
section where macb_default_usrio used to be, so that it is unconditionally
defined and defined prior to any of the users.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202603280028.wQjUrIvv-lkp@intel.com/
Reported-by: Jiawen Wu <jiawenwu@trustnetic.com>
Closes: https://lore.kernel.org/all/06a701dcc014$86def5b0$949ce110$@trustnetic.com/
Fixes: a17871778ee28 ("net: macb: rename macb_default_usrio to at91_default_usrio as not all platforms have mii mode control in usrio")
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://patch.msgid.link/20260331-enroll-sensation-50901318a419@spud
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/cadence/macb_main.c

index 7a48ebe0741f3b031d4c3c266cc0e565bab61211..7f061d7c95af9aec37f73d3529a8cb276b263452 100644 (file)
@@ -4949,6 +4949,13 @@ static int macb_init(struct platform_device *pdev,
                return macb_init_dflt(pdev);
 }
 
+static const struct macb_usrio_config at91_default_usrio = {
+       .mii = MACB_BIT(MII),
+       .rmii = MACB_BIT(RMII),
+       .rgmii = GEM_BIT(RGMII),
+       .clken = MACB_BIT(CLKEN),
+};
+
 #if defined(CONFIG_OF)
 /* 1518 rounded up */
 #define AT91ETHER_MAX_RBUFF_SZ 0x600
@@ -5523,13 +5530,6 @@ static int eyeq5_init(struct platform_device *pdev)
        return ret;
 }
 
-static const struct macb_usrio_config at91_default_usrio = {
-       .mii = MACB_BIT(MII),
-       .rmii = MACB_BIT(RMII),
-       .rgmii = GEM_BIT(RGMII),
-       .clken = MACB_BIT(CLKEN),
-};
-
 static const struct macb_usrio_config mpfs_usrio = {
        .tsu_source = 0,
 };