net: mdio: fix owner field for mdio buses registered using device-tree
authorMaxime Bizon <mbizon@freebox.fr>
Thu, 16 Mar 2023 23:33:16 +0000 (16:33 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Mar 2023 10:49:05 +0000 (12:49 +0200)
commitc2b6e1a440d24509d2bf542206decae55821e1e5
treec0abe440c07395869c847b8cb9ac7bf0f2b31444
parent8f07f16b3455c58f944c4bf43dcf965ba8f90d54
net: mdio: fix owner field for mdio buses registered using device-tree

[ Upstream commit 99669259f3361d759219811e670b7e0742668556 ]

Bus ownership is wrong when using of_mdiobus_register() to register an mdio
bus. That function is not inline, so when it calls mdiobus_register() the wrong
THIS_MODULE value is captured.

Signed-off-by: Maxime Bizon <mbizon@freebox.fr>
Fixes: 90eff9096c01 ("net: phy: Allow splitting MDIO bus/device support from PHYs")
[florian: fix kdoc, added Fixes tag]
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/mdio/of_mdio.c
drivers/net/phy/mdio_devres.c
include/linux/of_mdio.h