Received: by 10.192.165.156 with SMTP id m28csp773044imm; Thu, 19 Apr 2018 07:20:53 -0700 (PDT) X-Google-Smtp-Source: AIpwx49NAKmgPp3DABPznMShb3BRAU9mfdqrjklbmw4IpjggB32J2HU7GOvH1eA/QBpGK2pgxmFn X-Received: by 10.98.102.221 with SMTP id s90mr2558234pfj.123.1524147653564; Thu, 19 Apr 2018 07:20:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524147653; cv=none; d=google.com; s=arc-20160816; b=0gMe+5FJbEja6AGHkdAeO/xBw27y+SLL085vbK1jb5J0hpioLijSXISsz0gjawhOTQ 1/q8pnHUtdMi4SGl9qIY0SJlLhABm85IeuO7YOA7iUa2QNVJUUXw31dhKuyYzWz2sQFM suznMkOkQYKgfJcW8I/bFyX7YTvxTIy2xit6izjTAm7Hce7idtdJ2/y1+/WANyHwPuuC ZTHhM0tHol9BKu0NFcMuu76qbjP9qVjk5yT1ziRhjFlezyy1+l50wcGnVA72ZVrP64xZ LtGvlH3xAuAomMV/ZfU36I3DWdgMEfCqfS9hlBCxEYeMXld+G8hdKC3WYekCS7wuytIW u6/A== 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=ARWSMDg/xqjbg77skNs8v8H0uCn27+FvLBzOJz3FuOo=; b=sDn2m1rZ9n8kBoPnOLZUzsnqV0jUlrJe+HiG8zp3gkKhb5Qb8OuNnTpOtpPVae26tE M/Te3ZK4sYLc5yE0ow2F5IDtvLBP1RbNUSYLRmco36VZZZG413hyTnhJJFC8dAxwDpJC Y8VhuD+hksByJz0+bdn27bTWpVcMw42/Q3FMtN3HlKoI1ZgdWbbDVAkwcsYL9eWbuIJG 0ugv+HHTY+kqQPD8M25sxe7FW9AGN/19bMAf8Qb40hLP35xIlgtWD0n6mf5j8fP2Ar2m 6TyugXOj05uiZNlrYyK9AGiihPFZ0WIz1/fu8xr8czvXIjoa32AnM0d0EGDVhAohoDHW 5b7w== 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 q4-v6si3691201plb.312.2018.04.19.07.20.39; Thu, 19 Apr 2018 07:20:53 -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 S1753712AbeDSOSR (ORCPT + 99 others); Thu, 19 Apr 2018 10:18:17 -0400 Received: from sauhun.de ([88.99.104.3]:45272 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753444AbeDSOHD (ORCPT ); Thu, 19 Apr 2018 10:07:03 -0400 Received: from localhost (unknown [145.253.130.2]) by pokefinder.org (Postfix) with ESMTPSA id 48D203139CA; Thu, 19 Apr 2018 16:07:02 +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 , Nicolas Ferre , netdev@vger.kernel.org Subject: [PATCH 32/61] net: ethernet: cadence: simplify getting .drvdata Date: Thu, 19 Apr 2018 16:06:02 +0200 Message-Id: <20180419140641.27926-33-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/cadence/macb_main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index b4c9268100bb..136bfd5d0be9 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -4056,8 +4056,7 @@ static int macb_remove(struct platform_device *pdev) static int __maybe_unused macb_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct net_device *netdev = platform_get_drvdata(pdev); + struct net_device *netdev = dev_get_drvdata(dev); struct macb *bp = netdev_priv(netdev); netif_carrier_off(netdev); @@ -4079,8 +4078,7 @@ static int __maybe_unused macb_suspend(struct device *dev) static int __maybe_unused macb_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct net_device *netdev = platform_get_drvdata(pdev); + struct net_device *netdev = dev_get_drvdata(dev); struct macb *bp = netdev_priv(netdev); if (bp->wol & MACB_WOL_ENABLED) { -- 2.11.0