]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
common: board_r: Drop initr_bbmii wrapper
authorOvidiu Panait <ovidiu.panait@windriver.com>
Sat, 28 Nov 2020 08:43:17 +0000 (10:43 +0200)
committerTom Rini <trini@konsulko.com>
Fri, 15 Jan 2021 19:36:12 +0000 (14:36 -0500)
Add a return value to bb_miiphy_init and use it directly in the
post-relocation init sequence, rather than using a wrapper stub.

Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
common/board_r.c
drivers/net/phy/miiphybb.c
include/miiphy.h

index 500457b080992871d27dc50726ae7e42fcf670f3..c083eb0a0318f1d8490fd92e4bcecfd4af143a8a 100644 (file)
@@ -534,14 +534,6 @@ static int initr_scsi(void)
 }
 #endif
 
-#ifdef CONFIG_BITBANGMII
-static int initr_bbmii(void)
-{
-       bb_miiphy_init();
-       return 0;
-}
-#endif
-
 #ifdef CONFIG_CMD_NET
 static int initr_net(void)
 {
@@ -783,7 +775,7 @@ static init_fnc_t init_sequence_r[] = {
        initr_scsi,
 #endif
 #ifdef CONFIG_BITBANGMII
-       initr_bbmii,
+       bb_miiphy_init,
 #endif
 #ifdef CONFIG_PCI_ENDPOINT
        pci_ep_init,
index ba97a54c0676fd159a236254c38b9ec6bbce6340..59a32c4913011a9ab93b0be8ecff63a82510a108 100644 (file)
@@ -105,7 +105,7 @@ int bb_miiphy_buses_num = sizeof(bb_miiphy_buses) /
                          sizeof(bb_miiphy_buses[0]);
 #endif
 
-void bb_miiphy_init(void)
+int bb_miiphy_init(void)
 {
        int i;
 
@@ -124,6 +124,8 @@ void bb_miiphy_init(void)
                        bb_miiphy_buses[i].init(&bb_miiphy_buses[i]);
                }
        }
+
+       return 0;
 }
 
 static inline struct bb_miiphy_bus *bb_miiphy_getbus(const char *devname)
index 61c136b114cbd2aa1185e40882818a938bc78d4b..8b77bac01e6ada2c8794134f67d23d39458e50e2 100644 (file)
@@ -81,7 +81,15 @@ struct bb_miiphy_bus {
 extern struct bb_miiphy_bus bb_miiphy_buses[];
 extern int bb_miiphy_buses_num;
 
-void bb_miiphy_init(void);
+/**
+ * bb_miiphy_init() - Initialize bit-banged MII bus driver
+ *
+ * It is called during the generic post-relocation init sequence.
+ *
+ * Return: 0 if OK
+ */
+int bb_miiphy_init(void);
+
 int bb_miiphy_read(struct mii_dev *miidev, int addr, int devad, int reg);
 int bb_miiphy_write(struct mii_dev *miidev, int addr, int devad, int reg,
                    u16 value);