[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5ea0d73e-5a71-708e-4c45-bb8d27137e45@linaro.org>
Date: Thu, 17 Jan 2019 10:20:11 +0000
From: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
To: Alban <albeu@...e.fr>
Cc: linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/8] nvmem: Add nvmem_cell_get_optional and
devm_nvmem_cell_get_optional
On 16/01/2019 18:26, Alban wrote:
>> What is the real use-case here, it does not make sense to me to add this
>> additional call just to return NULL when cell is not found!
> It also return NULL when nvmem is not compiled in. I quiet like such
> convenience functions as they make the driver code much simpler and
> the intent explicit. It replace:
>
> data->cell = devm_nvmem_cell_get(dev, "my-cell");
> if (IS_ERR(data->cell) {
> if (PTR_ERR(data->cell) == -ENOENT ||
> PTR_ERR(data->cell) == -EOPNOTSUPP)
> data->cell = NULL;
> else
> return PTR_ERR(data->cell);
> }
>
> with:
>
> data->cell = dev_nvmem_cell_get_optional(dev, "my-cell");
> if (IS_ERR(cell))
> return PTR_ERR(data->cell);
>
> It's your call if you find that useful or not.
I don't think this should belong to nvmem core in anyway! Its more of
consumer specific logic!
I have already applied all of the patches in this series except this one!
thanks,
srini
Powered by blists - more mailing lists