summaryrefslogtreecommitdiffstats
path: root/drivers/iio
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2014-03-28 08:33:00 +0000
committerJonathan Cameron <jic23@kernel.org>2014-06-14 16:16:43 +0100
commite94f62e79f7f63a68574ee5e76c19837ec12f3db (patch)
treea3bdd460676e2224f839bda6ce608c3f4e5e70e9 /drivers/iio
parent4f3bcd878f1d3c730fe00f619b7260c6125d49eb (diff)
downloadblackbird-op-linux-e94f62e79f7f63a68574ee5e76c19837ec12f3db.tar.gz
blackbird-op-linux-e94f62e79f7f63a68574ee5e76c19837ec12f3db.zip
iio: adc: checking for NULL instead of IS_ERR() in probe
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> Signed-off-by: Jonathan Cameron <jic23@kernel.org> Cc: Stable@vger.kernel.org
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/adc/men_z188_adc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/iio/adc/men_z188_adc.c b/drivers/iio/adc/men_z188_adc.c
index 6989c16aec2b..b58d6302521f 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)
OpenPOWER on IntegriCloud