Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp1492758ima; Sun, 21 Oct 2018 13:04:12 -0700 (PDT) X-Google-Smtp-Source: AJdET5ezpDEVY92G6Mf44js6l6FMBbSkZRwC9qPAGZasAVAAG9S5VFTbWGJop1+ij/9GiNFKBSjI X-Received: by 2002:a63:6445:: with SMTP id y66mr82548pgb.250.1540152252299; Sun, 21 Oct 2018 13:04:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540152252; cv=none; d=google.com; s=arc-20160816; b=q2nyGip4YCjkTTjTfrcj9L3nN3pf0Mhvnweb4fZetwB5JzesOfP5imd43gg0sYQCxe /umWtfecBfkmq8mynYA7LmmByNrX5TLwLidQp8gvhsSfHt3L2yWxxKn6OnHQCFF0/B5/ oyupbRIoqmLD19oXCXujjCcby1B3eZP389Wk3h68HfHL1N+TvsP132IRRd/LyBhjLX0J oIaV6Viyj06hRB+GlmoSrwIgPBqfrJvJZu7jEnlD3hr4cmQ3MeyEIspIqj1OD0Y9zr5o zI3x+4NcLZNHLpnn8HfqjJURtAVwSp55euRIv4bFdFjqxdbyUbJCqXrM0JeKBsdZzY0n gqiA== 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=ibMXHxWrSnGM6JhIdeRheIIyeRA6SsoQrq2PCyJRLN4=; b=HwKFVNznrxt6RPWgOr2tVSbHqgV2cY2DExJQF352q8Z85fwu+wCFlemVC2hp62rJIr PXU1ZLVCmPy1iwLp/Pnkl8C4/MBJ9XvBA6jt1qfsRhX6kOZHo1oe3gjT8nGn/kdbyGa+ 32xOACUn1POf54qXPUkh0GKun426n0ucXFrapb7T6FCoYDKr5LR2954fBLSM/7fR7at9 Oe3FDg6gGkUPABAye9wc8FZiOcMEYxdJZ5M9xXUhbUB5n4DVUeoqYsoW0Khe/F1uFoHH t7ooYnHrS0zdCtqIc4S3YdItNQVRbr+SFRcpRKdT2eVUciYzDvSjmGyLtEtkEce0xxgK bA6Q== 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 d10-v6si31614219pgb.458.2018.10.21.13.03.57; Sun, 21 Oct 2018 13:04:12 -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 S1728726AbeJVEQZ (ORCPT + 99 others); Mon, 22 Oct 2018 00:16:25 -0400 Received: from sauhun.de ([88.99.104.3]:45938 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728699AbeJVEQY (ORCPT ); Mon, 22 Oct 2018 00:16:24 -0400 Received: from localhost (unknown [90.200.225.72]) by pokefinder.org (Postfix) with ESMTPSA id 58C302E35DD; Sun, 21 Oct 2018 22:00:55 +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 1/5] thermal: int340x_thermal: int3400_thermal: simplify getting .driver_data Date: Sun, 21 Oct 2018 22:00:48 +0200 Message-Id: <20181021200053.2194-2-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/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.19.0