diff options
| author | Suzuki K Poulose <[email protected]> | 2019-07-23 22:18:32 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2019-07-30 11:07:41 +0000 |
| commit | 6cda08a20dbde45b021091230c8a359fa08c5103 (patch) | |
| tree | 6017a1b2e4a83b7fd330d404691e33da0df2726a /drivers/hwtracing/stm/core.c | |
| parent | Linus 5.3-rc1 (diff) | |
| download | kernel-6cda08a20dbde45b021091230c8a359fa08c5103.tar.gz kernel-6cda08a20dbde45b021091230c8a359fa08c5103.zip | |
drivers: Introduce device lookup variants by name
Add a helper to match the device name for device lookup. Also
reuse this generic exported helper for the existing bus_find_device_by_name().
and add similar variants for driver/class.
Cc: Alessandro Zummo <[email protected]>
Cc: Alexander Aring <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: Dan Murphy <[email protected]>
Cc: Harald Freudenberger <[email protected]>
Cc: Heiko Carstens <[email protected]>
Cc: Jacek Anaszewski <[email protected]>
Cc: Lee Jones <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: Maxime Coquelin <[email protected]>
Cc: Pavel Machek <[email protected]>
Cc: Peter Oberparleiter <[email protected]>
Cc: "Rafael J. Wysocki" <[email protected]>
Cc: Stefan Schmidt <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: "Rafael J. Wysocki" <[email protected]>
Signed-off-by: Suzuki K Poulose <[email protected]>
Reviewed-by: Heikki Krogerus <[email protected]>
Acked-by: Alexandre Belloni <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'drivers/hwtracing/stm/core.c')
| -rw-r--r-- | drivers/hwtracing/stm/core.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/hwtracing/stm/core.c b/drivers/hwtracing/stm/core.c index e55b902560de..2b6bd42632e8 100644 --- a/drivers/hwtracing/stm/core.c +++ b/drivers/hwtracing/stm/core.c @@ -89,13 +89,6 @@ static struct class stm_class = { .dev_groups = stm_groups, }; -static int stm_dev_match(struct device *dev, const void *data) -{ - const char *name = data; - - return sysfs_streq(name, dev_name(dev)); -} - /** * stm_find_device() - find stm device by name * @buf: character buffer containing the name @@ -116,7 +109,7 @@ struct stm_device *stm_find_device(const char *buf) if (!stm_core_up) return NULL; - dev = class_find_device(&stm_class, NULL, buf, stm_dev_match); + dev = class_find_device_by_name(&stm_class, buf); if (!dev) return NULL; |
