aboutsummaryrefslogtreecommitdiff
path: root/drivers/leds
diff options
context:
space:
mode:
authorJacek Anaszewski2019-07-30 22:36:31 +0200
committerJacek Anaszewski2019-07-30 22:36:31 +0200
commitbe7fc2cc86170bea31e1db8d596f35df52254971 (patch)
tree31ca140aec74decbf18dfce1a7869aeeb8dcbf84 /drivers/leds
parentaf7b65054952a9898534d966f2e548d7692b7016 (diff)
parent36f3313d6bff91ab2a9e47698c27d15363640a4e (diff)
Merge tag 'generic_lookup_helpers' into for-next
Generic Device Lookup Helpers Persistent tag for others to pull this branch from Based on patch series from Suzuki K Poulose <suzuki.poulose@arm.com> with Subject: [PATCH v3 0/7] drivers: Add generic device lookup helpers Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> * tag 'generic_lookup_helpers': platform: Add platform_find_device_by_driver() helper drivers: Add generic helper to match any device drivers: Introduce device lookup variants by ACPI_COMPANION device drivers: Introduce device lookup variants by device type drivers: Introduce device lookup variants by fwnode drivers: Introduce device lookup variants by of_node drivers: Introduce device lookup variants by name
Diffstat (limited to 'drivers/leds')
-rw-r--r--drivers/leds/led-class.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c
index 508d6477d0b8..d231240c2047 100644
--- a/drivers/leds/led-class.c
+++ b/drivers/leds/led-class.c
@@ -214,13 +214,6 @@ static int led_resume(struct device *dev)
static SIMPLE_DEV_PM_OPS(leds_class_dev_pm_ops, led_suspend, led_resume);
-static int match_name(struct device *dev, const void *data)
-{
- if (!dev_name(dev))
- return 0;
- return !strcmp(dev_name(dev), (char *)data);
-}
-
static int led_classdev_next_name(const char *init_name, char *name,
size_t len)
{
@@ -231,7 +224,7 @@ static int led_classdev_next_name(const char *init_name, char *name,
strlcpy(name, init_name, len);
while ((ret < len) &&
- (dev = class_find_device(leds_class, NULL, name, match_name))) {
+ (dev = class_find_device_by_name(leds_class, name))) {
put_device(dev);
ret = snprintf(name, len, "%s_%u", init_name, ++i);
}