[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211122144501.000014a3@Huawei.com>
Date: Mon, 22 Nov 2021 14:45:01 +0000
From: Jonathan Cameron <Jonathan.Cameron@...wei.com>
To: Ahmad Fatoum <a.fatoum@...gutronix.de>
CC: Olivier Moysan <olivier.moysan@...s.st.com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
Fabrice Gasnier <fabrice.gasnier@...s.st.com>,
Jonathan Cameron <jic23@...nel.org>,
Lars-Peter Clausen <lars@...afoo.de>,
Maxime Coquelin <mcoquelin.stm32@...il.com>,
Wan Jiabing <wanjiabing@...o.com>, Xu Wang <vulab@...as.ac.cn>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-iio@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-stm32@...md-mailman.stormreply.com>
Subject: Re: [PATCH v2] iio: adc: stm32: fix null pointer on defer_probe
error
On Mon, 22 Nov 2021 15:41:10 +0100
Ahmad Fatoum <a.fatoum@...gutronix.de> wrote:
> On 22.11.21 15:38, Olivier Moysan wrote:
> > dev_err_probe() calls __device_set_deferred_probe_reason()
> > on -EPROBE_DEFER error. If device pointer to driver core
> > private structure is not initialized, an null pointer error occurs.
> > This pointer is set on iio_device_register() call for iio device.
> >
> > dev_err_probe() must be called with the device which is probing.
> > Replace iio device by its parent device.
> >
> > Fixes: 0e346b2cfa85 ("iio: adc: stm32-adc: add vrefint calibration support")
> >
I'll fix it when applying, but no blank line between Fixes tag and the others.
> > Signed-off-by: Olivier Moysan <olivier.moysan@...s.st.com>
>
> Reviewed-by: Ahmad Fatoum <a.fatoum@...gutronix.de>
>
> > ---
> > Changes in v2:
> > - Use parent device from indio_dev instead of private structure
> > ---
> > drivers/iio/adc/stm32-adc.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/iio/adc/stm32-adc.c b/drivers/iio/adc/stm32-adc.c
> > index 7f1fb36c747c..341afdd342cc 100644
> > --- a/drivers/iio/adc/stm32-adc.c
> > +++ b/drivers/iio/adc/stm32-adc.c
> > @@ -1986,7 +1986,7 @@ static int stm32_adc_populate_int_ch(struct iio_dev *indio_dev, const char *ch_n
> > /* Get calibration data for vrefint channel */
> > ret = nvmem_cell_read_u16(&indio_dev->dev, "vrefint", &vrefint);
> > if (ret && ret != -ENOENT) {
> > - return dev_err_probe(&indio_dev->dev, ret,
> > + return dev_err_probe(indio_dev->dev.parent, ret,
> > "nvmem access error\n");
> > }
> > if (ret == -ENOENT)
> >
>
>
Powered by blists - more mailing lists