Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp673258imu; Mon, 5 Nov 2018 07:08:01 -0800 (PST) X-Google-Smtp-Source: AJdET5cEe7K2kYLk+6YrV4IhkQP7k1+TJLmzG1rKS42i3KtaoycN8whc+yVraOFbkw3vNfgzfq9c X-Received: by 2002:a62:3911:: with SMTP id g17-v6mr23437683pfa.170.1541430481507; Mon, 05 Nov 2018 07:08:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541430481; cv=none; d=google.com; s=arc-20160816; b=tpGKZfBdm9I/sxTjzw9smg17bVIucCo/hECCBQ2Zm0L85WenuhO65otvRrGoziZ7eJ 3harM5SXqlDaFXi2NNWvRfBDmhmgf283wHZqkdc4pGeh2vJ7fxj6PYs2UVGf/In2cNWH l6EqYvpIY7NdmoHQ3MgXgG5hngaAlTnqXfNXgRDv6yODxOjZmC6TihyEFLE4AC8VEA8h n+NNBAasyWAhY6m263Qrv17660fi7UF280D40n5JNusCm60/BpzEBGlNzKCEmk3w0gZZ D/jhXI+9oOH6hHkgol8ice3BiucoqCW5GjjjmA/k0Nsbndp7hjpIkknjZgG7nONZ3MlH 1XGA== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=7lYsKMSQrOrZ5aMQB2N9DXIlKfLzUM00Wo3jDJpL1wM=; b=dSjNODJxvrqQ1vuNVpOIdXrp2EteRLTEcb0l732Hto6LCeJVzYku+/3aqbrPTHfMik d0PR7+fEbst3tTbwGlZZCXKowpxjiTMGyujvT5s4ACwock5UId5Hu6M5/q6fF8xhRNwu abOjwcQrbltenTvp2khDvi9Fr7TLup7iIxcBlBASi999GCp/btGEACV1uxKSFTtsB1R/ dfmSR7JzV4UF4x/1RXtz39QPQNIuTJXxAK1Zzq9wMtB0LAC/+JSWQ0UmzFRLaRiAS9iP to2yULW4yavSu5sXTDpelzR4x6WF0MQQnTGTRb5/2cMM4qhEt+DriR+9cwN35dTy0dG0 Ybpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VhIew8pg; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l123-v6si11017347pfl.200.2018.11.05.07.07.37; Mon, 05 Nov 2018 07:08:01 -0800 (PST) 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; dkim=pass header.i=@linaro.org header.s=google header.b=VhIew8pg; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730036AbeKFAYa (ORCPT + 99 others); Mon, 5 Nov 2018 19:24:30 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:39845 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729349AbeKFAY3 (ORCPT ); Mon, 5 Nov 2018 19:24:29 -0500 Received: by mail-wr1-f66.google.com with SMTP id r10-v6so9891373wrv.6 for ; Mon, 05 Nov 2018 07:04:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=7lYsKMSQrOrZ5aMQB2N9DXIlKfLzUM00Wo3jDJpL1wM=; b=VhIew8pgQmBa9ApgvBsAtjsauLhxXCrHBEcMIExNdqEA7QHqziO3Re1xuO3965bOHq 9HLHEOGLAvZIuTXt19i7IPynQCHV/zqgMgNDL1+bG3NlchW/xbHeV0sEDRPWPxvCWNyO 1Iy3cl1knH0SF00LZJVn70kxpSbS4GHa6HvjM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=7lYsKMSQrOrZ5aMQB2N9DXIlKfLzUM00Wo3jDJpL1wM=; b=RwBUViO+YIQPY64lWLTH/b4NgHucf5xfEWUvmV/AvWtOnfEEoxXoSW+fjYy99x19Xq ZDnr3ydazC8DSsX1VLxidYEGjVZ8QKJrMznGGF0rRo1V6xJR1rGTZ1z6BBAwQYr6tU5l cMzKxzCppoKgT1mAFZt8lnOZ8HwVcmoN/AAZJZS2JWGpVUYc7n/dZ9HRC1UdCLCREqMc RfXvMCDgWtBQJXanUXZ+7NVrueSScUL4pNgj0KxnzvQ0FImvhZiz/GT5C7kmON8v9C9u eMFDy3K1XA4wHSjASx14lpEWsZ3YuaT9aguS/rWb3kN5+b2Q6m6SLYmZizV+HxCtC7/8 lvZw== X-Gm-Message-State: AGRZ1gJpEX0F79zjmNoaP4i9ByzBrHZZe/JkbnnCXhh5aBu/jyX8/RuM 6XkBHyZI2WmvvjygCNzwYf8QhA== X-Received: by 2002:a5d:488a:: with SMTP id g10-v6mr20034475wrq.0.1541430259915; Mon, 05 Nov 2018 07:04:19 -0800 (PST) Received: from [192.168.0.40] (119.151.136.77.rev.sfr.net. [77.136.151.119]) by smtp.googlemail.com with ESMTPSA id 8-v6sm11402206wmd.26.2018.11.05.07.04.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Nov 2018 07:04:19 -0800 (PST) Subject: Re: [PATCH 1/5] thermal: int340x_thermal: int3400_thermal: simplify getting .driver_data To: Wolfram Sang , linux-kernel@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, Zhang Rui , Eduardo Valentin , linux-pm@vger.kernel.org References: <20181021200053.2194-1-wsa+renesas@sang-engineering.com> <20181021200053.2194-2-wsa+renesas@sang-engineering.com> From: Daniel Lezcano Message-ID: <6a8727da-66d6-8be2-6fd0-ad0984f819d9@linaro.org> Date: Mon, 5 Nov 2018 16:04:17 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20181021200053.2194-2-wsa+renesas@sang-engineering.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21/10/2018 22:00, Wolfram Sang wrote: > 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 Reviewed-by: Daniel Lezcano > > 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) { > -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog