diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2012-10-07 14:57:15 +0200 |
---|---|---|
committer | Peter Stuge <peter@stuge.se> | 2012-10-27 02:52:15 +0200 |
commit | 7baadac40364cdbf20c2add19f2aac678d3b603a (patch) | |
tree | effe07e8982a7048e6882db6e945c721113f1610 /src/devices | |
parent | 0524e4b53e91596340f6c9ecfb893b19d6118a64 (diff) |
Take care of NULL chip_ops->name
Change-Id: Ic44915cdb07e0d87962eff0744acefce2a4845a2
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/1626
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-by: Peter Stuge <peter@stuge.se>
Diffstat (limited to 'src/devices')
-rw-r--r-- | src/devices/device_util.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/devices/device_util.c b/src/devices/device_util.c index 6f088b2e84..5cf5eabffd 100644 --- a/src/devices/device_util.c +++ b/src/devices/device_util.c @@ -228,6 +228,14 @@ const char *dev_path(device_t dev) return buffer; } +const char *dev_name(device_t dev) +{ + if (dev->chip_ops && dev->chip_ops->name) + return dev->chip_ops->name; + else + return "unknown"; +} + const char *bus_path(struct bus *bus) { static char buffer[BUS_PATH_MAX]; |