linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] iio: adc: mxs-lradc: Fix return value check in mxs_lradc_adc_probe()
@ 2017-04-25  3:36 Wei Yongjun
  2017-04-26  5:23 ` Jonathan Cameron
  2017-04-27 15:14 ` [PATCH -next v2] " Wei Yongjun
  0 siblings, 2 replies; 14+ messages in thread
From: Wei Yongjun @ 2017-04-25  3:36 UTC (permalink / raw)
  To: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, Ksenija Stanojevic, Lee Jones,
	Marek Vasut
  Cc: Wei Yongjun, linux-iio

From: Wei Yongjun <weiyongjun1@huawei.com>

In case of error, the function devm_ioremap() returns NULL pointer
not ERR_PTR(). The IS_ERR() test in the return value check should
be replaced with NULL test.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/iio/adc/mxs-lradc-adc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/adc/mxs-lradc-adc.c b/drivers/iio/adc/mxs-lradc-adc.c
index b0c7d8e..493e2a2 100644
--- a/drivers/iio/adc/mxs-lradc-adc.c
+++ b/drivers/iio/adc/mxs-lradc-adc.c
@@ -719,8 +719,8 @@ static int mxs_lradc_adc_probe(struct platform_device *pdev)
 
 	iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	adc->base = devm_ioremap(dev, iores->start, resource_size(iores));
-	if (IS_ERR(adc->base))
-		return PTR_ERR(adc->base);
+	if (!adc->base)
+		return -ENOMEM;
 
 	init_completion(&adc->completion);
 	spin_lock_init(&adc->lock);


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2017-06-03  9:53 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-25  3:36 [PATCH -next] iio: adc: mxs-lradc: Fix return value check in mxs_lradc_adc_probe() Wei Yongjun
2017-04-26  5:23 ` Jonathan Cameron
2017-04-26  8:49   ` Lee Jones
2017-04-26  8:58     ` weiyongjun (A)
2017-04-26 10:07       ` Lee Jones
2017-04-26 10:28         ` weiyongjun (A)
2017-04-26 15:02     ` Jonathan Cameron
2017-04-27 15:14 ` [PATCH -next v2] " Wei Yongjun
2017-04-30 16:31   ` Jonathan Cameron
2017-05-01 22:22     ` Ksenija Stanojević
2017-05-02  1:43       ` weiyongjun (A)
2017-05-16 15:26   ` [PATCH -next v3] " Wei Yongjun
2017-05-21 12:12     ` Jonathan Cameron
2017-06-03  9:53       ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).