dm: core: device: add function: dev_get_uclass_name()
This commit extends the driver model device's API by function: - dev_get_uclass_name() And this function returns the device's uclass driver name if: - given dev pointer, is non_NULL otherwise, the NULL pointer is returned. Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com> Cc: Simon Glass <sjg@chromium.org> Acked-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
committed by
Simon Glass
parent
cc73d37b7f
commit
f9c370dcdf
@@ -512,6 +512,14 @@ enum uclass_id device_get_uclass_id(struct udevice *dev)
|
||||
return dev->uclass->uc_drv->id;
|
||||
}
|
||||
|
||||
const char *dev_get_uclass_name(struct udevice *dev)
|
||||
{
|
||||
if (!dev)
|
||||
return NULL;
|
||||
|
||||
return dev->uclass->uc_drv->name;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_OF_CONTROL
|
||||
fdt_addr_t dev_get_addr(struct udevice *dev)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user