* [PATCH v1] iio: ado: ad7192: Add error check and more debug log
@ 2023-06-12 12:15 Markus Burri
2023-06-12 19:40 ` andy.shevchenko
0 siblings, 1 reply; 6+ messages in thread
From: Markus Burri @ 2023-06-12 12:15 UTC (permalink / raw)
To: linux-kernel
Cc: Markus Burri, Lars-Peter Clausen, Michael Hennerich,
Alexandru Tachici, Jonathan Cameron, linux-iio
Print read and expected device ID as debug warning.
Add error check for sd_sd_init() result.
Signed-off-by: Markus Burri <markus.burri@mt.com>
---
drivers/iio/adc/ad7192.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/iio/adc/ad7192.c b/drivers/iio/adc/ad7192.c
index d71977b..220c3b7 100644
--- a/drivers/iio/adc/ad7192.c
+++ b/drivers/iio/adc/ad7192.c
@@ -403,8 +403,8 @@ static int ad7192_setup(struct ad7192_state *st, struct device_node *np)
id &= AD7192_ID_MASK;
if (id != st->chip_info->chip_id)
- dev_warn(&st->sd.spi->dev, "device ID query failed (0x%X)\n",
- id);
+ dev_warn(&st->sd.spi->dev, "device ID query failed (0x%X != 0x%X)\n",
+ id, st->chip_info->chip_id);
st->mode = AD7192_MODE_SEL(AD7192_MODE_IDLE) |
AD7192_MODE_CLKSRC(st->clock_sel) |
@@ -1049,7 +1049,9 @@ static int ad7192_probe(struct spi_device *spi)
else
indio_dev->info = &ad7192_info;
- ad_sd_init(&st->sd, indio_dev, spi, &ad7192_sigma_delta_info);
+ ret = ad_sd_init(&st->sd, indio_dev, spi, &ad7192_sigma_delta_info);
+ if (ret)
+ return ret;
ret = devm_ad_sd_setup_buffer_and_trigger(&spi->dev, indio_dev);
if (ret)
--
2.39.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v1] iio: ado: ad7192: Add error check and more debug log
2023-06-12 12:15 [PATCH v1] iio: ado: ad7192: Add error check and more debug log Markus Burri
@ 2023-06-12 19:40 ` andy.shevchenko
0 siblings, 0 replies; 6+ messages in thread
From: andy.shevchenko @ 2023-06-12 19:40 UTC (permalink / raw)
To: Markus Burri
Cc: linux-kernel, Lars-Peter Clausen, Michael Hennerich,
Alexandru Tachici, Jonathan Cameron, linux-iio
Mon, Jun 12, 2023 at 02:15:54PM +0200, Markus Burri kirjoitti:
> Print read and expected device ID as debug warning.
> Add error check for sd_sd_init() result.
sd_sd_...?
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v1] iio: ado: ad7192: Add error check and more debug log
@ 2023-06-13 5:42 Markus Burri
2023-06-13 8:19 ` Nuno Sá
0 siblings, 1 reply; 6+ messages in thread
From: Markus Burri @ 2023-06-13 5:42 UTC (permalink / raw)
To: linux-kernel
Cc: Markus Burri, Alexandru Tachici, Lars-Peter Clausen,
Michael Hennerich, Jonathan Cameron, linux-iio
Print read and expected device ID as debug warning.
Add error check for ad_sd_init() result.
Signed-off-by: Markus Burri <markus.burri@mt.com>
---
drivers/iio/adc/ad7192.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/iio/adc/ad7192.c b/drivers/iio/adc/ad7192.c
index d71977b..220c3b7 100644
--- a/drivers/iio/adc/ad7192.c
+++ b/drivers/iio/adc/ad7192.c
@@ -403,8 +403,8 @@ static int ad7192_setup(struct ad7192_state *st, struct device_node *np)
id &= AD7192_ID_MASK;
if (id != st->chip_info->chip_id)
- dev_warn(&st->sd.spi->dev, "device ID query failed (0x%X)\n",
- id);
+ dev_warn(&st->sd.spi->dev, "device ID query failed (0x%X != 0x%X)\n",
+ id, st->chip_info->chip_id);
st->mode = AD7192_MODE_SEL(AD7192_MODE_IDLE) |
AD7192_MODE_CLKSRC(st->clock_sel) |
@@ -1049,7 +1049,9 @@ static int ad7192_probe(struct spi_device *spi)
else
indio_dev->info = &ad7192_info;
- ad_sd_init(&st->sd, indio_dev, spi, &ad7192_sigma_delta_info);
+ ret = ad_sd_init(&st->sd, indio_dev, spi, &ad7192_sigma_delta_info);
+ if (ret)
+ return ret;
ret = devm_ad_sd_setup_buffer_and_trigger(&spi->dev, indio_dev);
if (ret)
--
2.39.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v1] iio: ado: ad7192: Add error check and more debug log
2023-06-13 5:42 Markus Burri
@ 2023-06-13 8:19 ` Nuno Sá
2023-06-13 8:46 ` Nuno Sá
0 siblings, 1 reply; 6+ messages in thread
From: Nuno Sá @ 2023-06-13 8:19 UTC (permalink / raw)
To: Markus Burri, linux-kernel
Cc: Alexandru Tachici, Lars-Peter Clausen, Michael Hennerich,
Jonathan Cameron, linux-iio
On Tue, 2023-06-13 at 07:42 +0200, Markus Burri wrote:
> Print read and expected device ID as debug warning.
> Add error check for ad_sd_init() result.
>
> Signed-off-by: Markus Burri <markus.burri@mt.com>
> ---
You have unrelated changes but they are easy enough to go in same patch
(at least for me). Hence:
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
> drivers/iio/adc/ad7192.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/iio/adc/ad7192.c b/drivers/iio/adc/ad7192.c
> index d71977b..220c3b7 100644
> --- a/drivers/iio/adc/ad7192.c
> +++ b/drivers/iio/adc/ad7192.c
> @@ -403,8 +403,8 @@ static int ad7192_setup(struct ad7192_state *st, struct
> device_node *np)
> id &= AD7192_ID_MASK;
>
> if (id != st->chip_info->chip_id)
> - dev_warn(&st->sd.spi->dev, "device ID query failed (0x%X)\n",
> - id);
> + dev_warn(&st->sd.spi->dev, "device ID query failed (0x%X !=
> 0x%X)\n",
> + id, st->chip_info->chip_id);
>
> st->mode = AD7192_MODE_SEL(AD7192_MODE_IDLE) |
> AD7192_MODE_CLKSRC(st->clock_sel) |
> @@ -1049,7 +1049,9 @@ static int ad7192_probe(struct spi_device *spi)
> else
> indio_dev->info = &ad7192_info;
>
> - ad_sd_init(&st->sd, indio_dev, spi, &ad7192_sigma_delta_info);
> + ret = ad_sd_init(&st->sd, indio_dev, spi, &ad7192_sigma_delta_info);
> + if (ret)
> + return ret;
>
> ret = devm_ad_sd_setup_buffer_and_trigger(&spi->dev, indio_dev);
> if (ret)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v1] iio: ado: ad7192: Add error check and more debug log
2023-06-13 8:19 ` Nuno Sá
@ 2023-06-13 8:46 ` Nuno Sá
2023-06-14 7:15 ` Jonathan Cameron
0 siblings, 1 reply; 6+ messages in thread
From: Nuno Sá @ 2023-06-13 8:46 UTC (permalink / raw)
To: Markus Burri, linux-kernel
Cc: Alexandru Tachici, Lars-Peter Clausen, Michael Hennerich,
Jonathan Cameron, linux-iio
On Tue, 2023-06-13 at 10:19 +0200, Nuno Sá wrote:
> On Tue, 2023-06-13 at 07:42 +0200, Markus Burri wrote:
> > Print read and expected device ID as debug warning.
> > Add error check for ad_sd_init() result.
> >
> > Signed-off-by: Markus Burri <markus.burri@mt.com>
> > ---
>
> You have unrelated changes but they are easy enough to go in same patch
> (at least for me). Hence:
>
Actually, consider my tag valid after fixing the typo you have in the commit
message...
> Reviewed-by: Nuno Sa <nuno.sa@analog.com>
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v1] iio: ado: ad7192: Add error check and more debug log
2023-06-13 8:46 ` Nuno Sá
@ 2023-06-14 7:15 ` Jonathan Cameron
0 siblings, 0 replies; 6+ messages in thread
From: Jonathan Cameron @ 2023-06-14 7:15 UTC (permalink / raw)
To: Nuno Sá
Cc: Markus Burri, linux-kernel, Alexandru Tachici, Lars-Peter Clausen,
Michael Hennerich, linux-iio
On Tue, 13 Jun 2023 10:46:30 +0200
Nuno Sá <noname.nuno@gmail.com> wrote:
> On Tue, 2023-06-13 at 10:19 +0200, Nuno Sá wrote:
> > On Tue, 2023-06-13 at 07:42 +0200, Markus Burri wrote:
> > > Print read and expected device ID as debug warning.
> > > Add error check for ad_sd_init() result.
> > >
> > > Signed-off-by: Markus Burri <markus.burri@mt.com>
> > > ---
> >
> > You have unrelated changes but they are easy enough to go in same patch
> > (at least for me). Hence:
> >
>
> Actually, consider my tag valid after fixing the typo you have in the commit
> message...
>
This is also v2... So patch title should reflect that.
(well v3 for next version with the typo fixed)
> > Reviewed-by: Nuno Sa <nuno.sa@analog.com>
> >
> >
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-06-14 7:16 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-12 12:15 [PATCH v1] iio: ado: ad7192: Add error check and more debug log Markus Burri
2023-06-12 19:40 ` andy.shevchenko
-- strict thread matches above, loose matches on Subject: below --
2023-06-13 5:42 Markus Burri
2023-06-13 8:19 ` Nuno Sá
2023-06-13 8:46 ` Nuno Sá
2023-06-14 7:15 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox