linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
To: Alban <albeu@free.fr>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/8] nvmem: Add nvmem_cell_get_optional and devm_nvmem_cell_get_optional
Date: Thu, 17 Jan 2019 10:20:11 +0000	[thread overview]
Message-ID: <5ea0d73e-5a71-708e-4c45-bb8d27137e45@linaro.org> (raw)
In-Reply-To: <20190116192658.7df211e8@tack>



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


  reply	other threads:[~2019-01-17 10:20 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-06 19:28 [PATCH 0/8] nvmem: Various small fixes and improvements Alban Bedel
2019-01-06 19:28 ` [PATCH 1/8] nvmem: core: Set the provider read-only when no write callback is given Alban Bedel
2019-01-06 19:28 ` [PATCH 2/8] nvmem: core: Fix of_nvmem_cell_get() for optional cells Alban Bedel
2019-01-06 19:28 ` [PATCH 3/8] nvmem: Add nvmem_cell_get_optional and devm_nvmem_cell_get_optional Alban Bedel
2019-01-15 12:40   ` Srinivas Kandagatla
2019-01-16 18:26     ` Alban
2019-01-17 10:20       ` Srinivas Kandagatla [this message]
2019-01-06 19:28 ` [PATCH 4/8] nvmem: core: Fix cell lookup when no cell is found Alban Bedel
2019-01-06 19:28 ` [PATCH 5/8] nvmem: core: Properly handle connection ID in of_nvmem_device_get() Alban Bedel
2019-01-06 19:28 ` [PATCH 6/8] nvmem: core: Always reference the device returned by nvmem_device_get() Alban Bedel
2019-01-06 19:28 ` [PATCH 7/8] nvmem: core: Fix device reference leak Alban Bedel
2019-01-06 19:28 ` [PATCH 8/8] nvmem: core: Avoid useless iterations in nvmem_cell_get_from_lookup() Alban Bedel
2019-01-15 12:40 ` [PATCH 0/8] nvmem: Various small fixes and improvements Srinivas Kandagatla

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5ea0d73e-5a71-708e-4c45-bb8d27137e45@linaro.org \
    --to=srinivas.kandagatla@linaro.org \
    --cc=albeu@free.fr \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).