All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] iio: adc: checking for NULL instead of IS_ERR() in probe
@ 2014-03-28  8:33 ` Dan Carpenter
  0 siblings, 0 replies; 12+ messages in thread
From: Dan Carpenter @ 2014-03-28  8:33 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Johannes Thumshirn, Greg Kroah-Hartman, linux-iio,
	kernel-janitors

mcb_request_mem() returns an ERR_PTR(), it doesn't return NULL.

Fixes: 74aeac4da66f ('iio: adc: Add MEN 16z188 ADC driver')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/iio/adc/men_z188_adc.c b/drivers/iio/adc/men_z188_adc.c
index 6989c16..b58d630 100644
--- a/drivers/iio/adc/men_z188_adc.c
+++ b/drivers/iio/adc/men_z188_adc.c
@@ -121,8 +121,8 @@ static int men_z188_probe(struct mcb_device *dev,
 	indio_dev->num_channels = ARRAY_SIZE(z188_adc_iio_channels);
 
 	mem = mcb_request_mem(dev, "z188-adc");
-	if (!mem)
-		return -ENOMEM;
+	if (IS_ERR(mem))
+		return PTR_ERR(mem);
 
 	adc->base = ioremap(mem->start, resource_size(mem));
 	if (adc->base = NULL)

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

end of thread, other threads:[~2014-06-15 15:23 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-28  8:33 [patch] iio: adc: checking for NULL instead of IS_ERR() in probe Dan Carpenter
2014-03-28  8:33 ` Dan Carpenter
2014-03-28 14:07 ` johannes thumshirn
2014-03-28 14:07   ` johannes thumshirn
2014-03-29  9:58   ` Jonathan Cameron
2014-03-29  9:58     ` Jonathan Cameron
2014-06-12 18:44     ` Johannes Thumshirn
2014-06-12 18:44       ` Johannes Thumshirn
2014-06-14 15:17       ` Jonathan Cameron
2014-06-14 15:17         ` Jonathan Cameron
2014-06-15 15:23         ` Johannes Thumshirn
2014-06-15 15:23           ` Johannes Thumshirn

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.