From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78BCDC46475 for ; Mon, 5 Nov 2018 15:06:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1769620827 for ; Mon, 5 Nov 2018 15:06:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linaro.org header.i=@linaro.org header.b="HkyidLzr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1769620827 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730139AbeKFA0m (ORCPT ); Mon, 5 Nov 2018 19:26:42 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:36853 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729438AbeKFA0m (ORCPT ); Mon, 5 Nov 2018 19:26:42 -0500 Received: by mail-wm1-f68.google.com with SMTP id a8-v6so8374819wmf.1 for ; Mon, 05 Nov 2018 07:06:33 -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=NUh0P/wi1Q78fChV9vZmUMm4I5+PQWgEGme3GofeAnY=; b=HkyidLzrQhrb+liEgQr/0qkiK8/cu2lwVE66slYKe7qSUkUIvey/Fn2Qyu3c+N60g/ BsixySThrxygisuJIjeFL7t6ANQ6BkmvCqVA8rVmrPvkIHE+vrxklqMoO2julJNRkBe9 PdbqscpxUVaqzHjAZ1q8N8qWrttJO+g2e6w0E= 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=NUh0P/wi1Q78fChV9vZmUMm4I5+PQWgEGme3GofeAnY=; b=DBnq/6Y8Nx7Zs+zx1E4Ojrt1gZdZkGnYWT7QxsdnHv5sIZGK9w4/yNy/N/0NuGIc8X tG+9SqZwuRALwz/VgzHnFPScTIVrP5PITN1AhP2pSRVF5WQzH/S3oZkeMBEao335TeKE rYXCNZ7i8V1NupVBNOwCw4ZXAJ0aST4+Y5WlVdyFjx9OIa1Qn6hg64PF60uCRIf2+Qwl dj78GzGVHpGk9FFtelNDik245TnFfi3Hv+Be60ygmeK9/jklLGW1Yi/AmIjRZWDNGLh5 c+NI5KBQDPJ3VgTHCvE601okPetNG9l5RVikgY68IquiaJJd3GJPJ+FO5wbGHSCbG//B WA7Q== X-Gm-Message-State: AGRZ1gKNc0N6AE8ni8mwY47JNId9kbtTWjPTS1fmgfUrVzy4A11P7AXu eYaALLI4fdisT6J0Ar+3IKv65Q== X-Google-Smtp-Source: AJdET5eOkPiVMbEEJUeeF0QzT6ZCYf+G+5MeI9M5bdbH5ynrWx822jAVzHwHdA8uoU5xdYNonCsGSw== X-Received: by 2002:a1c:a757:: with SMTP id q84-v6mr4951657wme.61.1541430392790; Mon, 05 Nov 2018 07:06:32 -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 w18-v6sm10901096wrn.66.2018.11.05.07.06.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Nov 2018 07:06:31 -0800 (PST) Subject: Re: [PATCH 4/5] thermal: st: st_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-5-wsa+renesas@sang-engineering.com> From: Daniel Lezcano Message-ID: <0c7d3c84-c073-087e-eafb-c93bb5d43ea7@linaro.org> Date: Mon, 5 Nov 2018 16:06:30 +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-5-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/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) > -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog