Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp671212imu; Mon, 5 Nov 2018 07:06:29 -0800 (PST) X-Google-Smtp-Source: AJdET5ekuffGk9xjgbz+y2O3Gvkp3S0q+nYJd6dOlnS9Nhn3v8yQ71g5T4xozZbuYHmNMsGf+/xU X-Received: by 2002:a63:1b1f:: with SMTP id b31mr20207730pgb.66.1541430389339; Mon, 05 Nov 2018 07:06:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541430389; cv=none; d=google.com; s=arc-20160816; b=hWGIa/VfDwqnNYnI8VUGJtjivLN06GZuw8mwE2mVZuxAuEXFiaBZc8k5xuI/doPBUt qTiDrLtddiDaKjxLfDpNy8teoavjnLnmJ0p2YO7w5mVcPv+59fKEBvV4MYHGySGUZ8lr eu35pOz40f3JCpJGDRO0X2vhvAAoFmm6G+8d00tk2O+b5tlUiwLutFt1iiOw7SV4F5V/ vsg3EuZHfXLaXfS5WYbge/lk/6m/MJ/UuG0coJQcgfNMXoX3cp3v1bZSnAIt1lEhY+M7 qdgq3/XH5YMiB67q5Yuos5LDD1fKHBhN9ozPsSPWAkUdmAUs8S+P6vw8q+URdDuezAw4 4mAg== 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=2FoXP6R1hBV5AeMBxq6hKppCa7ojxpwQBg//H9J01Go=; b=fMhrywF6V0+QaYE399FprdVi9qqgYhUpo+9H0P9hai7S7J9CVJluslWyMPnJkvwEW9 K6zleOvcfWlibXQ5s9iH/rjUk2X1nRWt554SkfAFAEDlWeUyHi985gtlXLocgl5hoQ+L CeMn/FgvNAo8werSAOZpmZgt2OJoqxY/gMR/fyRxiLD6qHxLpAqZIBrKWU/TTzl3YWjo +6PxaiEaKhYXM0D8whLIylPaukt5OsF/w4jUFYvdkn9UpzSOL/wpLjldpEzMdQ7BEY06 oUFSF4J+XRTBmSg3rbr+eX5e6H/GVvj6DmPH3aD0Jie9A+hZ5iH6sV30BxIjJ6JJibEU YNog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="i5/V2LY2"; 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 t75-v6si43294697pfi.221.2018.11.05.07.06.02; Mon, 05 Nov 2018 07:06:29 -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="i5/V2LY2"; 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 S1730057AbeKFAZ3 (ORCPT + 99 others); Mon, 5 Nov 2018 19:25:29 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:51124 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729588AbeKFAZ3 (ORCPT ); Mon, 5 Nov 2018 19:25:29 -0500 Received: by mail-wm1-f67.google.com with SMTP id 124-v6so3780213wmw.0 for ; Mon, 05 Nov 2018 07:05:20 -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=2FoXP6R1hBV5AeMBxq6hKppCa7ojxpwQBg//H9J01Go=; b=i5/V2LY2/4XKA5LUQVVYHDgdMzPehpB04Nf2VlzXA0sLVUpGnin4jVEN93W5+1d6Ip OcXLH0Y7ItpXtEJMEzKwx0F8KzvS5LhUI4/LRnx8t2n5qjhObG4y2WlxuHpTDKQYfRum T91fU0bjUNIxhhlW5UxCA3BVyKu/3czlRPfkk= 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=2FoXP6R1hBV5AeMBxq6hKppCa7ojxpwQBg//H9J01Go=; b=sZQB04wor+tIpnqwthc2jtZ3VR6NiUhjhUGwxAL0f5+kAa2o9pP7bCcZh8DbTks7V2 KDmKTbT9PAn61r5pCB5WqxUNNRFozdWTLvdC9b0eWYgGvmrrKmQXQc2hIET+z2u8HzyL 928cAbvgXKutGRB/DRXUqXlK+BE4ANv8m9jeAGjSDdkfSLLLESEZWTSVa4ISd6tQXMp+ +7iGOM6xlL2rKON4c6GB/+JjfiKxAJdh4Wq9GB1JiegFn9hsgYYOAo5RbHRojL5efQkC 0FTFGJYG9Py6nKIbepYGSo2Bc9fD0bPjM8HLDmuMFyamRzaUHAgYRXnWEkilx7HsHiVw sAnA== X-Gm-Message-State: AGRZ1gLOqL6vEAUIKI2OBNArQoEw2ptB+4T9U1EFdUF+PU6L417cpaNp sbo1dS1SW7hUKgR0vneX1cAXnw== X-Received: by 2002:a1c:c604:: with SMTP id w4-v6mr6763681wmf.40.1541430319443; Mon, 05 Nov 2018 07:05: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 e8-v6sm20940941wrw.75.2018.11.05.07.05.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Nov 2018 07:05:18 -0800 (PST) Subject: Re: [PATCH 2/5] thermal: rockchip_thermal: simplify getting .driver_data To: Wolfram Sang , linux-kernel@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, Zhang Rui , Eduardo Valentin , Heiko Stuebner , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org References: <20181021200053.2194-1-wsa+renesas@sang-engineering.com> <20181021200053.2194-3-wsa+renesas@sang-engineering.com> From: Daniel Lezcano Message-ID: Date: Mon, 5 Nov 2018 16:05:16 +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-3-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/rockchip_thermal.c | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > > diff --git a/drivers/thermal/rockchip_thermal.c b/drivers/thermal/rockchip_thermal.c > index f36375d5a16c..9c7643d62ed7 100644 > --- a/drivers/thermal/rockchip_thermal.c > +++ b/drivers/thermal/rockchip_thermal.c > @@ -1327,8 +1327,7 @@ static int rockchip_thermal_remove(struct platform_device *pdev) > > static int __maybe_unused rockchip_thermal_suspend(struct device *dev) > { > - struct platform_device *pdev = to_platform_device(dev); > - struct rockchip_thermal_data *thermal = platform_get_drvdata(pdev); > + struct rockchip_thermal_data *thermal = dev_get_drvdata(dev); > int i; > > for (i = 0; i < thermal->chip->chn_num; i++) > @@ -1346,8 +1345,7 @@ static int __maybe_unused rockchip_thermal_suspend(struct device *dev) > > static int __maybe_unused rockchip_thermal_resume(struct device *dev) > { > - struct platform_device *pdev = to_platform_device(dev); > - struct rockchip_thermal_data *thermal = platform_get_drvdata(pdev); > + struct rockchip_thermal_data *thermal = dev_get_drvdata(dev); > int i; > int error; > > @@ -1376,7 +1374,7 @@ static int __maybe_unused rockchip_thermal_resume(struct device *dev) > id, thermal->regs, > thermal->tshut_temp); > if (error) > - dev_err(&pdev->dev, "%s: invalid tshut=%d, error=%d\n", > + dev_err(dev, "%s: invalid tshut=%d, error=%d\n", > __func__, thermal->tshut_temp, error); > } > > -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog