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

Johannes Thumshirn
2014-06-15T15:23:57Z

Jonathan Cameron <jic23@kernel.org> writes:

> On 12/06/14 19:44, Johannes Thumshirn wrote:
>> Jonathan Cameron <jic23@kernel.org> writes:
>>
>>> 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
>>
>> Did someone actually take this patch, or was it somehow lost?
>>
> I've picked it up now and applied it to the fixes-togreg branch of iio.git
>
> Thanks for pointing out I'd forgotten it and sorry about that. I've also
> marked it for stable.

Thanks a lot