Received: by 10.192.165.156 with SMTP id m28csp769748imm; Thu, 19 Apr 2018 07:17:50 -0700 (PDT) X-Google-Smtp-Source: AIpwx49V9WlMFWfGj7gu2n1kiH4WIR7pOzTzq+DLVD8wiBgHydjVSqmHpSzG3kOue2bPsVj1qgif X-Received: by 10.101.96.47 with SMTP id p15mr5308061pgu.430.1524147470340; Thu, 19 Apr 2018 07:17:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524147470; cv=none; d=google.com; s=arc-20160816; b=KrjqCXWMrx4CWtmGED4VBKqVxEle9F5YWIx/V7I2wZ9T1X92IXafKvf8dD2j0gdZqW GOrIMuzACyiI17a0hXqZHim03xWGcN+H5h78RtHPzYyftla78QrmrxfemjNiHtZZHN3u Kqu+VKkjCjijCFfAdYIZjOKgPeJFWxiZ3KmEQyIC5+5j/MBks5mMgZxyQhFN4ic1bA1Y uzDsFNXpHsDCOjbB43aLqEFIrZeDHA/w62Tf758AXxyNCFEEPJVRSLICnMuctsPbW8Bv nzbsItFamMpvcGAFKf9zn7ZGlyPXnHs7ZlFr3jubQNw9BtcZl70zj0t0QoRKmrGt8PwY hq3A== 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=st0fK7pd+jFJTI/UDGRkgBFzuS6/Kc33l3GxTgxTbkw=; b=FiTNmWt0HPb+5fJ10WUlMzTzkb4pkqize6+oTkgsVJPpwnlXxR8Mn6CapROzB1bGbs Gn3SRHByXaaYQfAsvpn2E/rVIsUS53WbSo1jcM4sAD6sPZF6+47OZuvcUouuUaFHt6en vwFV/mf+TCxqoP21dNu6KlSiKCwySIhEXmhPatF+PcsucSyOclBWEHqoN7MQfzcX4PNU HjMPFNhApBLHYPMzXbIi2i+VZy+J9wCAm5Uk12lUcf90taMeZGU+o5tN4KrlnvsnWnHG fYvJENDh2lOz3LcS2Xn1Kqvz2Lk5h6FUewVb3cPe1PEsUMDmQn0MInhnkbfSBlZ1fBsO H0HA== 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 v2si3125610pgf.75.2018.04.19.07.17.36; Thu, 19 Apr 2018 07:17:50 -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 S1753705AbeDSOQa (ORCPT + 99 others); Thu, 19 Apr 2018 10:16:30 -0400 Received: from sauhun.de ([88.99.104.3]:45350 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753486AbeDSOHF (ORCPT ); Thu, 19 Apr 2018 10:07:05 -0400 Received: from localhost (unknown [145.253.130.2]) by pokefinder.org (Postfix) with ESMTPSA id 0A9A93139CF; Thu, 19 Apr 2018 16:07:04 +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 , netdev@vger.kernel.org Subject: [PATCH 36/61] net: ethernet: wiznet: simplify getting .drvdata Date: Thu, 19 Apr 2018 16:06:06 +0200 Message-Id: <20180419140641.27926-37-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/wiznet/w5300.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/wiznet/w5300.c b/drivers/net/ethernet/wiznet/w5300.c index 56ae573001e8..692fc71d904d 100644 --- a/drivers/net/ethernet/wiznet/w5300.c +++ b/drivers/net/ethernet/wiznet/w5300.c @@ -661,8 +661,7 @@ static int w5300_remove(struct platform_device *pdev) #ifdef CONFIG_PM_SLEEP static int w5300_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 w5300_priv *priv = netdev_priv(ndev); if (netif_running(ndev)) { @@ -676,8 +675,7 @@ static int w5300_suspend(struct device *dev) static int w5300_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 w5300_priv *priv = netdev_priv(ndev); if (!netif_running(ndev)) { -- 2.11.0