* Re: [lm-sensors] [PATCH] hwmon: (ibmpowernv) Use of_property_read_u32 at appropriate place
2014-08-01 4:38 [lm-sensors] [PATCH] hwmon: (ibmpowernv) Use of_property_read_u32 at appropriate place Axel Lin
@ 2014-08-04 5:58 ` Neelesh Gupta
2014-08-04 8:23 ` Guenter Roeck
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Neelesh Gupta @ 2014-08-04 5:58 UTC (permalink / raw)
To: lm-sensors
On 08/01/2014 10:08 AM, Axel Lin wrote:
> Simplify the code a bit and also improve readability.
Verified the patch in my test environment and it works fine.
Thanks,
- Neelesh
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
> drivers/hwmon/ibmpowernv.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/hwmon/ibmpowernv.c b/drivers/hwmon/ibmpowernv.c
> index e6b652a..d2bf2c9 100644
> --- a/drivers/hwmon/ibmpowernv.c
> +++ b/drivers/hwmon/ibmpowernv.c
> @@ -227,7 +227,7 @@ static int __init create_device_attrs(struct platform_device *pdev)
> const struct attribute_group **pgroups = pdata->attr_groups;
> struct device_node *opal, *np;
> struct sensor_data *sdata;
> - const __be32 *sensor_id;
> + u32 sensor_id;
> enum sensors type;
> u32 count = 0;
> int err = 0;
> @@ -252,15 +252,14 @@ static int __init create_device_attrs(struct platform_device *pdev)
> if (type = MAX_SENSOR_TYPE)
> continue;
>
> - sensor_id = of_get_property(np, "sensor-id", NULL);
> - if (!sensor_id) {
> + if (of_property_read_u32(np, "sensor-id", &sensor_id)) {
> dev_info(&pdev->dev,
> "'sensor-id' missing in the node '%s'\n",
> np->name);
> continue;
> }
>
> - sdata[count].id = be32_to_cpup(sensor_id);
> + sdata[count].id = sensor_id;
> sdata[count].type = type;
> err = create_hwmon_attr_name(&pdev->dev, type, np->name,
> sdata[count].name);
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [lm-sensors] [PATCH] hwmon: (ibmpowernv) Use of_property_read_u32 at appropriate place
2014-08-01 4:38 [lm-sensors] [PATCH] hwmon: (ibmpowernv) Use of_property_read_u32 at appropriate place Axel Lin
2014-08-04 5:58 ` Neelesh Gupta
@ 2014-08-04 8:23 ` Guenter Roeck
2014-08-04 9:08 ` Neelesh Gupta
2014-08-04 14:04 ` Guenter Roeck
3 siblings, 0 replies; 5+ messages in thread
From: Guenter Roeck @ 2014-08-04 8:23 UTC (permalink / raw)
To: lm-sensors
On 08/03/2014 10:53 PM, Neelesh Gupta wrote:
>
> On 08/01/2014 10:08 AM, Axel Lin wrote:
>> Simplify the code a bit and also improve readability.
>
> Verified the patch in my test environment and it works fine.
>
Great. Can I add your Tested-by: tag ?
Thanks,
Guenter
> Thanks,
> - Neelesh
>
>>
>> Signed-off-by: Axel Lin <axel.lin@ingics.com>
>> ---
>> drivers/hwmon/ibmpowernv.c | 7 +++----
>> 1 file changed, 3 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/hwmon/ibmpowernv.c b/drivers/hwmon/ibmpowernv.c
>> index e6b652a..d2bf2c9 100644
>> --- a/drivers/hwmon/ibmpowernv.c
>> +++ b/drivers/hwmon/ibmpowernv.c
>> @@ -227,7 +227,7 @@ static int __init create_device_attrs(struct platform_device *pdev)
>> const struct attribute_group **pgroups = pdata->attr_groups;
>> struct device_node *opal, *np;
>> struct sensor_data *sdata;
>> - const __be32 *sensor_id;
>> + u32 sensor_id;
>> enum sensors type;
>> u32 count = 0;
>> int err = 0;
>> @@ -252,15 +252,14 @@ static int __init create_device_attrs(struct platform_device *pdev)
>> if (type = MAX_SENSOR_TYPE)
>> continue;
>>
>> - sensor_id = of_get_property(np, "sensor-id", NULL);
>> - if (!sensor_id) {
>> + if (of_property_read_u32(np, "sensor-id", &sensor_id)) {
>> dev_info(&pdev->dev,
>> "'sensor-id' missing in the node '%s'\n",
>> np->name);
>> continue;
>> }
>>
>> - sdata[count].id = be32_to_cpup(sensor_id);
>> + sdata[count].id = sensor_id;
>> sdata[count].type = type;
>> err = create_hwmon_attr_name(&pdev->dev, type, np->name,
>> sdata[count].name);
>
>
>
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [lm-sensors] [PATCH] hwmon: (ibmpowernv) Use of_property_read_u32 at appropriate place
2014-08-01 4:38 [lm-sensors] [PATCH] hwmon: (ibmpowernv) Use of_property_read_u32 at appropriate place Axel Lin
2014-08-04 5:58 ` Neelesh Gupta
2014-08-04 8:23 ` Guenter Roeck
@ 2014-08-04 9:08 ` Neelesh Gupta
2014-08-04 14:04 ` Guenter Roeck
3 siblings, 0 replies; 5+ messages in thread
From: Neelesh Gupta @ 2014-08-04 9:08 UTC (permalink / raw)
To: lm-sensors
On 08/04/2014 01:53 PM, Guenter Roeck wrote:
> On 08/03/2014 10:53 PM, Neelesh Gupta wrote:
>>
>> On 08/01/2014 10:08 AM, Axel Lin wrote:
>>> Simplify the code a bit and also improve readability.
>>
>> Verified the patch in my test environment and it works fine.
>>
> Great. Can I add your Tested-by: tag ?
Sure.
Neelesh
>
> Thanks,
> Guenter
>
>> Thanks,
>> - Neelesh
>>
>>>
>>> Signed-off-by: Axel Lin <axel.lin@ingics.com>
>>> ---
>>> drivers/hwmon/ibmpowernv.c | 7 +++----
>>> 1 file changed, 3 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/drivers/hwmon/ibmpowernv.c b/drivers/hwmon/ibmpowernv.c
>>> index e6b652a..d2bf2c9 100644
>>> --- a/drivers/hwmon/ibmpowernv.c
>>> +++ b/drivers/hwmon/ibmpowernv.c
>>> @@ -227,7 +227,7 @@ static int __init create_device_attrs(struct
>>> platform_device *pdev)
>>> const struct attribute_group **pgroups = pdata->attr_groups;
>>> struct device_node *opal, *np;
>>> struct sensor_data *sdata;
>>> - const __be32 *sensor_id;
>>> + u32 sensor_id;
>>> enum sensors type;
>>> u32 count = 0;
>>> int err = 0;
>>> @@ -252,15 +252,14 @@ static int __init create_device_attrs(struct
>>> platform_device *pdev)
>>> if (type = MAX_SENSOR_TYPE)
>>> continue;
>>>
>>> - sensor_id = of_get_property(np, "sensor-id", NULL);
>>> - if (!sensor_id) {
>>> + if (of_property_read_u32(np, "sensor-id", &sensor_id)) {
>>> dev_info(&pdev->dev,
>>> "'sensor-id' missing in the node '%s'\n",
>>> np->name);
>>> continue;
>>> }
>>>
>>> - sdata[count].id = be32_to_cpup(sensor_id);
>>> + sdata[count].id = sensor_id;
>>> sdata[count].type = type;
>>> err = create_hwmon_attr_name(&pdev->dev, type, np->name,
>>> sdata[count].name);
>>
>>
>>
>
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [lm-sensors] [PATCH] hwmon: (ibmpowernv) Use of_property_read_u32 at appropriate place
2014-08-01 4:38 [lm-sensors] [PATCH] hwmon: (ibmpowernv) Use of_property_read_u32 at appropriate place Axel Lin
` (2 preceding siblings ...)
2014-08-04 9:08 ` Neelesh Gupta
@ 2014-08-04 14:04 ` Guenter Roeck
3 siblings, 0 replies; 5+ messages in thread
From: Guenter Roeck @ 2014-08-04 14:04 UTC (permalink / raw)
To: lm-sensors
On 07/31/2014 09:38 PM, Axel Lin wrote:
> Simplify the code a bit and also improve readability.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
Applied to -next.
Guenter
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 5+ messages in thread