All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hwmon: Fix the 'No sensors found' error after replacing the parameter NULL by the actual device
@ 2018-10-02  8:35 Cao Van Dong
  2018-10-02  8:48 ` Geert Uytterhoeven
  2018-10-02 12:50 ` Guenter Roeck
  0 siblings, 2 replies; 11+ messages in thread
From: Cao Van Dong @ 2018-10-02  8:35 UTC (permalink / raw)
  To: broonie, geert+renesas, linux-hwmon
  Cc: kuninori.morimoto.gx, yoshihiro.shimoda.uh, linux-renesas-soc,
	h-inayoshi, nv-dung, na-hoan, cv-dong


In __hwmon_device_register() function of hwmon.c, we have assigned 'dev' directly to 'hdev->parent'. 
Formerly, when registering the hwmon device, we pass NULL as the device. This is not affected.
Recently, the developer has replaced the parameter NULL as the device by the actual device.
This causes the "No sensors found" error. This patch is to fix this error.

This patch is based on the v4.19-rc3 tag.

---
 drivers/hwmon/hwmon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwmon/hwmon.c b/drivers/hwmon/hwmon.c
index 33d5128..7c8d3cb 100644
--- a/drivers/hwmon/hwmon.c
+++ b/drivers/hwmon/hwmon.c
@@ -610,7 +610,7 @@ __hwmon_device_register(struct device *dev, const char *name, void *drvdata,
 
 	hwdev->name = name;
 	hdev->class = &hwmon_class;
-	hdev->parent = dev;
+	hdev->parent = dev->parent;
 	hdev->of_node = dev ? dev->of_node : NULL;
 	hwdev->chip = chip;
 	dev_set_drvdata(hdev, drvdata);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] hwmon: Fix the 'No sensors found' error after replacing the parameter NULL by the actual device
  2018-10-02  8:35 [PATCH] hwmon: Fix the 'No sensors found' error after replacing the parameter NULL by the actual device Cao Van Dong
@ 2018-10-02  8:48 ` Geert Uytterhoeven
  2018-10-02  9:06   ` Cao Van Dong
  2018-10-02 12:50 ` Guenter Roeck
  1 sibling, 1 reply; 11+ messages in thread
From: Geert Uytterhoeven @ 2018-10-02  8:48 UTC (permalink / raw)
  To: カオ・ヴァン・ドン
  Cc: Mark Brown, Geert Uytterhoeven, linux-hwmon, Kuninori Morimoto,
	Yoshihiro Shimoda, Linux-Renesas, 稲吉,
	Dung:人ソ,
	Hoan Nguyen An

Hi Cao,

Thanks for your patch!

On Tue, Oct 2, 2018 at 10:35 AM Cao Van Dong <cv-dong@jinso.co.jp> wrote:
> In __hwmon_device_register() function of hwmon.c, we have assigned 'dev' directly to 'hdev->parent'.
> Formerly, when registering the hwmon device, we pass NULL as the device. This is not affected.
> Recently, the developer has replaced the parameter NULL as the device by the actual device.

Do you know the commit ID of this recent change?
It's useful for review of your change, and to know to which versions your
patch should be backported.

> This causes the "No sensors found" error. This patch is to fix this error.

On which platform do you see this failure?
Thanks again!

> --- a/drivers/hwmon/hwmon.c
> +++ b/drivers/hwmon/hwmon.c
> @@ -610,7 +610,7 @@ __hwmon_device_register(struct device *dev, const char *name, void *drvdata,
>
>         hwdev->name = name;
>         hdev->class = &hwmon_class;
> -       hdev->parent = dev;
> +       hdev->parent = dev->parent;
>         hdev->of_node = dev ? dev->of_node : NULL;
>         hwdev->chip = chip;
>         dev_set_drvdata(hdev, drvdata);

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] hwmon: Fix the 'No sensors found' error after replacing the parameter NULL by the actual device
  2018-10-02  8:48 ` Geert Uytterhoeven
@ 2018-10-02  9:06   ` Cao Van Dong
  2018-10-02 12:56     ` Guenter Roeck
  0 siblings, 1 reply; 11+ messages in thread
