diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2014-08-28 02:04:49 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-08-28 07:59:39 +0200 |
commit | fa981d9af82e08f316ed25ed43078f995cc4be0a (patch) | |
tree | 8452bf0e5628615193033b4a4aaa83c6562d4b66 | |
parent | net: phy: provide stub for fixed_phy_set_link_update (diff) | |
download | linux-fa981d9af82e08f316ed25ed43078f995cc4be0a.tar.xz linux-fa981d9af82e08f316ed25ed43078f995cc4be0a.zip |
net: dsa: provide a switch device device tree node pointer
We might need to fetch additional resources from the device tree node
pointer, such as register ranges or other properties. Keep a device_node
pointer around for this.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/net/dsa.h | 7 | ||||
-rw-r--r-- | net/dsa/dsa.c | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/include/net/dsa.h b/include/net/dsa.h index 6e26f1e4d8ce..decc62709acd 100644 --- a/include/net/dsa.h +++ b/include/net/dsa.h @@ -15,6 +15,7 @@ #include <linux/list.h> #include <linux/timer.h> #include <linux/workqueue.h> +#include <linux/of.h> #define DSA_MAX_SWITCHES 4 #define DSA_MAX_PORTS 12 @@ -26,6 +27,12 @@ struct dsa_chip_data { struct device *mii_bus; int sw_addr; + /* Device tree node pointer for this specific switch chip + * used during switch setup in case additional properties + * and resources needs to be used + */ + struct device_node *of_node; + /* * The names of the switch's ports. Use "cpu" to * designate the switch port that the cpu is connected to, diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c index 92e71d2a2ccd..a28ef432d016 100644 --- a/net/dsa/dsa.c +++ b/net/dsa/dsa.c @@ -410,6 +410,7 @@ static int dsa_of_probe(struct platform_device *pdev) chip_index++; cd = &pd->chip[chip_index]; + cd->of_node = child; cd->mii_bus = &mdio_bus->dev; sw_addr = of_get_property(child, "reg", NULL); |