From: Markus Stockhausen Date: Tue, 27 Jan 2026 07:33:34 +0000 (+0100) Subject: realtek: mdio: add regmap to bus structure X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5731993557e55e2b491474382318d85718930cb4;p=thirdparty%2Fopenwrt.git realtek: mdio: add regmap to bus structure To convert the existing sw_xxx() commands the bus needs a regmap. This is derived from the parent mfd node like in all other Realtek drivers. Signed-off-by: Markus Stockhausen Link: https://github.com/openwrt/openwrt/pull/21741 Signed-off-by: Robert Marko --- diff --git a/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c b/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c index 97fe3001089..eebf6d5274d 100644 --- a/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c +++ b/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c @@ -1,10 +1,9 @@ // SPDX-License-Identifier: GPL-2.0-only +#include #include -#include -#include -#include -#include +#include +#include #include #include #include @@ -175,6 +174,7 @@ struct rtmdio_ctrl { + struct regmap *map; const struct rtmdio_config *cfg; int page[RTMDIO_MAX_PORT]; bool raw[RTMDIO_MAX_PORT]; @@ -899,6 +899,10 @@ static int rtmdio_probe(struct platform_device *pdev) ctrl = bus->priv; ctrl->cfg = (const struct rtmdio_config *)device_get_match_data(dev); + ctrl->map = syscon_node_to_regmap(pdev->dev.of_node->parent); + if (IS_ERR(ctrl->map)) + return PTR_ERR(ctrl->map); + for (addr = 0; addr < RTMDIO_MAX_PORT; addr++) ctrl->smi_bus[addr] = -1;