Received: by 10.192.165.156 with SMTP id m28csp764251imm; Thu, 19 Apr 2018 07:13:08 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+Pmpdr+LYEp/IczRMyRqMwrg998WAbEVbe0ezLimvqNI+Cbd1RkyoOi7YGTLkKcii6qyT+ X-Received: by 10.98.205.69 with SMTP id o66mr6070374pfg.34.1524147188819; Thu, 19 Apr 2018 07:13:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524147188; cv=none; d=google.com; s=arc-20160816; b=e6tDYTesRSKOC3eX+Bwdj8upaSAWV2wJ5CDidJ5io0FqkO8s0rFXjSYfYTI2wXkvp/ qmqDI+3Eq6iy8/p6oNRMZk1xIl5wxvjXDiKojCKEPLOb4iqeQ0mQNRvdta+RFOMPYe7H jpIP9ZcnKrU4m4aGbBp3e7euqBV9YaGIiqh5l+1IKGm++Fj1MIky4kOfUdjhF8q4sHQn Uv+YAKn5l5kWJ7bqEC5vPoozc17zRV1nY3lTCzfX5NE8KEce1NE6r8AqgdOKLZd/Vh8+ gVf/LzHBgXDG+q/kkbXFM3fB0aAYxC9iO7Bxc4ChbZMqRUaZ+d3s9T9Ghf2ZClunwQyK tgow== 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=iJx5hTzS3xFMQ+jHhH9chDjCsgBpgSN2nMLIqDZUlcA=; b=BUPf4VbDwHhajPukozzM3Fu8ezC6sQFjBBdYty6BJNL8bYMvCmK+wTLxA8R9zHKsTG kY+zX5lB5EXK8CMA3cbBxITRMoyoWBIfM8/iKTLYoZYyq2DARdEmM5/AT3P7wCkSxVS+ sCgzgMmJjDQsZp9khGta1ASNroAAU0nUIR7uwdZfW2E97N++O6p6UZGW8Mt9Vs44ujHO /Yg5KRDW0LFIhXCuDf1nLwxxwHFnqoupQeVN3VHg56e+uDUbC3KKdVB2Aq4/9akNxliq WsCdeac+MLLG36E/mx6kbEASmv8TnRZGkuBe75dfT5PRRJp9/UP+zIPykDGXbH/Rbps6 9cFA== 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 h5-v6si3420895plt.109.2018.04.19.07.12.54; Thu, 19 Apr 2018 07:13:08 -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 S1753631AbeDSOLQ (ORCPT + 99 others); Thu, 19 Apr 2018 10:11:16 -0400 Received: from sauhun.de ([88.99.104.3]:45416 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753552AbeDSOHM (ORCPT ); Thu, 19 Apr 2018 10:07:12 -0400 Received: from localhost (unknown [145.253.130.2]) by pokefinder.org (Postfix) with ESMTPSA id 67C873139CE; Thu, 19 Apr 2018 16:07:11 +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 , Zhang Rui , Eduardo Valentin , linux-pm@vger.kernel.org Subject: [PATCH 51/61] thermal: int340x_thermal: simplify getting .drvdata Date: Thu, 19 Apr 2018 16:06:21 +0200 Message-Id: <20180419140641.27926-52-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/thermal/int340x_thermal/int3400_thermal.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/thermal/int340x_thermal/int3400_thermal.c b/drivers/thermal/int340x_thermal/int3400_thermal.c index e26b01c05e82..61ca7ce3624e 100644 --- a/drivers/thermal/int340x_thermal/int3400_thermal.c +++ b/drivers/thermal/int340x_thermal/int3400_thermal.c @@ -48,8 +48,7 @@ static ssize_t available_uuids_show(struct device *dev, struct device_attribute *attr, char *buf) { - struct platform_device *pdev = to_platform_device(dev); - struct int3400_thermal_priv *priv = platform_get_drvdata(pdev); + struct int3400_thermal_priv *priv = dev_get_drvdata(dev); int i; int length = 0; @@ -68,8 +67,7 @@ static ssize_t available_uuids_show(struct device *dev, static ssize_t current_uuid_show(struct device *dev, struct device_attribute *devattr, char *buf) { - struct platform_device *pdev = to_platform_device(dev); - struct int3400_thermal_priv *priv = platform_get_drvdata(pdev); + struct int3400_thermal_priv *priv = dev_get_drvdata(dev); if (priv->uuid_bitmap & (1 << priv->current_uuid_index)) return sprintf(buf, "%s\n", @@ -82,8 +80,7 @@ static ssize_t current_uuid_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { - struct platform_device *pdev = to_platform_device(dev); - struct int3400_thermal_priv *priv = platform_get_drvdata(pdev); + struct int3400_thermal_priv *priv = dev_get_drvdata(dev); int i; for (i = 0; i < INT3400_THERMAL_MAXIMUM_UUID; ++i) { -- 2.11.0