From: Cao Van Dong @ 2018-10-02  9:06 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Mark Brown, Geert Uytterhoeven, linux-hwmon, Kuninori Morimoto,
	Yoshihiro Shimoda, Linux-Renesas, 稲吉,
	Dung:人ソ,
	Hoan Nguyen An, cv-dong

Dear Geert-san,

Thanks for your comment!

>> In __hwmon_device_register() function of hwmon.c, we have assigned 'dev' directly to 'hdev->parent'.
>> Formerly, when registering the hwmon device, we pass NULL as the device. This is not affected.
>> Recently, the developer has replaced the parameter NULL as the device by the actual device.
> Do you know the commit ID of this recent change?
> It's useful for review of your change, and to know to which versions your
> patch should be backported.

The commit ID of this recent change is"f6b6b52 thermal_hwmon: Pass the originating device down to 
hwmon_device_register_with_info".

>> This causes the "No sensors found" error. This patch is to fix this error.
> On which platform do you see this failure?
> Thanks again!

This error is found on Gen2 Lager board v4.19-rc2 by RVC team.


Best regards,
Dong/Jinso

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] hwmon: Fix the 'No sensors found' error after replacing the parameter NULL by the actual device
  2018-10-02  8:35 [PATCH] hwmon: Fix the 'No sensors found' error after replacing the parameter NULL by the actual device Cao Van Dong
  2018-10-02  8:48 ` Geert Uytterhoeven
@ 2018-10-02 12:50 ` Guenter Roeck
  2018-10-02 12:57   ` Geert Uytterhoeven
  2018-10-03  1:33   ` Cao Van Dong
  1 sibling, 2 replies; 11+ messages in thread
From: Guenter Roeck @ 2018-10-02 12:50 UTC (permalink / raw)
  To: Cao Van Dong, broonie, geert+renesas, linux-hwmon
  Cc: kuninori.morimoto.gx, yoshihiro.shimoda.uh, linux-renesas-soc,
	h-inayoshi, nv-dung, na-hoan

On 10/02/2018 01:35 AM, Cao Van Dong wrote:
> In __hwmon_device_register() function of hwmon.c, we have assigned 'dev' directly to 'hdev->parent'.
> Formerly, when registering the hwmon device, we pass NULL as the device. This is not affected.
> Recently, the developer has replaced the parameter NULL as the device by the actual device.
> This causes the "No sensors found" error. This patch is to fix this error.
> 
> This patch is based on the v4.19-rc3 tag.
> 

NACK.

This is wrong. The passed device is the hwmon driver's parent device. Using that device's
parent would be wrong. Indeed, that device could be a platform device with no parent.
The problem must be fixed in the calling code.

Guenter

> ---
>   drivers/hwmon/hwmon.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hwmon/hwmon.c b/drivers/hwmon/hwmon.c
> index 33d5128..7c8d3cb 100644
> --- a/drivers/hwmon/hwmon.c
> +++ b/drivers/hwmon/hwmon.c
> @@ -610,7 +610,7 @@ __hwmon_device_register(struct device *dev, const char *name, void *drvdata,
>   
>   	hwdev->name = name;
>   	hdev->class = &hwmon_class;
> -	hdev->parent = dev;
> +	hdev->parent = dev->parent;
>   	hdev->of_node = dev ? dev->of_node : NULL;
>   	hwdev->chip = chip;
>   	dev_set_drvdata(hdev, drvdata);
> 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] hwmon: Fix the 'No sensors found' error after replacing the parameter NULL by the actual device
  2018-10-02  9:06   ` Cao Van Dong
@ 2018-10-02 12:56     ` Guenter Roeck
  2018-10-02 12:58       ` Geert Uytterhoeven
  2018-10-03  1:17       ` Cao Van Dong
  0 siblings, 2 replies; 11+ messages in thread
From: Guenter Roeck @ 2018-10-02 12:56 UTC (permalink / raw)
  To: Cao Van Dong, Geert Uytterhoeven
  Cc: Mark Brown, Geert Uytterhoeven, linux-hwmon, Kuninori Morimoto,
	Yoshihiro Shimoda, Linux-Renesas, 稲吉,
	Dung:人ソ,
	Hoan Nguyen An

