All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Vaishnav M A <vaishnav@beagleboard.org>
Cc: knaack.h@gmx.de, lars@metafoo.de, alexandru.ardelean@analog.com,
	nish.malpani25@gmail.com, matt.ranostay@konsulko.com,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	jkridner@beagleboard.org, drew@beagleboard.org,
	robertcnelson@beagleboard.org, rajkovic@mikroe.com
Subject: Re: [PATCH v2] iio: light: tsl2563 change of_property_read to device_property_read
Date: Sun, 18 Oct 2020 12:24:57 +0100	[thread overview]
Message-ID: <20201018122457.51a54ffd@archlinux> (raw)
In-Reply-To: <20201018032543.GA27580@ubuntu>

On Sun, 18 Oct 2020 08:55:43 +0530
Vaishnav M A <vaishnav@beagleboard.org> wrote:

> replace the of_property_read_u32 for reading the amstaos,cover-comp-gain
> property with device_property_read_u32,allows the driver to
> get the properties information using the more generic device_property_*
> helpers and opens the possibility of passing the properties during
> platform instantiation of the device by a suitably populated
> struct property_entry.
> 
> Signed-off-by: Vaishnav M A <vaishnav@beagleboard.org>
See review for v1. Most of it still applies, I just hadn't realised
you'd sent a v2.  As I mentioned on one of your other patches, if
you send a v2 without any comments on v1, please reply yourself to say
you have done so.  Otherwise, people may well review the wrong version.

Thanks,

Jonathan

> ---
>  v2:
> 	- fix commit message
>  drivers/iio/light/tsl2563.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/iio/light/tsl2563.c b/drivers/iio/light/tsl2563.c
> index abc8d7db8dc1..1f1b8b7cefa4 100644
> --- a/drivers/iio/light/tsl2563.c
> +++ b/drivers/iio/light/tsl2563.c
> @@ -703,7 +703,6 @@ static int tsl2563_probe(struct i2c_client *client,
>  	struct iio_dev *indio_dev;
>  	struct tsl2563_chip *chip;
>  	struct tsl2563_platform_data *pdata = client->dev.platform_data;
> -	struct device_node *np = client->dev.of_node;
>  	int err = 0;
>  	u8 id = 0;
>  
> @@ -738,13 +737,14 @@ static int tsl2563_probe(struct i2c_client *client,
>  	chip->calib0 = tsl2563_calib_from_sysfs(CALIB_BASE_SYSFS);
>  	chip->calib1 = tsl2563_calib_from_sysfs(CALIB_BASE_SYSFS);
>  
> -	if (pdata)
> +	if (pdata) {
>  		chip->cover_comp_gain = pdata->cover_comp_gain;
> -	else if (np)
> -		of_property_read_u32(np, "amstaos,cover-comp-gain",
> -				     &chip->cover_comp_gain);
> -	else
> -		chip->cover_comp_gain = 1;
> +	} else {
> +		err = device_property_read_u32(&client->dev, "amstaos,cover-comp-gain",
> +					       &chip->cover_comp_gain);
> +		if (err)
> +			chip->cover_comp_gain = 1;
> +	}
>  
>  	dev_info(&client->dev, "model %d, rev. %d\n", id >> 4, id & 0x0f);
>  	indio_dev->name = client->name;


  reply	other threads:[~2020-10-18 11:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-18  3:25 [PATCH v2] iio: light: tsl2563 change of_property_read to device_property_read Vaishnav M A
2020-10-18 11:24 ` Jonathan Cameron [this message]
2020-10-18 11:35 ` Jonathan Cameron
2020-10-18 14:44   ` Vaishnav M A
2020-10-18 20:42     ` Vaishnav M A

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=20201018122457.51a54ffd@archlinux \
    --to=jic23@kernel.org \
    --cc=alexandru.ardelean@analog.com \
    --cc=drew@beagleboard.org \
    --cc=jkridner@beagleboard.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matt.ranostay@konsulko.com \
    --cc=nish.malpani25@gmail.com \
    --cc=rajkovic@mikroe.com \
    --cc=robertcnelson@beagleboard.org \
    --cc=vaishnav@beagleboard.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.