Received: by 10.192.165.156 with SMTP id m28csp767085imm; Thu, 19 Apr 2018 07:15:36 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/I/v4ZBnPFEBFJxr6Vb5nQwpdOCbe4NZ3AXXGStIuju/iarBWpdp8bpMgyjCeQDVB2/UGz X-Received: by 2002:a17:902:b402:: with SMTP id x2-v6mr6159497plr.167.1524147336583; Thu, 19 Apr 2018 07:15:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524147336; cv=none; d=google.com; s=arc-20160816; b=uJqLfd3ReTC7Nxe/tzV50mdTVBvz05wBkpmlonVa46YnaYYAGUaUD4EXM4ftGsIDk5 YCGONvL2eIRmtacct9G+SZ36x+lxgbUNNY9Bj0/KnNsMXHb73vAQdwVKgyT5WJckKo7b Py7eGArxd4FPDTxYj1zaDfC7fGr8cQUsaf6tMOi7IhoI3ZIwUK7Ef6H+pJesXTw9Hh2I 1SwmdYrx/T0kY8y61d7MpOZ5MJBXomsPRMP7qJ/SEUVA4Rl2uu3w8h2/6fWouV8zpcbN LIZegXbt1uRABZjiiQFyMRwKbLohqBc4Ibb1NZt3xsMjPzhweYsXCCNXT0p8v5XWLldG mu+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=LMqCT3ZuGwKe04xIkDpQmyCoqRXtba19AQY9Ke6v3bc=; b=C7iLak905PLCX5hg5GX4HvCv6hq2zww8ILeYzNbDvXDcqlnzhckLR4i6HCXNOrWGSP DsQqeqgTjkic1tDILARNwu9DJrJ7ZBEnetqmAACXuo0vvdCl2kp1ZHh5bq8yqdX7p5II ZmLe1pcFKUPg9Zk12KMmoQorP4Dbbej5I1cyh6Imc+EwOXUsPNV00VwlAHYkMRmInp/L bMj0SEYagzJIihJnugtrUDqjuGoq7GIgV5xYNQ1R0qi44Ca4xBhC+HN8AStSYk07CXzX XtODla5+sPzzWV+tw3l+z3ewDkgRT4UG7FR3aQ5/cjb7dYmryz4eO5exqqP1wf2UO/2e J7eQ== 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-v6si3577631plp.7.2018.04.19.07.15.22; Thu, 19 Apr 2018 07:15:36 -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 S1753595AbeDSOOR (ORCPT + 99 others); Thu, 19 Apr 2018 10:14:17 -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 S1753524AbeDSOHI (ORCPT ); Thu, 19 Apr 2018 10:07:08 -0400 Received: from localhost (unknown [145.253.130.2]) by pokefinder.org (Postfix) with ESMTPSA id D527F3139D2; Thu, 19 Apr 2018 16:07:06 +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 , Richard Cochran , netdev@vger.kernel.org Subject: [PATCH 42/61] ptp: simplify getting .drvdata Date: Thu, 19 Apr 2018 16:06:12 +0200 Message-Id: <20180419140641.27926-43-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/ptp/ptp_dte.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/ptp/ptp_dte.c b/drivers/ptp/ptp_dte.c index 6edd3b9c7f01..5481a27d4fec 100644 --- a/drivers/ptp/ptp_dte.c +++ b/drivers/ptp/ptp_dte.c @@ -287,8 +287,7 @@ static int ptp_dte_remove(struct platform_device *pdev) #ifdef CONFIG_PM_SLEEP static int ptp_dte_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct ptp_dte *ptp_dte = platform_get_drvdata(pdev); + struct ptp_dte *ptp_dte = dev_get_drvdata(dev); u8 i; for (i = 0; i < DTE_NUM_REGS_TO_RESTORE; i++) { @@ -304,8 +303,7 @@ static int ptp_dte_suspend(struct device *dev) static int ptp_dte_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct ptp_dte *ptp_dte = platform_get_drvdata(pdev); + struct ptp_dte *ptp_dte = dev_get_drvdata(dev); u8 i; for (i = 0; i < DTE_NUM_REGS_TO_RESTORE; i++) { -- 2.11.0