iio: proximity: as3935 change of_property_read to device_property_read
PATCH v2 1/1 iio: proximity: as3935 change of_property_read to device_property_read
replace the of_property_read_u32 for reading
the ams,tuning-capacitor-pf, ams,nflwdth properties 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
---
v2:
- fix commit message
drivers/iio/proximity/as3935.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/iio/proximity/as3935.c +2 -3
@@ -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,
Signature · 1 line
2.25.1
Jonathan Cameron
maintainerOn Sun, 18 Oct 2020 08:47:32 +0530
Vaishnav M A <[email protected]> wrote:
A very similar change was made recently in00fa493b9989 ("iio:proximity:as3935: Drop of_match_ptr and use generic fw accessors")
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=00fa493b99894b930e431c05a9dba294c5189120
Review follows for reference as I wrote it before remembering the above!
Quoted 6 lines
replace the
of_property_read_u32for reading
the ams,tuning-capacitor-pf, ams,nflwdth properties withdevice_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 structproperty_entry
Please format this to aid readability.
Replace of_property_read_u32() with device_property_read_u32, when reading the ams,tuning-capacitor-pf and ams,nflwdth properties. This opens up the possibility of passing the properties during platform instantiation of the device by a suitable populated struct property_entry.
As in your other patch, please add the header property.h.
Quoted 38 lines
Signed-off-by Vaishnav M A <[email protected]>---
v2:
- fix commit messagedrivers/iio/proximity/as3935.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)drivers/iio/proximity/as3935.c +2
-3@@ -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,
Quoted 8 lines · Jonathan Cameron
On Sun, 18 Oct 2020 08:47:32 +0530
Vaishnav M A <[email protected]> wrote:A very similar change was made recently in
00fa493b9989("iio:proximity:as3935: Dropof_match_ptrand use generic fw accessors")
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=00fa493b99894b930e431c05a9dba294c5189120
Sorry for missing that, happy to see this change.
Thanks,
Vaishnav M A
Quoted 58 lines
Review follows for reference as I wrote it before remembering the above!
Quoted 6 lines
replace the
of_property_read_u32for reading
the ams,tuning-capacitor-pf, ams,nflwdth properties withdevice_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 structproperty_entryPlease format this to aid readability.
Replace
of_property_read_u32()withdevice_property_read_u32, when reading the ams,tuning-capacitor-pf and ams,nflwdth properties. This opens up the possibility of passing the properties during platform instantiation of the device by a suitable populated structproperty_entry.As in your other patch, please add the header
property.h.Quoted 38 lines
Signed-off-by Vaishnav M A <[email protected]>---
v2:
- fix commit messagedrivers/iio/proximity/as3935.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)drivers/iio/proximity/as3935.c +2
-3@@ -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,