Skip to content

Commit

Permalink
iio: adc: checking for NULL instead of IS_ERR() in probe
Browse files Browse the repository at this point in the history
mcb_request_mem() returns an ERR_PTR(), it doesn't return NULL.

Fixes: 74aeac4 ('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
  • Loading branch information
Dan Carpenter authored and Jonathan Cameron committed Jun 14, 2014
1 parent 4f3bcd8 commit e94f62e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/iio/adc/men_z188_adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e94f62e

Please sign in to comment.