From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6865CC433EF for ; Sat, 27 Nov 2021 16:07:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+5m4tyiYs/+Cr1Vod6JcmnqRhgc+Iwhx1J9RBDMjniM=; b=rrZyWvHY8ZBESl Ydj/yfQxsk+etelsWAUDBd2gF0dZjl1niUXI9q0SKwjnEc/QfbMNys53nByMti9dvSGVKgleEs9ma +jY8d2lspVAOyTQ8vEhnLe1cmbLUE4coDyltxcMnOIxsV3hykP+eQzhOip4X1WPZNoAshN9L7gfIB NlEOXxKG3L7i4ILRwN9T3V1c8MRCA1Yba+AHE0+nxP58YlcHzmEY8ZSlSX8luGQGA3zw38KRy1cnO PdqTzbZUXWvNI4PVaBg29zl/d56QnumflQufxuj569NqCpa2TEOuAACoo6oqXdSPUEgEeDmsQz/8A /r8zz3Uq3b11Rt+B6EFg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mr0Cl-00Dy5W-9Z; Sat, 27 Nov 2021 16:05:35 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mr0Ch-00Dy4n-PB for linux-arm-kernel@lists.infradead.org; Sat, 27 Nov 2021 16:05:33 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4ED4D60EC1; Sat, 27 Nov 2021 16:05:30 +0000 (UTC) Received: from jic23-huawei (cpc108967-cmbg20-2-0-cust86.5-4.cable.virginm.net [81.101.6.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.kernel.org (Postfix) with ESMTPSA id 61591C53FBF; Sat, 27 Nov 2021 16:05:25 +0000 (UTC) Date: Sat, 27 Nov 2021 16:10:26 +0000 From: Jonathan Cameron To: Jonathan Cameron Cc: Ahmad Fatoum , Olivier Moysan , Alexandre Torgue , Fabrice Gasnier , Lars-Peter Clausen , Maxime Coquelin , Wan Jiabing , Xu Wang , , , , Subject: Re: [PATCH v2] iio: adc: stm32: fix null pointer on defer_probe error Message-ID: <20211127161026.2e725d5a@jic23-huawei> In-Reply-To: <20211122144501.000014a3@Huawei.com> References: <20211122143809.2332-1-olivier.moysan@foss.st.com> <2ca4ad17-d7e5-f4be-1596-7c7de0fa5661@pengutronix.de> <20211122144501.000014a3@Huawei.com> X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211127_080531_917506_2823BF96 X-CRM114-Status: GOOD ( 24.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, 22 Nov 2021 14:45:01 +0000 Jonathan Cameron wrote: > On Mon, 22 Nov 2021 15:41:10 +0100 > Ahmad Fatoum 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. Applied to the fixes-togreg branch of iio.git. I'll probably do a pull request later this week, Jonathan > > > > Signed-off-by: Olivier Moysan > > > > Reviewed-by: Ahmad Fatoum > > > > > --- > > > 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) > > > > > > > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel