From: Simon Horman <horms@verge.net.au>
To: Wolfram Sang <wsa+renesas@sang-engineering.com>
Cc: linux-kernel@vger.kernel.org,
Eduardo Valentin <edubezval@gmail.com>,
Alexandre Torgue <alexandre.torgue@st.com>,
linux-pm@vger.kernel.org,
Daniel Lezcano <daniel.lezcano@linaro.org>,
linux-renesas-soc@vger.kernel.org,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
Zhang Rui <rui.zhang@intel.com>,
linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 1/1] thermal: stm32: simplify getting .driver_data
Date: Wed, 27 Mar 2019 12:42:28 +0100 [thread overview]
Message-ID: <20190327114228.am642i64hscpfx2r@verge.net.au> (raw)
In-Reply-To: <20190319163635.30891-1-wsa+renesas@sang-engineering.com>
On Tue, Mar 19, 2019 at 05:36:35PM +0100, 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 <wsa+renesas@sang-engineering.com>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
> ---
>
> Build tested only. buildbot is happy.
>
> drivers/thermal/st/stm_thermal.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/thermal/st/stm_thermal.c b/drivers/thermal/st/stm_thermal.c
> index bbd73c5a4a4e..cf9ddc52f30e 100644
> --- a/drivers/thermal/st/stm_thermal.c
> +++ b/drivers/thermal/st/stm_thermal.c
> @@ -570,8 +570,7 @@ static int stm_thermal_prepare(struct stm_thermal_sensor *sensor)
> static int stm_thermal_suspend(struct device *dev)
> {
> int ret;
> - struct platform_device *pdev = to_platform_device(dev);
> - struct stm_thermal_sensor *sensor = platform_get_drvdata(pdev);
> + struct stm_thermal_sensor *sensor = dev_get_drvdata(dev);
>
> ret = stm_thermal_sensor_off(sensor);
> if (ret)
> @@ -585,8 +584,7 @@ static int stm_thermal_suspend(struct device *dev)
> static int stm_thermal_resume(struct device *dev)
> {
> int ret;
> - struct platform_device *pdev = to_platform_device(dev);
> - struct stm_thermal_sensor *sensor = platform_get_drvdata(pdev);
> + struct stm_thermal_sensor *sensor = dev_get_drvdata(dev);
>
> ret = stm_thermal_prepare(sensor);
> if (ret)
> --
> 2.11.0
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
next prev parent reply other threads:[~2019-03-27 11:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-19 16:36 [PATCH 1/1] thermal: stm32: simplify getting .driver_data Wolfram Sang
2019-03-27 11:42 ` Simon Horman [this message]
2019-03-27 13:00 ` Daniel Lezcano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190327114228.am642i64hscpfx2r@verge.net.au \
--to=horms@verge.net.au \
--cc=alexandre.torgue@st.com \
--cc=daniel.lezcano@linaro.org \
--cc=edubezval@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=rui.zhang@intel.com \
--cc=wsa+renesas@sang-engineering.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).