On 10/02/2018 02:06 AM, Cao Van Dong wrote:
> Dear Geert-san,
> 
> Thanks for your comment!
> 
>>> In __hwmon_device_register() function of hwmon.c, we have assigned 'dev' directly to 'hdev->parent'.
>>> Formerly, when registering the hwmon device, we pass NULL as the device. This is not affected.
>>> Recently, the developer has replaced the parameter NULL as the device by the actual device.
>> Do you know the commit ID of this recent change?
>> It's useful for review of your change, and to know to which versions your
>> patch should be backported.
> 
> The commit ID of this recent change is"f6b6b52 thermal_hwmon: Pass the originating device down to hwmon_device_register_with_info".
> 
If thermal doesn't want hwmon to use the thermal zone device, it should pass
the parent of that device as parameter.

>>> This causes the "No sensors found" error. This patch is to fix this error.
>> On which platform do you see this failure?
>> Thanks again!
> 
> This error is found on Gen2 Lager board v4.19-rc2 by RVC team.
> 

Some more details about the error would be useful.

Guenter

> 
> Best regards,
> Dong/Jinso
> 
> 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] hwmon: Fix the 'No sensors found' error after replacing the parameter NULL by the actual device
  2018-10-02 12:50 ` Guenter Roeck
@ 2018-10-02 12:57   ` Geert Uytterhoeven
  2018-10-03  1:33   ` Cao Van Dong
  1 sibling, 0 replies; 11+ messages in thread
From: Geert Uytterhoeven @ 2018-10-02 12:57 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: カオ・ヴァン・ドン,
	Mark Brown, Geert Uytterhoeven, linux-hwmon, Kuninori Morimoto,
	Yoshihiro Shimoda, Linux-Renesas, 稲吉,
	Dung:人ソ,
	Hoan Nguyen An, Marc Zyngier, Eduardo Valentin

CC  Marc, Eduardo

On Tue, Oct 2, 2018 at 2:50 PM Guenter Roeck <linux@roeck-us.net> wrote:
> On 10/02/2018 01:35 AM, Cao Van Dong wrote:
> > In __hwmon_device_register() function of hwmon.c, we have assigned 'dev' directly to 'hdev->parent'.
> > Formerly, when registering the hwmon device, we pass NULL as the device. This is not affected.
> > Recently, the developer has replaced the parameter NULL as the device by the actual device.
> > This causes the "No sensors found" error. This patch is to fix this error.
> >
> > This patch is based on the v4.19-rc3 tag.
> >
>
> NACK.
>
> This is wrong. The passed device is the hwmon driver's parent device. Using that device's
> parent would be wrong. Indeed, that device could be a platform device with no parent.
> The problem must be fixed in the calling code.
>
> Guenter
>
> > ---
> >   drivers/hwmon/hwmon.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/hwmon/hwmon.c b/drivers/hwmon/hwmon.c
> > index 33d5128..7c8d3cb 100644
> > --- a/drivers/hwmon/hwmon.c
> > +++ b/drivers/hwmon/hwmon.c
> > @@ -610,7 +610,7 @@ __hwmon_device_register(struct device *dev, const char *name, void *drvdata,
> >
> >       hwdev->name = name;
> >       hdev->class = &hwmon_class;
> > -     hdev->parent = dev;
> > +     hdev->parent = dev->parent;
> >       hdev->of_node = dev ? dev->of_node : NULL;
> >       hwdev->chip = chip;
> >       dev_set_drvdata(hdev, drvdata);

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] hwmon: Fix the 'No sensors found' error after replacing the parameter NULL by the actual device
  2018-10-02 12:56     ` Guenter Roeck
@ 2018-10-02 12:58       ` Geert Uytterhoeven
  2018-10-03  1:17       ` Cao Van Dong
  1 sibling, 0 replies; 11+ messages in thread
From: Geert Uytterhoeven @ 2018-10-02 12:58 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: カオ・ヴァン・ドン,
	Mark Brown, Geert Uytterhoeven, linux-hwmon, Kuninori Morimoto,
	Yoshihiro Shimoda, Linux-Renesas, 稲吉,
	Dung:人ソ,
	Hoan Nguyen An, Marc Zyngier, Eduardo Valentin

CC  Marc, Eduardo

