From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
To: Lukas Wunner <lukas@wunner.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] nvmem: core: Deduplicate bus_find_device() by name matching
Date: Sat, 25 Nov 2017 14:47:07 +0000 [thread overview]
Message-ID: <788a42d3-243e-e22e-2958-444726ef2ad3@linaro.org> (raw)
In-Reply-To: <1ec777daa342333ed80ee8c5f79c58489f20a591.1511609232.git.lukas@wunner.de>
Thanks for the patch,
On 25/11/17 11:31, Lukas Wunner wrote:
> No need to reinvent the wheel, we have bus_find_device_by_name().
>
> Signed-off-by: Lukas Wunner <lukas@wunner.de>
> ---
> drivers/nvmem/core.c | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
>
It looks good for me, I will queue it up!
> diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
> index 5a5cefd12153..93084ab61e0f 100644
> --- a/drivers/nvmem/core.c
> +++ b/drivers/nvmem/core.c
> @@ -600,16 +600,11 @@ static void __nvmem_device_put(struct nvmem_device *nvmem)
> mutex_unlock(&nvmem_mutex);
> }
>
> -static int nvmem_match(struct device *dev, void *data)
> -{
> - return !strcmp(dev_name(dev), data);
> -}
> -
> static struct nvmem_device *nvmem_find(const char *name)
> {
> struct device *d;
>
> - d = bus_find_device(&nvmem_bus_type, NULL, (void *)name, nvmem_match);
> + d = bus_find_device_by_name(&nvmem_bus_type, NULL, name);
>
> if (!d)
> return NULL;
>
prev parent reply other threads:[~2017-11-25 14:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-25 11:31 Lukas Wunner
2017-11-25 14:47 ` Srinivas Kandagatla [this message]
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=788a42d3-243e-e22e-2958-444726ef2ad3@linaro.org \
--to=srinivas.kandagatla@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lukas@wunner.de \
/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
all inboxes | Powered by JetHome®