* [PATCH next 23/25] thermal: Use dev_get_drvdata()
[not found] <20190423075020.173734-1-wangkefeng.wang@huawei.com>
@ 2019-04-23 7:50 ` Kefeng Wang
2019-04-23 7:50 ` Kefeng Wang
2019-04-29 3:47 ` Zhang Rui
0 siblings, 2 replies; 6+ messages in thread
From: Kefeng Wang @ 2019-04-23 7:50 UTC (permalink / raw)
To: linux-kernel
Cc: Masahiro Yamada, Kefeng Wang, Zhang Rui, Eduardo Valentin,
Daniel Lezcano, linux-pm
Using dev_get_drvdata directly.
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Eduardo Valentin <edubezval@gmail.com>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: linux-pm@vger.kernel.org
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
.../intel/int340x_thermal/processor_thermal_device.c | 8 +-------
drivers/thermal/st/stm_thermal.c | 6 ++----
2 files changed, 3 insertions(+), 11 deletions(-)
diff --git a/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c b/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
index 8e1cf4d789be..4ad54b8d4778 100644
--- a/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
+++ b/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
@@ -81,8 +81,6 @@ static ssize_t power_limit_##index##_##suffix##_show(struct device *dev, \
struct device_attribute *attr, \
char *buf) \
{ \
- struct pci_dev *pci_dev; \
- struct platform_device *pdev; \
struct proc_thermal_device *proc_dev; \
\
if (proc_thermal_emum_mode == PROC_THERMAL_NONE) { \
@@ -91,11 +89,7 @@ static ssize_t power_limit_##index##_##suffix##_show(struct device *dev, \
} \
\
if (proc_thermal_emum_mode == PROC_THERMAL_PLATFORM_DEV) { \
- pdev = to_platform_device(dev); \
- proc_dev = platform_get_drvdata(pdev); \
- } else { \
- pci_dev = to_pci_dev(dev); \
- proc_dev = pci_get_drvdata(pci_dev); \
+ proc_dev = dev_get_drvdata(dev); \
} \
return sprintf(buf, "%lu\n",\
(unsigned long)proc_dev->power_limits[index].suffix * 1000); \
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.20.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH next 23/25] thermal: Use dev_get_drvdata()
2019-04-23 7:50 ` [PATCH next 23/25] thermal: Use dev_get_drvdata() Kefeng Wang
@ 2019-04-23 7:50 ` Kefeng Wang
2019-04-29 3:47 ` Zhang Rui
1 sibling, 0 replies; 6+ messages in thread
From: Kefeng Wang @ 2019-04-23 7:50 UTC (permalink / raw)
To: linux-kernel
Cc: Masahiro Yamada, Kefeng Wang, Zhang Rui, Eduardo Valentin,
Daniel Lezcano, linux-pm
Using dev_get_drvdata directly.
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Eduardo Valentin <edubezval@gmail.com>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: linux-pm@vger.kernel.org
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
.../intel/int340x_thermal/processor_thermal_device.c | 8 +-------
drivers/thermal/st/stm_thermal.c | 6 ++----
2 files changed, 3 insertions(+), 11 deletions(-)
diff --git a/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c b/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
index 8e1cf4d789be..4ad54b8d4778 100644
--- a/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
+++ b/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
@@ -81,8 +81,6 @@ static ssize_t power_limit_##index##_##suffix##_show(struct device *dev, \
struct device_attribute *attr, \
char *buf) \
{ \
- struct pci_dev *pci_dev; \
- struct platform_device *pdev; \
struct proc_thermal_device *proc_dev; \
\
if (proc_thermal_emum_mode == PROC_THERMAL_NONE) { \
@@ -91,11 +89,7 @@ static ssize_t power_limit_##index##_##suffix##_show(struct device *dev, \
} \
\
if (proc_thermal_emum_mode == PROC_THERMAL_PLATFORM_DEV) { \
- pdev = to_platform_device(dev); \
- proc_dev = platform_get_drvdata(pdev); \
- } else { \
- pci_dev = to_pci_dev(dev); \
- proc_dev = pci_get_drvdata(pci_dev); \
+ proc_dev = dev_get_drvdata(dev); \
} \
return sprintf(buf, "%lu\n",\
(unsigned long)proc_dev->power_limits[index].suffix * 1000); \
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.20.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH next 23/25] thermal: Use dev_get_drvdata()
2019-04-23 7:50 ` [PATCH next 23/25] thermal: Use dev_get_drvdata() Kefeng Wang
2019-04-23 7:50 ` Kefeng Wang
@ 2019-04-29 3:47 ` Zhang Rui
2019-04-29 3:47 ` Zhang Rui
2019-04-29 6:55 ` Kefeng Wang
1 sibling, 2 replies; 6+ messages in thread
From: Zhang Rui @ 2019-04-29 3:47 UTC (permalink / raw)
To: Kefeng Wang, linux-kernel
Cc: Masahiro Yamada, Eduardo Valentin, Daniel Lezcano, linux-pm
On 二, 2019-04-23 at 15:50 +0800, Kefeng Wang wrote:
> Using dev_get_drvdata directly.
>
> Cc: Zhang Rui <rui.zhang@intel.com>
> Cc: Eduardo Valentin <edubezval@gmail.com>
> Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
> Cc: linux-pm@vger.kernel.org
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> ---
> .../intel/int340x_thermal/processor_thermal_device.c | 8 +-----
> --
> drivers/thermal/st/stm_thermal.c | 6 ++----
> 2 files changed, 3 insertions(+), 11 deletions(-)
>
> diff --git
> a/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
> b/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
> index 8e1cf4d789be..4ad54b8d4778 100644
> ---
> a/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
> +++
> b/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
> @@ -81,8 +81,6 @@ static ssize_t
> power_limit_##index##_##suffix##_show(struct device *dev, \
> struct device_attribute
> *attr, \
> char *buf) \
> { \
> - struct pci_dev *pci_dev; \
> - struct platform_device *pdev; \
> struct proc_thermal_device *proc_dev; \
> \
> if (proc_thermal_emum_mode == PROC_THERMAL_NONE) { \
> @@ -91,11 +89,7 @@ static ssize_t
> power_limit_##index##_##suffix##_show(struct device *dev, \
> } \
> \
> if (proc_thermal_emum_mode == PROC_THERMAL_PLATFORM_DEV) { \
> - pdev = to_platform_device(dev); \
> - proc_dev = platform_get_drvdata(pdev); \
> - } else { \
> - pci_dev = to_pci_dev(dev); \
> - proc_dev = pci_get_drvdata(pci_dev); \
> + proc_dev = dev_get_drvdata(dev); \
> } \
> return sprintf(buf, "%lu\n",\
> (unsigned long)proc_dev->power_limits[index].suffix * 1000);
> \
Sumeet has a patch to fix the same issue, which has been in my tree
https://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux.git/commit
/?h=next&id=1948d498dcf680bc650391f23da2f97e59f9126d
Plus, the previous fix is wrong because proc_dev will be left
uninitialized if proc_thermal_emum_mode equals PROC_THERMAL_PCI.
thanks,
rui
> 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)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH next 23/25] thermal: Use dev_get_drvdata()
2019-04-29 3:47 ` Zhang Rui
@ 2019-04-29 3:47 ` Zhang Rui
2019-04-29 6:55 ` Kefeng Wang
1 sibling, 0 replies; 6+ messages in thread
From: Zhang Rui @ 2019-04-29 3:47 UTC (permalink / raw)
To: Kefeng Wang, linux-kernel
Cc: Masahiro Yamada, Eduardo Valentin, Daniel Lezcano, linux-pm
On 二, 2019-04-23 at 15:50 +0800, Kefeng Wang wrote:
> Using dev_get_drvdata directly.
>
> Cc: Zhang Rui <rui.zhang@intel.com>
> Cc: Eduardo Valentin <edubezval@gmail.com>
> Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
> Cc: linux-pm@vger.kernel.org
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> ---
> .../intel/int340x_thermal/processor_thermal_device.c | 8 +-----
> --
> drivers/thermal/st/stm_thermal.c | 6 ++----
> 2 files changed, 3 insertions(+), 11 deletions(-)
>
> diff --git
> a/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
> b/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
> index 8e1cf4d789be..4ad54b8d4778 100644
> ---
> a/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
> +++
> b/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
> @@ -81,8 +81,6 @@ static ssize_t
> power_limit_##index##_##suffix##_show(struct device *dev, \
> struct device_attribute
> *attr, \
> char *buf) \
> { \
> - struct pci_dev *pci_dev; \
> - struct platform_device *pdev; \
> struct proc_thermal_device *proc_dev; \
> \
> if (proc_thermal_emum_mode == PROC_THERMAL_NONE) { \
> @@ -91,11 +89,7 @@ static ssize_t
> power_limit_##index##_##suffix##_show(struct device *dev, \
> } \
> \
> if (proc_thermal_emum_mode == PROC_THERMAL_PLATFORM_DEV) { \
> - pdev = to_platform_device(dev); \
> - proc_dev = platform_get_drvdata(pdev); \
> - } else { \
> - pci_dev = to_pci_dev(dev); \
> - proc_dev = pci_get_drvdata(pci_dev); \
> + proc_dev = dev_get_drvdata(dev); \
> } \
> return sprintf(buf, "%lu\n",\
> (unsigned long)proc_dev->power_limits[index].suffix * 1000);
> \
Sumeet has a patch to fix the same issue, which has been in my tree
https://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux.git/commit
/?h=next&id=1948d498dcf680bc650391f23da2f97e59f9126d
Plus, the previous fix is wrong because proc_dev will be left
uninitialized if proc_thermal_emum_mode equals PROC_THERMAL_PCI.
thanks,
rui
> 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)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH next 23/25] thermal: Use dev_get_drvdata()
2019-04-29 3:47 ` Zhang Rui
2019-04-29 3:47 ` Zhang Rui
@ 2019-04-29 6:55 ` Kefeng Wang
2019-04-29 6:55 ` Kefeng Wang
1 sibling, 1 reply; 6+ messages in thread
From: Kefeng Wang @ 2019-04-29 6:55 UTC (permalink / raw)
To: Zhang Rui, linux-kernel
Cc: Masahiro Yamada, Eduardo Valentin, Daniel Lezcano, linux-pm
On 2019/4/29 11:47, Zhang Rui wrote:
> On 二, 2019-04-23 at 15:50 +0800, Kefeng Wang wrote:
>> Using dev_get_drvdata directly.
>>
>> Cc: Zhang Rui <rui.zhang@intel.com>
>> Cc: Eduardo Valentin <edubezval@gmail.com>
>> Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
>> Cc: linux-pm@vger.kernel.org
>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
>> ---
>> .../intel/int340x_thermal/processor_thermal_device.c | 8 +-----
>> --
>> drivers/thermal/st/stm_thermal.c | 6 ++----
>> 2 files changed, 3 insertions(+), 11 deletions(-)
>>
>> diff --git
>> a/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
>> b/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
>> index 8e1cf4d789be..4ad54b8d4778 100644
>> ---
>> a/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
>> +++
>> b/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
>> @@ -81,8 +81,6 @@ static ssize_t
>> power_limit_##index##_##suffix##_show(struct device *dev, \
>> struct device_attribute
>> *attr, \
>> char *buf) \
>> { \
>> - struct pci_dev *pci_dev; \
>> - struct platform_device *pdev; \
>> struct proc_thermal_device *proc_dev; \
>> \
>> if (proc_thermal_emum_mode == PROC_THERMAL_NONE) { \
>> @@ -91,11 +89,7 @@ static ssize_t
>> power_limit_##index##_##suffix##_show(struct device *dev, \
>> } \
>> \
>> if (proc_thermal_emum_mode == PROC_THERMAL_PLATFORM_DEV) { \
>> - pdev = to_platform_device(dev); \
>> - proc_dev = platform_get_drvdata(pdev); \
>> - } else { \
>> - pci_dev = to_pci_dev(dev); \
>> - proc_dev = pci_get_drvdata(pci_dev); \
>> + proc_dev = dev_get_drvdata(dev); \
>> } \
>> return sprintf(buf, "%lu\n",\
>> (unsigned long)proc_dev->power_limits[index].suffix * 1000);
>> \
> Sumeet has a patch to fix the same issue, which has been in my tree
> https://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux.git/commit
> /?h=next&id=1948d498dcf680bc650391f23da2f97e59f9126d
>
> Plus, the previous fix is wrong because proc_dev will be left
> uninitialized if proc_thermal_emum_mode equals PROC_THERMAL_PCI.
oh, Sumeet's patch is the right one and much cleaner.
>
> thanks,
> rui
>
>> 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)
> .
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH next 23/25] thermal: Use dev_get_drvdata()
2019-04-29 6:55 ` Kefeng Wang
@ 2019-04-29 6:55 ` Kefeng Wang
0 siblings, 0 replies; 6+ messages in thread
From: Kefeng Wang @ 2019-04-29 6:55 UTC (permalink / raw)
To: Zhang Rui, linux-kernel
Cc: Masahiro Yamada, Eduardo Valentin, Daniel Lezcano, linux-pm
On 2019/4/29 11:47, Zhang Rui wrote:
> On 二, 2019-04-23 at 15:50 +0800, Kefeng Wang wrote:
>> Using dev_get_drvdata directly.
>>
>> Cc: Zhang Rui <rui.zhang@intel.com>
>> Cc: Eduardo Valentin <edubezval@gmail.com>
>> Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
>> Cc: linux-pm@vger.kernel.org
>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
>> ---
>> .../intel/int340x_thermal/processor_thermal_device.c | 8 +-----
>> --
>> drivers/thermal/st/stm_thermal.c | 6 ++----
>> 2 files changed, 3 insertions(+), 11 deletions(-)
>>
>> diff --git
>> a/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
>> b/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
>> index 8e1cf4d789be..4ad54b8d4778 100644
>> ---
>> a/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
>> +++
>> b/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
>> @@ -81,8 +81,6 @@ static ssize_t
>> power_limit_##index##_##suffix##_show(struct device *dev, \
>> struct device_attribute
>> *attr, \
>> char *buf) \
>> { \
>> - struct pci_dev *pci_dev; \
>> - struct platform_device *pdev; \
>> struct proc_thermal_device *proc_dev; \
>> \
>> if (proc_thermal_emum_mode == PROC_THERMAL_NONE) { \
>> @@ -91,11 +89,7 @@ static ssize_t
>> power_limit_##index##_##suffix##_show(struct device *dev, \
>> } \
>> \
>> if (proc_thermal_emum_mode == PROC_THERMAL_PLATFORM_DEV) { \
>> - pdev = to_platform_device(dev); \
>> - proc_dev = platform_get_drvdata(pdev); \
>> - } else { \
>> - pci_dev = to_pci_dev(dev); \
>> - proc_dev = pci_get_drvdata(pci_dev); \
>> + proc_dev = dev_get_drvdata(dev); \
>> } \
>> return sprintf(buf, "%lu\n",\
>> (unsigned long)proc_dev->power_limits[index].suffix * 1000);
>> \
> Sumeet has a patch to fix the same issue, which has been in my tree
> https://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux.git/commit
> /?h=next&id=1948d498dcf680bc650391f23da2f97e59f9126d
>
> Plus, the previous fix is wrong because proc_dev will be left
> uninitialized if proc_thermal_emum_mode equals PROC_THERMAL_PCI.
oh, Sumeet's patch is the right one and much cleaner.
>
> thanks,
> rui
>
>> 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)
> .
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-04-29 6:56 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20190423075020.173734-1-wangkefeng.wang@huawei.com>
2019-04-23 7:50 ` [PATCH next 23/25] thermal: Use dev_get_drvdata() Kefeng Wang
2019-04-23 7:50 ` Kefeng Wang
2019-04-29 3:47 ` Zhang Rui
2019-04-29 3:47 ` Zhang Rui
2019-04-29 6:55 ` Kefeng Wang
2019-04-29 6:55 ` Kefeng Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox