From patchwork Thu Jun 6 16:30:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grygorii Strashko X-Patchwork-Id: 165995 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp9012646ili; Thu, 6 Jun 2019 09:31:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqwHfH397nmBLON5Qskg37h9uAbYaNY0yv8XjWCGPrINDw2n7OdaGG3RFQauy6qK6a4taL87 X-Received: by 2002:a17:90a:8a10:: with SMTP id w16mr691573pjn.133.1559838697123; Thu, 06 Jun 2019 09:31:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559838697; cv=none; d=google.com; s=arc-20160816; b=M8stIhga5PB+VEnuMJb1kHavjjCCq0wiOxm1ZTuveJQE8gCj8N6dvs4vzuPf7HH5DR 9tBmERbfYDzPAnmcyIROGHsNz3yWl7h+aE39AvpixVfuh/cpHppZG8A4ITWQL1B5qCGM UPnl4ssl2f5JKQxWkm+BVgnTwqVRlbrsrZtmlpa5VX8P8Lp8ypNqqVejQd9GQH8g0uo2 9EPTSUbWj5UsfSU9XTk2lsIBD6Ae8DHTxiHnLfsLqX7d9LhT2VFxwjaEgBrrA110HJLT 5mo90Z6+eoau14d+flewxtLqqrEs2I+1EDarENtPfAT+765I7Npa85jSJZpro0YEmRDH +CkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=S48YHwd7VbL227WMm5WryGh9q4yCYlwCu31xqUVixwc=; b=growppm4fn8HjbeSNUVJIb1Wx9bXXKIU9HlrRS+J0wXYbdzaBB1cwxxNKCWM+Wod7N +DusDhYVLCrHFoyMz9o+kyVoH1dMCF8hDTQGXMkuXiZDA06sVBUiQu1Siq00laxv+Izd fjxjuA6nLupFe145oxCzBVSgcDxBmgLC2mnTbCZpzfp7ZwZBBlnGqAnzguMckKZmpm2s +QNQBnbbPbiQ0s8LMHDNW6ei9YV04qEQps7Xkd8M8GNziTbcLsBxrHEcgiLTf7PdlHfp iDiqmmSj7vyy1PmwZb5++GaCHxbE/FvbwVhqk6QsqpHqPlhq4ZVSZwpNVy1t8oiCYu/i vSoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=bdAf3w+r; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i2si2231451pfb.7.2019.06.06.09.31.36; Thu, 06 Jun 2019 09:31:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=bdAf3w+r; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729744AbfFFQbf (ORCPT + 30 others); Thu, 6 Jun 2019 12:31:35 -0400 Received: from lelv0143.ext.ti.com ([198.47.23.248]:54172 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726324AbfFFQbf (ORCPT ); Thu, 6 Jun 2019 12:31:35 -0400 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id x56GVKDX064586; Thu, 6 Jun 2019 11:31:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1559838680; bh=S48YHwd7VbL227WMm5WryGh9q4yCYlwCu31xqUVixwc=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=bdAf3w+rjpWp1dbGo7vCQ/qYkjDPWpIGYmuyjppdi2/T83b/e/1UgRB7V5oDMDfUU 03xpRbs4HonXwb7cyGhD0zZmdnby4Hnq5ibjFi8HI2+cXS8KE86+LFRGmFsGbTdyTU HyWrEQllzZTlvy/KB9ftknaW1hV2sJ4x+KYkYL5Y= Received: from DLEE112.ent.ti.com (dlee112.ent.ti.com [157.170.170.23]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x56GVKI6082758 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 6 Jun 2019 11:31:20 -0500 Received: from DLEE110.ent.ti.com (157.170.170.21) by DLEE112.ent.ti.com (157.170.170.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Thu, 6 Jun 2019 11:31:19 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DLEE110.ent.ti.com (157.170.170.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Thu, 6 Jun 2019 11:31:19 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id x56GVIuB052685; Thu, 6 Jun 2019 11:31:19 -0500 From: Grygorii Strashko To: "David S. Miller" , Santosh Shilimkar , Richard Cochran , Rob Herring CC: Sekhar Nori , Murali Karicheri , Wingman Kwok , , , , , Grygorii Strashko 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 Message-ID: <20190606163047.31199-4-grygorii.strashko@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190606163047.31199-1-grygorii.strashko@ti.com> References: <20190606163047.31199-1-grygorii.strashko@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Acked-by: Richard Cochran --- drivers/net/ethernet/ti/netcp_ethss.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) -- 2.17.1 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;