On Tue, Oct 2, 2018 at 2:56 PM Guenter Roeck <linux@roeck-us.net> wrote:
>
> On 10/02/2018 02:06 AM, Cao Van Dong wrote:
> > Dear Geert-san,
> >
> > Thanks for your comment!
> >
> >>> In __hwmon_device_register() function of hwmon.c, we have assigned 'dev' directly to 'hdev->parent'.
> >>> Formerly, when registering the hwmon device, we pass NULL as the device. This is not affected.
> >>> Recently, the developer has replaced the parameter NULL as the device by the actual device.
> >> Do you know the commit ID of this recent change?
> >> It's useful for review of your change, and to know to which versions your
> >> patch should be backported.
> >
> > The commit ID of this recent change is"f6b6b52 thermal_hwmon: Pass the originating device down to hwmon_device_register_with_info".
> >
> If thermal doesn't want hwmon to use the thermal zone device, it should pass
> the parent of that device as parameter.
>
> >>> This causes the "No sensors found" error. This patch is to fix this error.
> >> On which platform do you see this failure?
> >> Thanks again!
> >
> > This error is found on Gen2 Lager board v4.19-rc2 by RVC team.
> >
>
> Some more details about the error would be useful.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] hwmon: Fix the 'No sensors found' error after replacing the parameter NULL by the actual device
  2018-10-02 12:56     ` Guenter Roeck
  2018-10-02 12:58       ` Geert Uytterhoeven
@ 2018-10-03  1:17       ` Cao Van Dong
  1 sibling, 0 replies; 11+ messages in thread
From: Cao Van Dong @ 2018-10-03  1:17 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Geert Uytterhoeven, Mark Brown, Geert Uytterhoeven, linux-hwmon,
	Kuninori Morimoto, Yoshihiro Shimoda, Linux-Renesas,
	稲吉, Dung:人ソ,
	Hoan Nguyen An

Dear Guente-san,

Thanks for your comment!
>>>> In __hwmon_device_register() function of hwmon.c, we have assigned 
>>>> 'dev' directly to 'hdev->parent'.
>>>> Formerly, when registering the hwmon device, we pass NULL as the 
>>>> device. This is not affected.
>>>> Recently, the developer has replaced the parameter NULL as the 
>>>> device by the actual device.
>>> Do you know the commit ID of this recent change?
>>> It's useful for review of your change, and to know to which versions 
>>> your
>>> patch should be backported.
>>
>> The commit ID of this recent change is"f6b6b52 thermal_hwmon: Pass 
>> the originating device down to hwmon_device_register_with_info".
>>
> If thermal doesn't want hwmon to use the thermal zone device, it 
> should pass
> the parent of that device as parameter.

I will see the feedback from Marc-san.
>
>>>> This causes the "No sensors found" error. This patch is to fix this 
>>>> error.
>>> On which platform do you see this failure?
>>> Thanks again!
>>
>> This error is found on Gen2 Lager board v4.19-rc2 by RVC team.
>>
>
> Some more details about the error would be useful.

Below are some information about confirm the error:

- Before the commit "f6b6b52ef7a54160c0a4d2b56a58f84a2e5b33c5" (pass 
NULL as the device):
"root@linaro-nano:~# sensors
  cpu_thermal-virtual-0
  Adapter: Virtual device
  temp1:        +30.0�°C  (crit = +95.0�°C)

  root@linaro-nano:~# "


- After the commit "f6b6b52ef7a54160c0a4d2b56a58f84a2e5b33c5" (pass the 
actual device):
"root@linaro-nano:~# sensors
  No sensors found!
  Make sure you loaded all the kernel drivers you need.
  Try sensors-detect to find out which these are.
  root@linaro-nano:~#"


- At my patch (change dev to dev->parent):
"root@linaro-nano:~# sensors
  cpu_thermal-virtual-0
  Adapter: Virtual device
  temp1:        +30.0�°C  (crit = +95.0�°C)

  root@linaro-nano:~#"


Regards,
Dong/Jinso

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] hwmon: Fix the 'No sensors found' error after replacing the parameter NULL by the actual device
  2018-10-02 12:50 ` Guenter Roeck
  2018-10-02 12:57   ` Geert Uytterhoeven
@ 2018-10-03  1:33   ` Cao Van Dong
  2018-10-03  3:04     ` Guenter Roeck
  1 sibling, 1 reply; 11+ messages in thread
From: Cao Van Dong @ 2018-10-03  1:33 UTC (permalink / raw)
  To: Guenter Roeck, broonie, geert+renesas, linux-hwmon
  Cc: kuninori.morimoto.gx, yoshihiro.shimoda.uh, linux-renesas-soc,
	h-inayoshi, nv-dung, na-hoan

Dear Guenter-san,

Thanks for your comment!

>> In __hwmon_device_register() function of hwmon.c, we have assigned 
>> 'dev' directly to 'hdev->parent'.
>> Formerly, when registering the hwmon device, we pass NULL as the 
>> device. This is not affected.
>> Recently, the developer has replaced the parameter NULL as the device 
>> by the actual device.
>> This causes the "No sensors found" error. This patch is to fix this 
>> error.
>>
>> This patch is based on the v4.19-rc3 tag.
>>
>
> NACK.
>
> This is wrong. The passed device is the hwmon driver's parent device. 
> Using that device's
> parent would be wrong. Indeed, that device could be a platform device 
> with no parent.
Maybe I did not know all problem. If I'm wrong, sorry for the inconvenience.

> The problem must be fixed in the calling code.
>
I will see the feedback from Marc-san.


Regards,
Dong/Jinso

>> ---
>>   drivers/hwmon/hwmon.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/hwmon/hwmon.c b/drivers/hwmon/hwmon.c
>> index 33d5128..7c8d3cb 100644
>> --- a/drivers/hwmon/hwmon.c
>> +++ b/drivers/hwmon/hwmon.c
>> @@ -610,7 +610,7 @@ __hwmon_device_register(struct device *dev, const 
>> char *name, void *drvdata,
>>         hwdev->name = name;
>>       hdev->class = &hwmon_class;
>> -    hdev->parent = dev;
>> +    hdev->parent = dev->parent;
>>       hdev->of_node = dev ? dev->of_node : NULL;
>>       hwdev->chip = chip;
>>       dev_set_drvdata(hdev, drvdata);

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] hwmon: Fix the 'No sensors found' error after replacing the parameter NULL by the actual device
  2018-10-03  1:33   ` Cao Van Dong
