summaryrefslogtreecommitdiff
path: root/drivers/core
diff options
context:
space:
mode:
authorPrzemyslaw Marczak <p.marczak@samsung.com>2015-04-15 13:07:25 +0200
committerSimon Glass <sjg@chromium.org>2015-04-22 11:03:15 -0600
commitf9c370dcdf056f035f18bf77db8a706cea21f9ce (patch)
tree624132a7fed152a22b665157f925450487cd636c /drivers/core
parentcc73d37b7f1edbbf03e2abcf5815bdd122e8baed (diff)
downloadu-boot-f9c370dcdf056f035f18bf77db8a706cea21f9ce.tar.gz
u-boot-f9c370dcdf056f035f18bf77db8a706cea21f9ce.tar.bz2
u-boot-f9c370dcdf056f035f18bf77db8a706cea21f9ce.zip
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>
Diffstat (limited to 'drivers/core')
-rw-r--r--drivers/core/device.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/core/device.c b/drivers/core/device.c
index d024abbd41..df81b8e63d 100644
--- a/drivers/core/device.c
+++ b/drivers/core/device.c
@@ -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)
{