Commit c8ad1451 authored by Grygorii Strashko's avatar Grygorii Strashko Committed by David S. Miller

net: ethernet: ti: netcp_ethss: add support for child cpts node

Allow to place CPTS properties in the child "cpts" DT node. For backward
compatibility - roll-back and read CPTS DT properties from parent node if
"cpts" node is not present.
Signed-off-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
Acked-by: default avatarRichard Cochran <richardcochran@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8a6389a5
...@@ -3554,7 +3554,7 @@ static int set_gbenu_ethss_priv(struct gbe_priv *gbe_dev, ...@@ -3554,7 +3554,7 @@ static int set_gbenu_ethss_priv(struct gbe_priv *gbe_dev,
static int gbe_probe(struct netcp_device *netcp_device, struct device *dev, static int gbe_probe(struct netcp_device *netcp_device, struct device *dev,
struct device_node *node, void **inst_priv) struct device_node *node, void **inst_priv)
{ {
struct device_node *interfaces, *interface; struct device_node *interfaces, *interface, *cpts_node;
struct device_node *secondary_ports; struct device_node *secondary_ports;
struct cpsw_ale_params ale_params; struct cpsw_ale_params ale_params;
struct gbe_priv *gbe_dev; struct gbe_priv *gbe_dev;
...@@ -3713,7 +3713,12 @@ static int gbe_probe(struct netcp_device *netcp_device, struct device *dev, ...@@ -3713,7 +3713,12 @@ static int gbe_probe(struct netcp_device *netcp_device, struct device *dev,
dev_dbg(gbe_dev->dev, "Created a gbe ale engine\n"); dev_dbg(gbe_dev->dev, "Created a gbe ale engine\n");
} }
gbe_dev->cpts = cpts_create(gbe_dev->dev, gbe_dev->cpts_reg, node); cpts_node = of_get_child_by_name(node, "cpts");
if (!cpts_node)
cpts_node = of_node_get(node);
gbe_dev->cpts = cpts_create(gbe_dev->dev, gbe_dev->cpts_reg, cpts_node);
of_node_put(cpts_node);
if (IS_ENABLED(CONFIG_TI_CPTS) && IS_ERR(gbe_dev->cpts)) { if (IS_ENABLED(CONFIG_TI_CPTS) && IS_ERR(gbe_dev->cpts)) {
ret = PTR_ERR(gbe_dev->cpts); ret = PTR_ERR(gbe_dev->cpts);
goto free_sec_ports; goto free_sec_ports;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment