From patchwork Thu May 30 18:20:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 165458 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp1314408ili; Thu, 30 May 2019 11:21:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqxmmqUfnHbhcoAkumf6X1W1+pBes0AT3TsMZGRvgMqh/u5SDJJmsLf5fRQJwDA5KyK+TLM4 X-Received: by 2002:a17:902:b695:: with SMTP id c21mr4834944pls.160.1559240487614; Thu, 30 May 2019 11:21:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559240487; cv=none; d=google.com; s=arc-20160816; b=wSkLLy2Xsk7Hal/tD2tD06x5FkcAnRBUYmcxFCN3GxKiLhnqgsprF9aKG39IQ/xmCG IeJ3LuZpM+H1kdnLVJ1QUGG1T5vgNSB5Ew3QNpZfViO44cqOzl1XdYsWWz2y3kHnbvF+ BP7XilpNMeJvyYd2XJyO1tWg6xE9ywNZfjspXphADwJu29TtTO6w6orBUmsStpgnrwXJ +Tjl0ZhYRqir2ezRtw8+88KAHeCVGHZZ+zGK7tmqfgSZXlh+XQyXyjR41b7PHqIYJSYO eR4EVkuFlRRV8+9kHA3v3wqfSZwWEYnDyACTRyCmyNd2my42QzRX7h1fuDVvtEd8uEI+ Vx5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=ksgNqXYuq7eYRSzBEvTxTsDgmGrsQMBHFwlmQvvNPkE=; b=KnMl9rDlvD0R14g9lgBOBnSFJcq37tvtVgqoT2N5t5NzC+uPEFcOCs4UFSLBW85AUJ RjlzPQeqR5QkR0VGR1boaIV5jalsxm9mKZmYfjQVeShQ0KmoQINMFW/LSBSDbix/Tn4M m9nb8FrYhvQ7UTAW+OlIh5tAvzMy6ZU32JpS2ymYeW1hJW7BoCkOZrXzaBcwiYHdZaPB 4RITxikw3UsK3X0lmfRxD46G+T5UUBUtXRF7lvXLhGU9fl1COnLPraGySiFnpOpsF5Hk HWkF/u+n2ipe+f6EumROounfUcUCuPoqkmU+v3q9ZjYN6b/A6L3rIpaVp1qUMmb0o8NE CoVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GxvvJPDK; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g1si328360pgd.425.2019.05.30.11.21.27; Thu, 30 May 2019 11:21:27 -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=@linaro.org header.s=google header.b=GxvvJPDK; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726804AbfE3SU6 (ORCPT + 30 others); Thu, 30 May 2019 14:20:58 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:37146 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726563AbfE3SUz (ORCPT ); Thu, 30 May 2019 14:20:55 -0400 Received: by mail-lj1-f194.google.com with SMTP id h19so7014608ljj.4 for ; Thu, 30 May 2019 11:20:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ksgNqXYuq7eYRSzBEvTxTsDgmGrsQMBHFwlmQvvNPkE=; b=GxvvJPDKMnF2Hc4YuIT4oM82YGKw8EcaMBLqKbLD6yc2xy1Jwtfbwfeyw6rJBMcxpP /8u5FHFV1Sy3qbcFK5Wmocu4voUWgTi5jFxXDOxc+ngyfsy4lqfvlE7oHUr+L6qZH+eX ueuXJk6RvJCOHnaTzXvc+TlemnLRktzO0mQfYVU9yC3NpOn2npdhCibuxqDZHEu55r80 3ZvBQY3uUcxW/C9LniDNuWN/a3zoHFJ2gJI3hYCe/2Td//7W/9ecVrlJaVueUFNuH3iF nCFCRSOlgR596k+Vvo6qoZ/d/mlLBZ1dEtqBninfkrngveooWNd17Db8p+jox/7w0ASv o/Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ksgNqXYuq7eYRSzBEvTxTsDgmGrsQMBHFwlmQvvNPkE=; b=kmGB2EHT3toJ28yH793Iq2JZCHpL82yNdt7QI3r6pR0OnTIrmtH5OTkcsi8jT/umyn clwbwD7/m+bFTeO47YQQRHuuvADqw2hbF2478AiZ1fo5SdxH1Hsu6heeQ4jKczel5DCq Rrh59tND4fSCsF02p38S8HpM03yHjBKKmQY9uufMI8ZYVRzQ+MjavvwHwb/Yf+FHaqzb u/PYdWTe19+TlroZCO1YxgL8uOE85LnGcuzSMAZ3wE+RF70KbhLGWCw7cuyIZq8OF+n3 M/Hs5mofL97wzfXedUKLAQDIwchWRCDTEuK33cZZpT3ctaoUOGiSgJpK2dxdSeHka4BB 9fwA== X-Gm-Message-State: APjAAAUomEYhOoUbT8/z6jRKIXkoDglyopx8216cl4U9DQcSqueSjZgK Uf//pwGjuvJt9tKi1OOKSLLZng== X-Received: by 2002:a2e:88c7:: with SMTP id a7mr2713139ljk.118.1559240453797; Thu, 30 May 2019 11:20:53 -0700 (PDT) Received: from localhost.localdomain (59-201-94-178.pool.ukrtel.net. [178.94.201.59]) by smtp.gmail.com with ESMTPSA id v7sm388946lfe.11.2019.05.30.11.20.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 May 2019 11:20:53 -0700 (PDT) From: Ivan Khoronzhuk To: grygorii.strashko@ti.com, hawk@kernel.org, davem@davemloft.net Cc: ast@kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, xdp-newbies@vger.kernel.org, ilias.apalodimas@linaro.org, netdev@vger.kernel.org, daniel@iogearbox.net, jakub.kicinski@netronome.com, john.fastabend@gmail.com, Ivan Khoronzhuk Subject: [PATCH v2 net-next 3/7] net: ethernet: ti: cpsw: use cpsw as drv data Date: Thu, 30 May 2019 21:20:35 +0300 Message-Id: <20190530182039.4945-4-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190530182039.4945-1-ivan.khoronzhuk@linaro.org> References: <20190530182039.4945-1-ivan.khoronzhuk@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org No need to set ndev for drvdata when mainly cpsw reference is needed, so correct this legacy decision. Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/cpsw.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) -- 2.17.1 diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index 6d3f1f3f90cb..3430503e1053 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c @@ -2265,8 +2265,7 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data, static void cpsw_remove_dt(struct platform_device *pdev) { - struct net_device *ndev = platform_get_drvdata(pdev); - struct cpsw_common *cpsw = ndev_to_cpsw(ndev); + struct cpsw_common *cpsw = platform_get_drvdata(pdev); struct cpsw_platform_data *data = &cpsw->data; struct device_node *node = pdev->dev.of_node; struct device_node *slave_node; @@ -2477,7 +2476,7 @@ static int cpsw_probe(struct platform_device *pdev) goto clean_cpts; } - platform_set_drvdata(pdev, ndev); + platform_set_drvdata(pdev, cpsw); priv = netdev_priv(ndev); priv->cpsw = cpsw; priv->ndev = ndev; @@ -2570,9 +2569,8 @@ static int cpsw_probe(struct platform_device *pdev) static int cpsw_remove(struct platform_device *pdev) { - struct net_device *ndev = platform_get_drvdata(pdev); - struct cpsw_common *cpsw = ndev_to_cpsw(ndev); - int ret; + struct cpsw_common *cpsw = platform_get_drvdata(pdev); + int i, ret; ret = pm_runtime_get_sync(&pdev->dev); if (ret < 0) { @@ -2580,9 +2578,9 @@ static int cpsw_remove(struct platform_device *pdev) return ret; } - if (cpsw->data.dual_emac) - unregister_netdev(cpsw->slaves[1].ndev); - unregister_netdev(ndev); + for (i = 0; i < cpsw->data.slaves; i++) + if (cpsw->slaves[i].ndev) + unregister_netdev(cpsw->slaves[i].ndev); cpts_release(cpsw->cpts); cpdma_ctlr_destroy(cpsw->dma);