mirror of
https://xff.cz/git/u-boot/
synced 2025-09-02 01:02:19 +02:00
dm: core: Add a function to look up a uclass by name
Each uclass has a driver name which we can use to look up the uclass. This is useful for logging, where the uclass ID is used as the category. Add a function to handle this, as well as a test. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -127,6 +127,14 @@ int uclass_get(enum uclass_id key, struct uclass **ucp);
|
||||
*/
|
||||
const char *uclass_get_name(enum uclass_id id);
|
||||
|
||||
/**
|
||||
* uclass_get_by_name() - Look up a uclass by its driver name
|
||||
*
|
||||
* @name: Name to look up
|
||||
* @returns the associated uclass ID, or UCLASS_INVALID if not found
|
||||
*/
|
||||
enum uclass_id uclass_get_by_name(const char *name);
|
||||
|
||||
/**
|
||||
* uclass_get_device() - Get a uclass device based on an ID and index
|
||||
*
|
||||
|
Reference in New Issue
Block a user