]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: mscc: ocelot: get HSIO regmap from syscon
authorQuentin Schulz <quentin.schulz@bootlin.com>
Thu, 4 Oct 2018 12:22:00 +0000 (14:22 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 5 Oct 2018 21:36:44 +0000 (14:36 -0700)
HSIO address space was moved to a syscon, hence we need to get the
regmap of this address space from there and no more from the device
node.

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Quentin Schulz <quentin.schulz@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mscc/ocelot_board.c

index 3cdf63e35b53bc1ea3e2f445e6a3746a56655bd3..dca205e0ef7521d47b1d7854290554a5a97ba6f1 100644 (file)
@@ -9,6 +9,7 @@
 #include <linux/netdevice.h>
 #include <linux/of_mdio.h>
 #include <linux/of_platform.h>
+#include <linux/mfd/syscon.h>
 #include <linux/skbuff.h>
 
 #include "ocelot.h"
@@ -168,6 +169,7 @@ static int mscc_ocelot_probe(struct platform_device *pdev)
        struct device_node *np = pdev->dev.of_node;
        struct device_node *ports, *portnp;
        struct ocelot *ocelot;
+       struct regmap *hsio;
        u32 val;
 
        struct {
@@ -179,7 +181,6 @@ static int mscc_ocelot_probe(struct platform_device *pdev)
                { QSYS, "qsys" },
                { ANA, "ana" },
                { QS, "qs" },
-               { HSIO, "hsio" },
        };
 
        if (!np && !pdev->dev.platform_data)
@@ -202,6 +203,14 @@ static int mscc_ocelot_probe(struct platform_device *pdev)
                ocelot->targets[res[i].id] = target;
        }
 
+       hsio = syscon_regmap_lookup_by_compatible("mscc,ocelot-hsio");
+       if (IS_ERR(hsio)) {
+               dev_err(&pdev->dev, "missing hsio syscon\n");
+               return PTR_ERR(hsio);
+       }
+
+       ocelot->targets[HSIO] = hsio;
+
        err = ocelot_chip_init(ocelot);
        if (err)
                return err;