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:47:46 +0000 (12:47 +0200)
commitb94af62cdd502ff81d984ac3e619330655e9c71b
tree5a90c46783c06afe94d859c90bc406ea95603895
parent0bdf593390e776047c10e36a1a18b424a092ca7f
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