net: stmmac: Fix stmmac_mdio_reset() when building stmmac as modules
authorNiklas Cassel <niklas.cassel@linaro.org>
Wed, 31 Oct 2018 15:08:10 +0000 (16:08 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 10 Nov 2018 15:42:58 +0000 (07:42 -0800)
commit8b9a62c58d4d6493bac8e6130ccb67cc8c8bb4c5
treeee1ee34d05315908f35aa7a6e24dc88e678f0808
parentf57ef24f811ccca74df04cc39b30e023654d9e99
net: stmmac: Fix stmmac_mdio_reset() when building stmmac as modules

[ Upstream commit 30549aab146ccb1275230c3b4b4bc6b4181fd54e ]

When building stmmac, it is only possible to select CONFIG_DWMAC_GENERIC,
or any of the glue drivers, when CONFIG_STMMAC_PLATFORM is set.
The only exception is CONFIG_STMMAC_PCI.

When calling of_mdiobus_register(), it will call our ->reset()
callback, which is set to stmmac_mdio_reset().

Most of the code in stmmac_mdio_reset() is protected by a
"#if defined(CONFIG_STMMAC_PLATFORM)", which will evaluate
to false when CONFIG_STMMAC_PLATFORM=m.

Because of this, the phy reset gpio will only be pulled when
stmmac is built as built-in, but not when built as modules.

Fix this by using "#if IS_ENABLED()" instead of "#if defined()".

Signed-off-by: Niklas Cassel <niklas.cassel@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c