Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp1491537ima; Sun, 21 Oct 2018 13:02:46 -0700 (PDT) X-Google-Smtp-Source: ACcGV60G1qzv1JN/0KB3YABU4N/IWJH7YcAn9N+mJkHe1x1s96zjgWVk7CxPr6IR2w2boDBG5AWC X-Received: by 2002:a63:c642:: with SMTP id x2-v6mr39836165pgg.16.1540152166371; Sun, 21 Oct 2018 13:02:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540152166; cv=none; d=google.com; s=arc-20160816; b=Oux/TDdg1UoZ8SmsJZsZH1Bgnq1EzyDZKAHiaMrDXkamvu8fOUULgR3ewtPmxgbrga S3hbBc8k0O6I3xHcEdRsX81HH5ezArQkMwXPxDsMKdo1URl5G/6M30svwwPHlliTE57T FfJa4Vdk6HJKYzMCgLD8vIpyXdUeUyoWTyHGINg3/AfsNU8kKsp6CaF5gNv2c5tl7VGm sPmT775UVaHnD2KfTrX5p3IHxl9CAvQmCd34kv6qa/Nqx5mXGpQtERNx0KreB9tW0Tge zv/imvjYdooIWaGQp9dblmOSU29dkXAzVv7dSfvyQxUB+/UamQ2FysYAjk6tVNCiMNs3 Xozw== 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=49Fbzpvl6e90a5J11Bg4k55dYKgHKXU6tQEd6okzBgA=; b=rIqkRbkP9BdDaFqXP4iqBmi5i03z2cGRXy7Fwd4HsPBnE5thmN+/6beSe82kZyP+G6 88TJvd5TagcFJzQYl5LzXNHiTjnunW9CueW4UvvM4g9rYDoLM2LOQFmpVdDrltPDhTU5 Prv+gEN9TTI85S7H9jZa3dSLnJ87ycs67lhl95yudSWskMoZlAe6sIoIdVY3xD7it241 jouvHgEMGjn8OsVmOYJlQwXEHr8p6CdTe8sMYQa0vcrwhHhST4uENRm33t7HE71Dkjm2 Jy3R7LA1aoK91uzhuCgcnlMATcTHiSxEMVd3dApHT2bhNDWYWHP9hPXZDYrqZuGZy+B9 d9mQ== 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 p16-v6si32116341pgb.404.2018.10.21.13.02.31; Sun, 21 Oct 2018 13:02:46 -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 S1728756AbeJVEQ1 (ORCPT + 99 others); Mon, 22 Oct 2018 00:16:27 -0400 Received: from sauhun.de ([88.99.104.3]:45972 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728699AbeJVEQ0 (ORCPT ); Mon, 22 Oct 2018 00:16:26 -0400 Received: from localhost (unknown [90.200.225.72]) by pokefinder.org (Postfix) with ESMTPSA id 2DB932E35DD; Sun, 21 Oct 2018 22:00:58 +0200 (CEST) From: Wolfram Sang To: linux-kernel@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, Wolfram Sang , Zhang Rui , Eduardo Valentin , Daniel Lezcano , linux-pm@vger.kernel.org Subject: [PATCH 4/5] thermal: st: st_thermal: simplify getting .driver_data Date: Sun, 21 Oct 2018 22:00:51 +0200 Message-Id: <20181021200053.2194-5-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/st/st_thermal.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/st/st_thermal.c b/drivers/thermal/st/st_thermal.c index be637e6b01d2..b2bbdf6eb02b 100644 --- a/drivers/thermal/st/st_thermal.c +++ b/drivers/thermal/st/st_thermal.c @@ -277,8 +277,7 @@ EXPORT_SYMBOL_GPL(st_thermal_unregister); #ifdef CONFIG_PM_SLEEP static int st_thermal_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct st_thermal_sensor *sensor = platform_get_drvdata(pdev); + struct st_thermal_sensor *sensor = dev_get_drvdata(dev); return st_thermal_sensor_off(sensor); } @@ -286,8 +285,7 @@ static int st_thermal_suspend(struct device *dev) static int st_thermal_resume(struct device *dev) { int ret; - struct platform_device *pdev = to_platform_device(dev); - struct st_thermal_sensor *sensor = platform_get_drvdata(pdev); + struct st_thermal_sensor *sensor = dev_get_drvdata(dev); ret = st_thermal_sensor_on(sensor); if (ret) -- 2.19.0