Re: [patch] iio: adc: checking for NULL instead of IS_ERR() in probe

Jonathan Cameron
2014-03-29T09:57:45Z

On 28/03/14 14:07, johannes thumshirn wrote:
> On Fri, Mar 28, 2014 at 9:33 AM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
>>
>> 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)
>
> Acked-by: Johannes Thumshirn <johannes.thumshirn@men.de>
>
Acked-by: Jonathan Cameron <jic23@kernel.org>

Or I can pick this up after the merge window has closed if Greg hasn't
already taken it.

Jonathan