21b3491c6f7ddce47396982a40da288b7cf1d304
[openwrt/staging/jow.git] / package / kernel / qca-ssdk / patches / 0002-SSDK-platform-use-of_mdio_find_bus-to-get-MDIO-bus.patch
1 From 60d2b72cacd43796def9b4bd69a9e0e84be9d2e1 Mon Sep 17 00:00:00 2001
2 From: Robert Marko <robimarko@gmail.com>
3 Date: Wed, 12 May 2021 17:15:46 +0200
4 Subject: [PATCH 02/14] SSDK: platform: use of_mdio_find_bus() to get MDIO bus
5
6 Kernel has a generic of_mdio_find_bus() which can get the appropriate
7 MDIO bus based on the DT node.
8 So, drop the getting MDIO from platform data, which no longer works
9 in 5.4 and later and use of_mdio_find_bus().
10
11 Signed-off-by: Baruch Siach <baruch@tkos.co.il>
12 Signed-off-by: Robert Marko <robimarko@gmail.com>
13 ---
14 src/init/ssdk_plat.c | 8 +-------
15 1 file changed, 1 insertion(+), 7 deletions(-)
16
17 --- a/src/init/ssdk_plat.c
18 +++ b/src/init/ssdk_plat.c
19 @@ -753,7 +753,6 @@ static int miibus_get(a_uint32_t dev_id)
20 struct device_node *mdio_node = NULL;
21 struct device_node *switch_node = NULL;
22 struct platform_device *mdio_plat = NULL;
23 - struct qca_mdio_data *mdio_data = NULL;
24 struct qca_phy_priv *priv;
25 hsl_reg_mode reg_mode = HSL_REG_LOCAL_BUS;
26 priv = qca_phy_priv_global[dev_id];
27 @@ -788,12 +787,7 @@ static int miibus_get(a_uint32_t dev_id)
28
29 if(reg_mode == HSL_REG_LOCAL_BUS)
30 {
31 - mdio_data = dev_get_drvdata(&mdio_plat->dev);
32 - if (!mdio_data) {
33 - SSDK_ERROR("cannot get mdio_data reference from device data\n");
34 - return 1;
35 - }
36 - priv->miibus = mdio_data->mii_bus;
37 + priv->miibus = of_mdio_find_bus(mdio_node);
38 }
39 else
40 priv->miibus = dev_get_drvdata(&mdio_plat->dev);