Received: by 10.192.165.156 with SMTP id m28csp772077imm; Thu, 19 Apr 2018 07:20:01 -0700 (PDT) X-Google-Smtp-Source: AIpwx481tsLgT1npqo6Pmf+aUaqf8CsiIWjZcR6iNdddw9FVBPDK+RGda3dFdSRY/HkPgDkfYlts X-Received: by 10.99.131.72 with SMTP id h69mr5220630pge.378.1524147601670; Thu, 19 Apr 2018 07:20:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524147601; cv=none; d=google.com; s=arc-20160816; b=iGPQDjOey9s2O49/EnM/L/BGck8sQophXpn53bZ54hlfRnc/ZCgGQZhpGa6z7CbzT6 0Mup+UuAoHN7bLfI6jQ6kqNShmjKPpXs5yd1/q4SROKTJWIm2wWruhJgk+vVHIXfcFFu o5yM4lLGvqfe6opgQG5m/QUrloS/r2ya3FE+Fy5Tn66imwrYobasXGq5BsRUlMr3KbTH acBJuu2xxwSvf28qyYsfzK/X9sQZwTE3mkF6Wxe9o5CeeV65zlP28rdOkcFYLLgdy0MD Ox7wbWiTyQjMhsjw+3+EFifDk/fInGBNLR444x5fVnAx0WX7YmiHoYsy5J5+q4S7S2Vn dW3A== 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=ek7C3m4tcgpY8LJm4OEPoP/6WAi3TESbJ/VbmNBbccQ=; b=JOak2TVHXMz4DjRD9eldVSCsHUVl02Qr772cHPPP/WZxWZe0DUqG6YxzrQVgcDRHHK 9MpG3r/qOq/f357pUbON07ddIKbcSoU4WIOQtRQ4evrE9HlJNmyVGNcrOZJfggnkTDH/ hE5YjdpCdUm3IMMJf0Z71PnCa/prMwn09/3FPNtfqT+UsSNRDAgAnaMH595nsJPlzqTG t2aBSG59cKUlaQnS4jhodGv7DlUITJqqp2SRSrL2blT8YwQgx/e6MX0Hxkr0le/XPx1Y GhbxRfGBtrKK3FBEdHUB4t1LpKv5gWEB8jzyYcHF78lO1EcPYFPj/9blYGP5QvmZXlO9 n4xA== 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 a4si3094143pgd.348.2018.04.19.07.19.47; Thu, 19 Apr 2018 07:20:01 -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 S1753762AbeDSOSi (ORCPT + 99 others); Thu, 19 Apr 2018 10:18:38 -0400 Received: from sauhun.de ([88.99.104.3]:45270 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753427AbeDSOHD (ORCPT ); Thu, 19 Apr 2018 10:07:03 -0400 Received: from localhost (unknown [145.253.130.2]) by pokefinder.org (Postfix) with ESMTPSA id CEE4C3139C3; Thu, 19 Apr 2018 16:07:01 +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 , Andrew Lunn , Vivien Didelot , Florian Fainelli , netdev@vger.kernel.org Subject: [PATCH 31/61] net: dsa: simplify getting .drvdata Date: Thu, 19 Apr 2018 16:06:01 +0200 Message-Id: <20180419140641.27926-32-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/dsa/bcm_sf2.c | 6 ++---- drivers/net/dsa/qca8k.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c index 0378eded31f2..a61b937d1a37 100644 --- a/drivers/net/dsa/bcm_sf2.c +++ b/drivers/net/dsa/bcm_sf2.c @@ -1148,16 +1148,14 @@ static void bcm_sf2_sw_shutdown(struct platform_device *pdev) #ifdef CONFIG_PM_SLEEP static int bcm_sf2_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct bcm_sf2_priv *priv = platform_get_drvdata(pdev); + struct bcm_sf2_priv *priv = dev_get_drvdata(dev); return dsa_switch_suspend(priv->dev->ds); } static int bcm_sf2_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct bcm_sf2_priv *priv = platform_get_drvdata(pdev); + struct bcm_sf2_priv *priv = dev_get_drvdata(dev); return dsa_switch_resume(priv->dev->ds); } diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c index 600d5ad1fbde..9f503e5db88a 100644 --- a/drivers/net/dsa/qca8k.c +++ b/drivers/net/dsa/qca8k.c @@ -910,8 +910,7 @@ qca8k_set_pm(struct qca8k_priv *priv, int enable) static int qca8k_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct qca8k_priv *priv = platform_get_drvdata(pdev); + struct qca8k_priv *priv = dev_get_drvdata(dev); qca8k_set_pm(priv, 0); @@ -920,8 +919,7 @@ static int qca8k_suspend(struct device *dev) static int qca8k_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct qca8k_priv *priv = platform_get_drvdata(pdev); + struct qca8k_priv *priv = dev_get_drvdata(dev); qca8k_set_pm(priv, 1); -- 2.11.0