linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Grygorii Strashko <grygorii.strashko@ti.com>
To: "David S. Miller" <davem@davemloft.net>,
	Santosh Shilimkar <ssantosh@kernel.org>,
	Richard Cochran <richardcochran@gmail.com>,
	Rob Herring <robh+dt@kernel.org>
Cc: Sekhar Nori <nsekhar@ti.com>,
	Murali Karicheri <m-karicheri2@ti.com>,
	Wingman Kwok <w-kwok2@ti.com>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	Grygorii Strashko <grygorii.strashko@ti.com>
Subject: [PATCH net-next v2 03/10] net: ethernet: ti: netcp_ethss: add support for child cpts node
Date: Thu, 6 Jun 2019 19:30:40 +0300	[thread overview]
Message-ID: <20190606163047.31199-4-grygorii.strashko@ti.com> (raw)
In-Reply-To: <20190606163047.31199-1-grygorii.strashko@ti.com>

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: Grygorii Strashko <grygorii.strashko@ti.com>
Acked-by: Richard Cochran <richardcochran@gmail.com>
---
 drivers/net/ethernet/ti/netcp_ethss.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/ti/netcp_ethss.c b/drivers/net/ethernet/ti/netcp_ethss.c
index ec179700c184..2c1fac33136c 100644
--- a/drivers/net/ethernet/ti/netcp_ethss.c
+++ b/drivers/net/ethernet/ti/netcp_ethss.c
@@ -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,
 		     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 cpsw_ale_params ale_params;
 	struct gbe_priv *gbe_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");
 	}
 
-	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)) {
 		ret = PTR_ERR(gbe_dev->cpts);
 		goto free_sec_ports;
-- 
2.17.1


  parent reply	other threads:[~2019-06-06 16:31 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-06 16:30 [PATCH net-next v2 00/10] net: ethernet: ti: netcp: update and enable cpts support Grygorii Strashko
2019-06-06 16:30 ` [PATCH net-next v2 01/10] dt-bindings: doc: net: keystone-netcp: document cpts Grygorii Strashko
2019-06-06 16:30 ` [PATCH net-next v2 02/10] net: ethernet: ti: cpts: use devm_get_clk_from_child Grygorii Strashko
2019-06-06 16:30 ` Grygorii Strashko [this message]
2019-06-06 16:30 ` [PATCH net-next v2 04/10] net: ethernet: ti: cpts: add support for ext rftclk selection Grygorii Strashko
2019-06-06 16:30 ` [PATCH net-next v2 05/10] ARM: dts: keystone-clocks: add input fixed clocks Grygorii Strashko
2019-06-06 16:30 ` [PATCH net-next v2 06/10] ARM: dts: k2e-clocks: add input ext. fixed clocks tsipclka/b Grygorii Strashko
2019-06-06 16:30 ` [PATCH net-next v2 07/10] ARM: dts: k2e-netcp: add cpts refclk_mux node Grygorii Strashko
2019-06-06 16:30 ` [PATCH net-next v2 08/10] ARM: dts: k2hk-netcp: " Grygorii Strashko
2019-06-06 16:30 ` [PATCH net-next v2 09/10] ARM: dts: k2l-netcp: " Grygorii Strashko
2019-06-06 16:30 ` [PATCH net-next v2 10/10] ARM: configs: keystone: enable cpts Grygorii Strashko
2019-06-09 19:55 ` [PATCH net-next v2 00/10] net: ethernet: ti: netcp: update and enable cpts support David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190606163047.31199-4-grygorii.strashko@ti.com \
    --to=grygorii.strashko@ti.com \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m-karicheri2@ti.com \
    --cc=netdev@vger.kernel.org \
    --cc=nsekhar@ti.com \
    --cc=richardcochran@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=ssantosh@kernel.org \
    --cc=w-kwok2@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).