From 29b54c46fb46274830aef4e5403443955979c72b Mon Sep 17 00:00:00 2001 From: Steffen Trumtrar Date: Mon, 10 Jul 2017 12:33:50 +0200 Subject: devfs-core: add function to find cdev by partuuid Signed-off-by: Steffen Trumtrar Signed-off-by: Lucas Stach --- fs/devfs-core.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'fs') diff --git a/fs/devfs-core.c b/fs/devfs-core.c index 3368d3ed68..be56edd18d 100644 --- a/fs/devfs-core.c +++ b/fs/devfs-core.c @@ -95,6 +95,20 @@ struct cdev *cdev_by_device_node(struct device_node *node) return NULL; } +struct cdev *cdev_by_partuuid(const char *partuuid) +{ + struct cdev *cdev; + + if (!partuuid) + return NULL; + + list_for_each_entry(cdev, &cdev_list, list) { + if (!strcmp(cdev->partuuid, partuuid)) + return cdev; + } + return NULL; +} + /** * device_find_partition - find a partition belonging to a physical device * -- cgit v1.2.3