Received: by 10.192.165.156 with SMTP id m28csp762451imm; Thu, 19 Apr 2018 07:11:29 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/dQxdUYqzTVBC2nTusFM6RrkGnL0ZDNrlkqI2GopzgjRzbfKi/6dY4h9L1jRJWtqsasUpf X-Received: by 2002:a17:902:70c7:: with SMTP id l7-v6mr6162119plt.165.1524147089886; Thu, 19 Apr 2018 07:11:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524147089; cv=none; d=google.com; s=arc-20160816; b=spsJVvFj8suBPK9cCaLHtA+u7Qr7/D9qJvlXeq8mk1wQ9/b9li2I8t6NcyD3KFEIVw r24xMQNEIuM+DXbl9SU34rv1BV5jW9BGxTdB3C8Oi3Bo7SQYRzCRTR5ugYS1+FFf5t9/ hYqdjKdq5MVhdXIHKNzezVqtgnuTpiPDJsnLSEqzqR+obwqSEr5Do5xJxk2ffmf1bjo2 ppfJaoGeXnm3VKtYH/PQ/XoI5878bcPnYI+IiPfzCcFqFcGUqPey8GQBmcL3/tOJQ0BB 80DtGs4IXnkQzOC3vxPnvgQ0qsjHlNrOaCB3rfHx0KRS4en77qRyBzKwb+D1GmkfCLr9 CaOQ== 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=WE44tU4qP2Ene3Q7WOPAsiUjYnYMmyIGx/GrJ3/wHDA=; b=MvgGVFVIJCvbwGryDpNn1HRIkszrlmBNa619vM3uHz8ImS9RKW9cTleXg8xGhhixUA i/EHrckFGnubjbya/cyjsuW7LKTHmbTe87qOkDHz5sOVVqsPSEqBNtAdZNHN6iC1tg5p D9qISyaU1gibnamFrXWj6y/hW2pmHUNDgmeE+YxCB8l+MBXuX3uWELVlMeMHQJpuOHQb FdTaHd4a3MG/TZ2vrtCLs2AyUBoio72myySl5l+4wEdGrwbK5ByDmvxJbYrNEIw/fill fIPU6RWiYQcmucY+Ty7mpkG5iJXRQxz4rgrOfECLafjRR3BXOoRvINXD2pwL7I8lny7e d5Tw== 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 w20-v6si3565242plp.7.2018.04.19.07.11.15; Thu, 19 Apr 2018 07:11:29 -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 S1753702AbeDSOIS (ORCPT + 99 others); Thu, 19 Apr 2018 10:08:18 -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 S1753572AbeDSOHQ (ORCPT ); Thu, 19 Apr 2018 10:07:16 -0400 Received: from localhost (unknown [145.253.130.2]) by pokefinder.org (Postfix) with ESMTPSA id 844503139DF; Thu, 19 Apr 2018 16:07:15 +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 , "David S. Miller" , netdev@vger.kernel.org Subject: [PATCH 60/61] net: dsa: simplify getting .drvdata Date: Thu, 19 Apr 2018 16:06:30 +0200 Message-Id: <20180419140641.27926-61-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. net/dsa/legacy.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/net/dsa/legacy.c b/net/dsa/legacy.c index 42a7b85b84e1..f8d6b212328f 100644 --- a/net/dsa/legacy.c +++ b/net/dsa/legacy.c @@ -687,8 +687,7 @@ static void dsa_shutdown(struct platform_device *pdev) #ifdef CONFIG_PM_SLEEP static int dsa_suspend(struct device *d) { - struct platform_device *pdev = to_platform_device(d); - struct dsa_switch_tree *dst = platform_get_drvdata(pdev); + struct dsa_switch_tree *dst = dev_get_drvdata(d); int i, ret = 0; for (i = 0; i < dst->pd->nr_chips; i++) { @@ -703,8 +702,7 @@ static int dsa_suspend(struct device *d) static int dsa_resume(struct device *d) { - struct platform_device *pdev = to_platform_device(d); - struct dsa_switch_tree *dst = platform_get_drvdata(pdev); + struct dsa_switch_tree *dst = dev_get_drvdata(d); int i, ret = 0; for (i = 0; i < dst->pd->nr_chips; i++) { -- 2.11.0