diff options
author | Lukas Wunner <lukas@wunner.de> | 2017-12-15 09:06:04 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-12-19 04:39:33 -0500 |
commit | 9f3044c38c84989c37a6f29683a8899a2980341d (patch) | |
tree | b4c88cc685b5268f36851196d115158e25633c2b /drivers/nvmem | |
parent | 3f827245463a57f5ef64a665e1ca64eed0da00a5 (diff) |
nvmem: core: Deduplicate bus_find_device() by name matching
No need to reinvent the wheel, we have bus_find_device_by_name().
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/nvmem')
-rw-r--r-- | drivers/nvmem/core.c | 7 |
1 files changed, 1 insertions, 6 deletions
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) | |||
600 | mutex_unlock(&nvmem_mutex); | 600 | mutex_unlock(&nvmem_mutex); |
601 | } | 601 | } |
602 | 602 | ||
603 | static int nvmem_match(struct device *dev, void *data) | ||
604 | { | ||
605 | return !strcmp(dev_name(dev), data); | ||
606 | } | ||
607 | |||
608 | static struct nvmem_device *nvmem_find(const char *name) | 603 | static struct nvmem_device *nvmem_find(const char *name) |
609 | { | 604 | { |
610 | struct device *d; | 605 | struct device *d; |
611 | 606 | ||
612 | d = bus_find_device(&nvmem_bus_type, NULL, (void *)name, nvmem_match); | 607 | d = bus_find_device_by_name(&nvmem_bus_type, NULL, name); |
613 | 608 | ||
614 | if (!d) | 609 | if (!d) |
615 | return NULL; | 610 | return NULL; |