@ 2018-10-03  3:04     ` Guenter Roeck
  2018-10-03  3:16       ` Cao Van Dong
  0 siblings, 1 reply; 11+ messages in thread
From: Guenter Roeck @ 2018-10-03  3:04 UTC (permalink / raw)
  To: Cao Van Dong, broonie, geert+renesas, linux-hwmon
  Cc: kuninori.morimoto.gx, yoshihiro.shimoda.uh, linux-renesas-soc,
	h-inayoshi, nv-dung, na-hoan

On 10/02/2018 06:33 PM, Cao Van Dong wrote:
> Dear Guenter-san,
> 
> Thanks for your comment!
> 
>>> In __hwmon_device_register() function of hwmon.c, we have assigned 'dev' directly to 'hdev->parent'.
>>> Formerly, when registering the hwmon device, we pass NULL as the device. This is not affected.
>>> Recently, the developer has replaced the parameter NULL as the device by the actual device.
>>> This causes the "No sensors found" error. This patch is to fix this error.
>>>
>>> This patch is based on the v4.19-rc3 tag.
>>>
>>
>> NACK.
>>
>> This is wrong. The passed device is the hwmon driver's parent device. Using that device's
>> parent would be wrong. Indeed, that device could be a platform device with no parent.
> Maybe I did not know all problem. If I'm wrong, sorry for the inconvenience.
> 
>> The problem must be fixed in the calling code.
>>
> I will see the feedback from Marc-san.
> 

The "No sensors found" message is from the "sensors" application.
The device type associated with the passed device is unknown to
libsensors (it is parsed from the parent device subsystem name -
what is that, anyway ?). This could be addressed in libsensors,
or the thermal subsystem could attach itself to a known subsystem,
or the thermal subsystem must pass a pointer the parent device.

Again, trying to address the problem in the hwmon core is simply wrong.

Guenter

