mirror of
https://github.com/hanwckf/immortalwrt-mt798x.git
synced 2025-01-10 19:12:33 +08:00
kernel: rtl8366_smi: guard of_mdiobus_register() call
Make the call to of_mdiobus_register() dependant on CONFIG_OF to avoid pulling in an unwanted dependency on of_mdio.ko. Fixes: 3dc523f232 kernel: add OF support to rtl8355 driver Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
ecd954d530
commit
d8c7cd9cb1
@ -916,9 +916,10 @@ static inline void rtl8366_debugfs_remove(struct rtl8366_smi *smi) {}
|
|||||||
static int rtl8366_smi_mii_init(struct rtl8366_smi *smi)
|
static int rtl8366_smi_mii_init(struct rtl8366_smi *smi)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
struct device_node *np = NULL;
|
|
||||||
|
|
||||||
#ifdef CONFIG_OF
|
#ifdef CONFIG_OF
|
||||||
|
struct device_node *np = NULL;
|
||||||
|
|
||||||
np = of_get_child_by_name(smi->parent->of_node, "mdio-bus");
|
np = of_get_child_by_name(smi->parent->of_node, "mdio-bus");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -945,10 +946,13 @@ static int rtl8366_smi_mii_init(struct rtl8366_smi *smi)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_OF
|
||||||
if (np)
|
if (np)
|
||||||
ret = of_mdiobus_register(smi->mii_bus, np);
|
ret = of_mdiobus_register(smi->mii_bus, np);
|
||||||
else
|
else
|
||||||
|
#endif
|
||||||
ret = mdiobus_register(smi->mii_bus);
|
ret = mdiobus_register(smi->mii_bus);
|
||||||
|
|
||||||
if (ret)
|
if (ret)
|
||||||
goto err_free;
|
goto err_free;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user