]> Git Repo - linux.git/commitdiff
iio: adc: checking for NULL instead of IS_ERR() in probe
authorDan Carpenter <[email protected]>
Fri, 28 Mar 2014 08:33:00 +0000 (08:33 +0000)
committerJonathan Cameron <[email protected]>
Sat, 14 Jun 2014 15:16:43 +0000 (16:16 +0100)
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 <[email protected]>
Signed-off-by: Jonathan Cameron <[email protected]>
Cc: [email protected]
drivers/iio/adc/men_z188_adc.c

index 6989c16aec2bf8c1aee3fbb277bbb9627d11f70f..b58d6302521f4d651359715331e83a5a416583a0 100644 (file)
@@ -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)
This page took 0.056044 seconds and 4 git commands to generate.