> 
> Regards,
> Dong/Jinso
> 
>>> ---
>>>   drivers/hwmon/hwmon.c | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/hwmon/hwmon.c b/drivers/hwmon/hwmon.c
>>> index 33d5128..7c8d3cb 100644
>>> --- a/drivers/hwmon/hwmon.c
>>> +++ b/drivers/hwmon/hwmon.c
>>> @@ -610,7 +610,7 @@ __hwmon_device_register(struct device *dev, const char *name, void *drvdata,
>>>         hwdev->name = name;
>>>       hdev->class = &hwmon_class;
>>> -    hdev->parent = dev;
>>> +    hdev->parent = dev->parent;
>>>       hdev->of_node = dev ? dev->of_node : NULL;
>>>       hwdev->chip = chip;
>>>       dev_set_drvdata(hdev, drvdata);
> 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] hwmon: Fix the 'No sensors found' error after replacing the parameter NULL by the actual device
  2018-10-03  3:04     ` Guenter Roeck
@ 2018-10-03  3:16       ` Cao Van Dong
  0 siblings, 0 replies; 11+ messages in thread
From: Cao Van Dong @ 2018-10-03  3:16 UTC (permalink / raw)
  To: Guenter Roeck, broonie, geert+renesas, linux-hwmon
  Cc: kuninori.morimoto.gx, yoshihiro.shimoda.uh, linux-renesas-soc,
	h-inayoshi, nv-dung, na-hoan

Dear Guenter-san,

Thanks for your comment!

>>>> In __hwmon_device_register() function of hwmon.c, we have assigned 
>>>> 'dev' directly to 'hdev->parent'.
>>>> Formerly, when registering the hwmon device, we pass NULL as the 
>>>> device. This is not affected.
>>>> Recently, the developer has replaced the parameter NULL as the 
>>>> device by the actual device.
>>>> This causes the "No sensors found" error. This patch is to fix this 
>>>> error.
>>>>
>>>> This patch is based on the v4.19-rc3 tag.
>>>>
>>>
>>> NACK.
>>>
>>> This is wrong. The passed device is the hwmon driver's parent 
>>> device. Using that device's
>>> parent would be wrong. Indeed, that device could be a platform 
>>> device with no parent.
>> Maybe I did not know all problem. If I'm wrong, sorry for the 
>> inconvenience.
>>
>>> The problem must be fixed in the calling code.
>>>
>> I will see the feedback from Marc-san.
>>
>
> The "No sensors found" message is from the "sensors" application.
> The device type associated with the passed device is unknown to
> libsensors (it is parsed from the parent device subsystem name -
> what is that, anyway ?). This could be addressed in libsensors,
> or the thermal subsystem could attach itself to a known subsystem,
> or the thermal subsystem must pass a pointer the parent device.
>
> Again, trying to address the problem in the hwmon core is simply wrong.
>
I will create other patch(v2) to fix for this error from the calling 
function.


Regards,
Dong/Jinso


>>>> ---
>>>>   drivers/hwmon/hwmon.c | 2 +-
>>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/hwmon/hwmon.c b/drivers/hwmon/hwmon.c
>>>> index 33d5128..7c8d3cb 100644
>>>> --- a/drivers/hwmon/hwmon.c
>>>> +++ b/drivers/hwmon/hwmon.c
>>>> @@ -610,7 +610,7 @@ __hwmon_device_register(struct device *dev, 
>>>> const char *name, void *drvdata,
>>>>         hwdev->name = name;
>>>>       hdev->class = &hwmon_class;
>>>> -    hdev->parent = dev;
>>>> +    hdev->parent = dev->parent;
>>>>       hdev->of_node = dev ? dev->of_node : NULL;
>>>>       hwdev->chip = chip;
>>>>       dev_set_drvdata(hdev, drvdata);

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-10-03  9:50 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-02  8:35 [PATCH] hwmon: Fix the 'No sensors found' error after replacing the parameter NULL by the actual device Cao Van Dong
2018-10-02  8:48 ` Geert Uytterhoeven
2018-10-02  9:06   ` Cao Van Dong
2018-10-02 12:56     ` Guenter Roeck
2018-10-02 12:58       ` Geert Uytterhoeven
2018-10-03  1:17       ` Cao Van Dong
2018-10-02 12:50 ` Guenter Roeck
2018-10-02 12:57   ` Geert Uytterhoeven
2018-10-03  1:33   ` Cao Van Dong
2018-10-03  3:04     ` Guenter Roeck
2018-10-03  3:16       ` Cao Van Dong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.