Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp1491429ima; Sun, 21 Oct 2018 13:02:39 -0700 (PDT) X-Google-Smtp-Source: ACcGV61igePtvgKf2DwjGGt97+38wwr16ofVvLsf5h2fglhkPq/Gi8UkZnx4UB8Oqz7VcPxHxTOg X-Received: by 2002:a63:27c1:: with SMTP id n184-v6mr40315353pgn.334.1540152158954; Sun, 21 Oct 2018 13:02:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540152158; cv=none; d=google.com; s=arc-20160816; b=wZeTo9YJHlEKHtoWIMMzn56HRBq4zO5aK9GgtoTybUcUCNQAQsrT5AyE5z2Yr0CrHQ jeUpPIsubdRJb0s13BBBmaIEA0q6mTrV0vfthl8PCjZKIadSMYN//YkLSYS8+g8yPemw 4cGPMsMZorabq9P4VREgQK3QZXSdsG3gUcG29WwbjSGahq+LNSyrUmx25nUdBbTHlNH2 qNcohobZ2IwAfjrTkCWwGQ5BHtRiBoFUgtlwB0qGA+1vnApT2IE/DndwwWVFTEZ2p5QZ Azm61Bosp3kWOsB9St2SbamZQ2HhlRgY3oTXAw8Q4EPfO0x7BccOVecqqS9yrOoUtAvY dI4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Yg/REjZZt/2CwysRyEOh8ZMo8ereNdPskbtrcx3vJ9w=; b=FDDwmX0egOQWwz6X1UkLNagY0+WSiP5OrIjO53xW756yjBUKat4DpVqSi1glegt9ax 0s5gYwbDf5uWS3+hRUEC8HHvKNVr5pmHLitHo51+4H4VXk6EjQbwZLcR7PZd5w8Ayo4q y3i95ldCQHq1EI11CoQMFjQUOHv+ltQ/2Df4Y/SBLAseDmlioAprx85M0whMZmd1IV0h 2wAQB5AjUi+lkEQw12pJwNBCmPDA0rwP16tgAGHXPaUNJsyj0/9BkfGGPoywJeLBtBKN uU7MfO1rFTWwUbzaoRlQ8b1iQ8GxS4LEjy2xqRa24YZ3R0u0JHsQxCwf+hRw8zhijPUD VV9Q== 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 p5-v6si18510512plo.363.2018.10.21.13.02.24; Sun, 21 Oct 2018 13:02:38 -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 S1728872AbeJVERH (ORCPT + 99 others); Mon, 22 Oct 2018 00:17:07 -0400 Received: from sauhun.de ([88.99.104.3]:45990 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728747AbeJVEQ1 (ORCPT ); Mon, 22 Oct 2018 00:16:27 -0400 Received: from localhost (unknown [90.200.225.72]) by pokefinder.org (Postfix) with ESMTPSA id 1C9CE2E35E0; Sun, 21 Oct 2018 22:00:59 +0200 (CEST) From: Wolfram Sang To: linux-kernel@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, Wolfram Sang , Jun Nie , Shawn Guo , Zhang Rui , Eduardo Valentin , Daniel Lezcano , linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org Subject: [PATCH 5/5] thermal: zx2967_thermal: simplify getting .driver_data Date: Sun, 21 Oct 2018 22:00:52 +0200 Message-Id: <20181021200053.2194-6-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181021200053.2194-1-wsa+renesas@sang-engineering.com> References: <20181021200053.2194-1-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We should get 'driver_data' 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. drivers/thermal/zx2967_thermal.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/zx2967_thermal.c b/drivers/thermal/zx2967_thermal.c index 6acce0bce7c0..145ebf371598 100644 --- a/drivers/thermal/zx2967_thermal.c +++ b/drivers/thermal/zx2967_thermal.c @@ -207,8 +207,7 @@ MODULE_DEVICE_TABLE(of, zx2967_thermal_id_table); #ifdef CONFIG_PM_SLEEP static int zx2967_thermal_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct zx2967_thermal_priv *priv = platform_get_drvdata(pdev); + struct zx2967_thermal_priv *priv = dev_get_drvdata(dev); if (priv && priv->clk_topcrm) clk_disable_unprepare(priv->clk_topcrm); @@ -221,8 +220,7 @@ static int zx2967_thermal_suspend(struct device *dev) static int zx2967_thermal_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct zx2967_thermal_priv *priv = platform_get_drvdata(pdev); + struct zx2967_thermal_priv *priv = dev_get_drvdata(dev); int error; error = clk_prepare_enable(priv->clk_topcrm); -- 2.19.0