Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp1533883img; Tue, 19 Mar 2019 09:37:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqxtKQpTgQZU1heTIvAlbSFAdjCUk0pe9FJDP5vZwciOwNrUcfXn0UiXuaxQOlhjfkVZr1e+ X-Received: by 2002:a62:fb04:: with SMTP id x4mr2826897pfm.83.1553013468134; Tue, 19 Mar 2019 09:37:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553013468; cv=none; d=google.com; s=arc-20160816; b=0ckIqhx5Sp0pzrW5Y0SLaovMANGuHtU3O151ITmdncOQ6p25NoR2Y3ZxkTOe2oZV4P svnIt07dqX1BquTOXtfnQ/qf95u8S85/BBdOuSleYf8osHi4Qfn4OYoV4ygivo8zINLM nnx6QWHHrVJHDfuuykvGQ0pkO+ZgQog8iq7iZzIKpCdOV/1cn2SdiSP/bMEs51JbcV5m nbIKXLoLtX1q9Zns5uQcyPyF0x1rPu4lI6/utk2A2WBT+2Zm/Baf4SKh4jMIgfpo7ts4 7P7GsztVUTrWrm4VWEc+E1FI4fNStgBczTS9YKFqPFBXhVX+C4uS8wyWykwVV22YWsoI b8cA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=t65f9A5OuTR5v1ik/924mZR+MJsQg4mv9MXC6hP6iTo=; b=nPoWZfyBGEiVISTxl4+V+yoCWI1BSI9OfgiR9A+wRXjThaZ442GF/hA4DnyUk4Xx3F 3lgJiLhLD7o7rCT84Dt9NMauMCLIci6gyx70PwucPZXnSvQUhcnnQ5c0HU000y+f//g7 EG42j/sdGgiY4e82SdIN5+Z7tAcGGAbilM58nhIeQmtsQpbAgm2OsyBM3jP9DE+g6keY /k+xs7fVsQs475CwpOFyCwGfI/JiAobvYeYoVnmY7Ql6vAeXXeTv1SKLjFutQ8EZSayW 2MrfBnfwplN0/+i3cw/YsKk58x5u5MkpGttfbX/kT67qwaOLzwzmdnArXot5PSb745dK zVCQ== 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 y3si12061046plt.68.2019.03.19.09.37.33; Tue, 19 Mar 2019 09:37:48 -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 S1727899AbfCSQgl (ORCPT + 99 others); Tue, 19 Mar 2019 12:36:41 -0400 Received: from sauhun.de ([88.99.104.3]:46128 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727804AbfCSQgi (ORCPT ); Tue, 19 Mar 2019 12:36:38 -0400 Received: from localhost (p5486CE21.dip0.t-ipconnect.de [84.134.206.33]) by pokefinder.org (Postfix) with ESMTPSA id A54714A134C; Tue, 19 Mar 2019 17:36:36 +0100 (CET) From: Wolfram Sang To: linux-kernel@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, Wolfram Sang , Zhang Rui , Eduardo Valentin , Daniel Lezcano , Maxime Coquelin , Alexandre Torgue , linux-pm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/1] thermal: stm32: simplify getting .driver_data Date: Tue, 19 Mar 2019 17:36:35 +0100 Message-Id: <20190319163635.30891-1-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.11.0 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/st/stm_thermal.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/st/stm_thermal.c b/drivers/thermal/st/stm_thermal.c index bbd73c5a4a4e..cf9ddc52f30e 100644 --- a/drivers/thermal/st/stm_thermal.c +++ b/drivers/thermal/st/stm_thermal.c @@ -570,8 +570,7 @@ static int stm_thermal_prepare(struct stm_thermal_sensor *sensor) static int stm_thermal_suspend(struct device *dev) { int ret; - struct platform_device *pdev = to_platform_device(dev); - struct stm_thermal_sensor *sensor = platform_get_drvdata(pdev); + struct stm_thermal_sensor *sensor = dev_get_drvdata(dev); ret = stm_thermal_sensor_off(sensor); if (ret) @@ -585,8 +584,7 @@ static int stm_thermal_suspend(struct device *dev) static int stm_thermal_resume(struct device *dev) { int ret; - struct platform_device *pdev = to_platform_device(dev); - struct stm_thermal_sensor *sensor = platform_get_drvdata(pdev); + struct stm_thermal_sensor *sensor = dev_get_drvdata(dev); ret = stm_thermal_prepare(sensor); if (ret) -- 2.11.0