2020-10-16 20:00:39

by Vaishnav M A

[permalink] [raw]
Subject: [PATCH] iio: proximity: as3935 change of_property_read to device_property_read


This patch aims to replace the of_property_read_u32 for reading
the ams,tuning-capacitor-pf, ams,nflwdth properties with
device_property_read_u32.

Thanks and Regards,
Vaishnav M A

Signed-off-by: Vaishnav M A <[email protected]>
---
drivers/iio/proximity/as3935.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/iio/proximity/as3935.c b/drivers/iio/proximity/as3935.c
index c339e7339ec8..7e47ddf89a56 100644
--- a/drivers/iio/proximity/as3935.c
+++ b/drivers/iio/proximity/as3935.c
@@ -355,7 +355,6 @@ static int as3935_probe(struct spi_device *spi)
struct iio_dev *indio_dev;
struct iio_trigger *trig;
struct as3935_state *st;
- struct device_node *np = spi->dev.of_node;
int ret;

/* Be sure lightning event interrupt is specified */
@@ -374,7 +373,7 @@ static int as3935_probe(struct spi_device *spi)
spi_set_drvdata(spi, indio_dev);
mutex_init(&st->lock);

- ret = of_property_read_u32(np,
+ ret = device_property_read_u32(&spi->dev,
"ams,tuning-capacitor-pf", &st->tune_cap);
if (ret) {
st->tune_cap = 0;
@@ -390,7 +389,7 @@ static int as3935_probe(struct spi_device *spi)
return -EINVAL;
}

- ret = of_property_read_u32(np,
+ ret = device_property_read_u32(&spi->dev,
"ams,nflwdth", &st->nflwdth_reg);
if (!ret && st->nflwdth_reg > AS3935_NFLWDTH_MASK) {
dev_err(&spi->dev,
--
2.25.1


2020-10-17 22:30:25

by Matt Ranostay

[permalink] [raw]
Subject: Re: [PATCH] iio: proximity: as3935 change of_property_read to device_property_read

On Fri, Oct 16, 2020 at 11:41 AM Vaishnav M A <[email protected]> wrote:
>
>
> This patch aims to replace the of_property_read_u32 for reading
> the ams,tuning-capacitor-pf, ams,nflwdth properties with
> device_property_read_u32.
>
> Thanks and Regards,
> Vaishnav M A

Could you explain a bit more in the commit message why this is needed?

Also you pop comments that shouldn't be in the commit message below
the "---" line :)

>
> Signed-off-by: Vaishnav M A <[email protected]>
> ---
> drivers/iio/proximity/as3935.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/iio/proximity/as3935.c b/drivers/iio/proximity/as3935.c
> index c339e7339ec8..7e47ddf89a56 100644
> --- a/drivers/iio/proximity/as3935.c
> +++ b/drivers/iio/proximity/as3935.c
> @@ -355,7 +355,6 @@ static int as3935_probe(struct spi_device *spi)
> struct iio_dev *indio_dev;
> struct iio_trigger *trig;
> struct as3935_state *st;
> - struct device_node *np = spi->dev.of_node;
> int ret;
>
> /* Be sure lightning event interrupt is specified */
> @@ -374,7 +373,7 @@ static int as3935_probe(struct spi_device *spi)
> spi_set_drvdata(spi, indio_dev);
> mutex_init(&st->lock);
>
> - ret = of_property_read_u32(np,
> + ret = device_property_read_u32(&spi->dev,
> "ams,tuning-capacitor-pf", &st->tune_cap);
> if (ret) {
> st->tune_cap = 0;
> @@ -390,7 +389,7 @@ static int as3935_probe(struct spi_device *spi)
> return -EINVAL;
> }
>
> - ret = of_property_read_u32(np,
> + ret = device_property_read_u32(&spi->dev,
> "ams,nflwdth", &st->nflwdth_reg);
> if (!ret && st->nflwdth_reg > AS3935_NFLWDTH_MASK) {
> dev_err(&spi->dev,
> --
> 2.25.1
>

2020-10-18 03:56:47

by Vaishnav M A

[permalink] [raw]
Subject: Re: [PATCH] iio: proximity: as3935 change of_property_read to device_property_read

On Sun, Oct 18, 2020 at 3:57 AM Matt Ranostay
<[email protected]> wrote:
>
> On Fri, Oct 16, 2020 at 11:41 AM Vaishnav M A <[email protected]> wrote:
> >
> >
> > This patch aims to replace the of_property_read_u32 for reading
> > the ams,tuning-capacitor-pf, ams,nflwdth properties with
> > device_property_read_u32.
> >
> > Thanks and Regards,
> > Vaishnav M A
>
> Could you explain a bit more in the commit message why this is needed?
>
> Also you pop comments that shouldn't be in the commit message below
> the "---" line :)
>
Thanks for pointing this out, sorry for the mistake, I have updated the commit
message in the new v2 patch:
https://lore.kernel.org/patchwork/patch/1322170/
> >
> > Signed-off-by: Vaishnav M A <[email protected]>
> > ---
> > drivers/iio/proximity/as3935.c | 5 ++---
> > 1 file changed, 2 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/iio/proximity/as3935.c b/drivers/iio/proximity/as3935.c
> > index c339e7339ec8..7e47ddf89a56 100644
> > --- a/drivers/iio/proximity/as3935.c
> > +++ b/drivers/iio/proximity/as3935.c
> > @@ -355,7 +355,6 @@ static int as3935_probe(struct spi_device *spi)
> > struct iio_dev *indio_dev;
> > struct iio_trigger *trig;
> > struct as3935_state *st;
> > - struct device_node *np = spi->dev.of_node;
> > int ret;
> >
> > /* Be sure lightning event interrupt is specified */
> > @@ -374,7 +373,7 @@ static int as3935_probe(struct spi_device *spi)
> > spi_set_drvdata(spi, indio_dev);
> > mutex_init(&st->lock);
> >
> > - ret = of_property_read_u32(np,
> > + ret = device_property_read_u32(&spi->dev,
> > "ams,tuning-capacitor-pf", &st->tune_cap);
> > if (ret) {
> > st->tune_cap = 0;
> > @@ -390,7 +389,7 @@ static int as3935_probe(struct spi_device *spi)
> > return -EINVAL;
> > }
> >
> > - ret = of_property_read_u32(np,
> > + ret = device_property_read_u32(&spi->dev,
> > "ams,nflwdth", &st->nflwdth_reg);
> > if (!ret && st->nflwdth_reg > AS3935_NFLWDTH_MASK) {
> > dev_err(&spi->dev,
> > --
> > 2.25.1
> >