mirror of
https://xff.cz/git/u-boot/
synced 2025-11-02 19:36:22 +01:00
dm: core: Add a function to get a uclass name
It is useful in debug() statements to display the name of the uclass for a device. Add a simple function to provide this. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
This commit is contained in:
@@ -148,6 +148,15 @@ int uclass_get(enum uclass_id id, struct uclass **ucp)
|
||||
return 0;
|
||||
}
|
||||
|
||||
const char *uclass_get_name(enum uclass_id id)
|
||||
{
|
||||
struct uclass *uc;
|
||||
|
||||
if (uclass_get(id, &uc))
|
||||
return NULL;
|
||||
return uc->uc_drv->name;
|
||||
}
|
||||
|
||||
int uclass_find_device(enum uclass_id id, int index, struct udevice **devp)
|
||||
{
|
||||
struct uclass *uc;
|
||||
|
||||
Reference in New Issue
Block a user