aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/crypto/zcrypt_api.c
diff options
context:
space:
mode:
authorSuzuki K Poulose <[email protected]>2019-07-23 22:18:32 +0000
committerGreg Kroah-Hartman <[email protected]>2019-07-30 11:07:41 +0000
commit6cda08a20dbde45b021091230c8a359fa08c5103 (patch)
tree6017a1b2e4a83b7fd330d404691e33da0df2726a /drivers/s390/crypto/zcrypt_api.c
parentLinus 5.3-rc1 (diff)
downloadkernel-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/s390/crypto/zcrypt_api.c')
-rw-r--r--drivers/s390/crypto/zcrypt_api.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/drivers/s390/crypto/zcrypt_api.c b/drivers/s390/crypto/zcrypt_api.c
index 1058b4b5cc1e..38a5a47b8c9c 100644
--- a/drivers/s390/crypto/zcrypt_api.c
+++ b/drivers/s390/crypto/zcrypt_api.c
@@ -133,12 +133,6 @@ struct zcdn_device {
static int zcdn_create(const char *name);
static int zcdn_destroy(const char *name);
-/* helper function, matches the name for find_zcdndev_by_name() */
-static int __match_zcdn_name(struct device *dev, const void *data)
-{
- return strcmp(dev_name(dev), (const char *)data) == 0;
-}
-
/* helper function, matches the devt value for find_zcdndev_by_devt() */
static int __match_zcdn_devt(struct device *dev, const void *data)
{
@@ -152,10 +146,7 @@ static int __match_zcdn_devt(struct device *dev, const void *data)
*/
static inline struct zcdn_device *find_zcdndev_by_name(const char *name)
{
- struct device *dev =
- class_find_device(zcrypt_class, NULL,
- (void *) name,
- __match_zcdn_name);
+ struct device *dev = class_find_device_by_name(zcrypt_class, name);
return dev ? to_zcdn_dev(dev) : NULL;
}