Received: by 10.192.165.156 with SMTP id m28csp770296imm; Thu, 19 Apr 2018 07:18:19 -0700 (PDT) X-Google-Smtp-Source: AIpwx485BiJnpFiRZm564PQrdFb+BEV1zBduwx3oa48QLHQrkRByM2zIohk25r7OcKEOIwjWsnye X-Received: by 2002:a17:902:ab83:: with SMTP id f3-v6mr6255268plr.344.1524147499071; Thu, 19 Apr 2018 07:18:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524147498; cv=none; d=google.com; s=arc-20160816; b=vRyO6Eykdb/zxpRNsixhCtq0Fdxj0nrC2mc5TUHCzaB3ywgXd7et8AElgv9qg5dBUG UBGTw8GLIMuuADFBRbHpiBVTursnybe1F/45thNd0IsNI5b8C9d9gKA+DKfPtW9ZO1lQ YEAmDdzufPe4JnMqmT0MvzHVGmXo332VvXD9cBJxBDdg0j/721QfS7PdPtYSlwD11vCF TFheZEZWVNmvLgnPEb5QhD23jdoglvNqN4uqQ93kjnbuDFXKR9gx4xbEXShXo4sMtRnX pHvO8n21V3CKQQXfG5F2Etq1OAW08WFTRRXLtfBh6jFgSNibRbS93Mc4cg61TNQpb4Pi wpiQ== 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:arc-authentication-results; bh=KcMy3P81Af1OO4BJ0Zad0e82/viQjKBnux8G41jk4Qw=; b=UOS5IRMcRqo8lsYTyZvIasGRva3DhL6vF86qtvei+A6sEhWRyzve4G0Jig2+o1WTXM dGYs0xlXWo3EYJeqZRkDCeZ4duB4b7jbSrixyOTSOkGWPXjdyNYTGkwUFlNdNxZtuN/D JO9FwnaMhh1TAEVqgPzP7ltzpf2RP5kRo5GMNBbahIdwhcMQNfLkzMwe9sxqjNXfrtgS 8GMzzGUnvIXWDQXcm1BaGMWNjqcKfD424+OC9nEBOVMh2NkKwbZQTHwafXLIEYRcHWjY nhXdAwin+5ISXSh3yxStIbSBP3hzzzgMr3da2Z2s+ONIK8sHeRi+SYV9PtCWTa7F3UsZ yLdQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z34-v6si4149275plh.15.2018.04.19.07.18.05; Thu, 19 Apr 2018 07:18:18 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753755AbeDSORC (ORCPT + 99 others); Thu, 19 Apr 2018 10:17:02 -0400 Received: from sauhun.de ([88.99.104.3]:45448 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753475AbeDSOHF (ORCPT ); Thu, 19 Apr 2018 10:07:05 -0400 Received: from localhost (unknown [145.253.130.2]) by pokefinder.org (Postfix) with ESMTPSA id 93F673139CE; Thu, 19 Apr 2018 16:07:03 +0200 (CEST) From: Wolfram Sang To: linux-kernel@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, kernel-janitors@vger.kernel.org, Wolfram Sang , Grygorii Strashko , linux-omap@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH 35/61] net: ethernet: ti: simplify getting .drvdata Date: Thu, 19 Apr 2018 16:06:05 +0200 Message-Id: <20180419140641.27926-36-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180419140641.27926-1-wsa+renesas@sang-engineering.com> References: <20180419140641.27926-1-wsa+renesas@sang-engineering.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We should get drvdata from struct device directly. Going via platform_device is an unneeded step back and forth. Signed-off-by: Wolfram Sang --- Build tested only. buildbot is happy. Please apply individually. drivers/net/ethernet/ti/cpsw.c | 6 ++---- drivers/net/ethernet/ti/davinci_emac.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index 30371274409d..ef0c88e71a71 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c @@ -3300,8 +3300,7 @@ static int cpsw_remove(struct platform_device *pdev) #ifdef CONFIG_PM_SLEEP static int cpsw_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct net_device *ndev = platform_get_drvdata(pdev); + struct net_device *ndev = dev_get_drvdata(dev); struct cpsw_common *cpsw = ndev_to_cpsw(ndev); if (cpsw->data.dual_emac) { @@ -3324,8 +3323,7 @@ static int cpsw_suspend(struct device *dev) static int cpsw_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct net_device *ndev = platform_get_drvdata(pdev); + struct net_device *ndev = dev_get_drvdata(dev); struct cpsw_common *cpsw = ndev_to_cpsw(ndev); /* Select default pin state */ diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c index abceea802ea1..ef223613114d 100644 --- a/drivers/net/ethernet/ti/davinci_emac.c +++ b/drivers/net/ethernet/ti/davinci_emac.c @@ -1985,8 +1985,7 @@ static int davinci_emac_remove(struct platform_device *pdev) static int davinci_emac_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct net_device *ndev = platform_get_drvdata(pdev); + struct net_device *ndev = dev_get_drvdata(dev); if (netif_running(ndev)) emac_dev_stop(ndev); @@ -1996,8 +1995,7 @@ static int davinci_emac_suspend(struct device *dev) static int davinci_emac_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct net_device *ndev = platform_get_drvdata(pdev); + struct net_device *ndev = dev_get_drvdata(dev); if (netif_running(ndev)) emac_dev_open(ndev); -- 2.11.0