All of lore.kernel.org
 help / color / mirror / Atom feed
From: Neelesh Gupta <neelegup@linux.vnet.ibm.com>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] [PATCH] hwmon: (ibmpowernv) Use of_property_read_u32 at appropriate place
Date: Mon, 04 Aug 2014 05:58:06 +0000	[thread overview]
Message-ID: <53DF1FF1.9@linux.vnet.ibm.com> (raw)
In-Reply-To: <1406867927.25393.1.camel@phoenix>


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

  reply	other threads:[~2014-08-04  5:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2014-08-04  8:23 ` Guenter Roeck
2014-08-04  9:08 ` Neelesh Gupta
2014-08-04 14:04 ` Guenter Roeck

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=53DF1FF1.9@linux.vnet.ibm.com \
    --to=neelegup@linux.vnet.ibm.com \
    --cc=lm-sensors@vger.kernel.org \
    /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 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.