[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <788a42d3-243e-e22e-2958-444726ef2ad3@linaro.org>
Date: Sat, 25 Nov 2017 14:47:07 +0000
From: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
To: Lukas Wunner <lukas@...ner.de>
Cc: linux-kernel@...r.kernel.org
Subject: Re: [PATCH] nvmem: core: Deduplicate bus_find_device() by name
matching
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@...ner.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;
>
Powered by blists - more mailing lists