summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/devfs-core.c14
-rw-r--r--include/driver.h1
2 files changed, 15 insertions, 0 deletions
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
*
diff --git a/include/driver.h b/include/driver.h
index 3d701f2439..8617872053 100644
--- a/include/driver.h
+++ b/include/driver.h
@@ -472,6 +472,7 @@ struct cdev *cdev_by_name(const char *filename);
struct cdev *lcdev_by_name(const char *filename);
struct cdev *cdev_readlink(struct cdev *cdev);
struct cdev *cdev_by_device_node(struct device_node *node);
+struct cdev *cdev_by_partuuid(const char *partuuid);
struct cdev *cdev_open(const char *name, unsigned long flags);
struct cdev *cdev_create_loop(const char *path, ulong flags);
void cdev_remove_loop(struct cdev *cdev);