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 55381C433F5 for ; Mon, 22 Nov 2021 14:46:41 +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=qSdKzOwuKF6Bcqp5zVvCgB7mZxFlwMKLrmCCBhRNbnQ=; b=T940qsnF12yYrw HHT1jDfdoXair5tkpqQw9Zav7NECLHR3huIbgShS2jxzTaDNfM3CuuBHjCXduN+vOuiEWhzoq0hI3 t6HCtAR5j6RjYV2IkuEga6YGBr43WxftHdQtbDOU/T+jo0P1KsBiliNX1MVy/t4YQXc52Decw366t Cnno2G1XQb5/pqmI3aSTHJUHuHj9HEDeiLwEu7zOnDJecMaFnNP7hZ5nGdA2GsYdVmjv0ODoK/XOS 0ZxbJHAao5pwhUvdBYxmYbbFR7cbt2aaRSZfhghrWfvSkeAC0Qt3BYS9i8rGTVKYu164oBgtJx6tX P7PnH2Mu1xQmmZ1l8bFg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mpAZE-00GvFM-0L; Mon, 22 Nov 2021 14:45:12 +0000 Received: from frasgout.his.huawei.com ([185.176.79.56]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mpAZ8-00GvCt-LX for linux-arm-kernel@lists.infradead.org; Mon, 22 Nov 2021 14:45:08 +0000 Received: from fraeml740-chm.china.huawei.com (unknown [172.18.147.201]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4HyVQZ0wGkz6H7s9; Mon, 22 Nov 2021 22:44:06 +0800 (CST) Received: from lhreml710-chm.china.huawei.com (10.201.108.61) by fraeml740-chm.china.huawei.com (10.206.15.221) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Mon, 22 Nov 2021 15:45:03 +0100 Received: from localhost (10.202.226.41) by lhreml710-chm.china.huawei.com (10.201.108.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Mon, 22 Nov 2021 14:45:02 +0000 Date: Mon, 22 Nov 2021 14:45:01 +0000 From: Jonathan Cameron To: Ahmad Fatoum CC: Olivier Moysan , Alexandre Torgue , Fabrice Gasnier , Jonathan Cameron , 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: <20211122144501.000014a3@Huawei.com> In-Reply-To: <2ca4ad17-d7e5-f4be-1596-7c7de0fa5661@pengutronix.de> References: <20211122143809.2332-1-olivier.moysan@foss.st.com> <2ca4ad17-d7e5-f4be-1596-7c7de0fa5661@pengutronix.de> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.29; i686-w64-mingw32) MIME-Version: 1.0 X-Originating-IP: [10.202.226.41] X-ClientProxiedBy: lhreml737-chm.china.huawei.com (10.201.108.187) To lhreml710-chm.china.huawei.com (10.201.108.61) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211122_064506_944041_55821465 X-CRM114-Status: GOOD ( 18.67 ) 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 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. > > 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