From 7d54eb8e23407e472380558d961d2df255600ae1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Wed, 10 Oct 2012 23:14:28 +0300 Subject: Add name field for device MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The constant field "name" in chip_operations is common to multiple different devices within a chip and cannot reflect the actual device as found on the platform. The intention is that a driver sets dev->name as part of the device enumeration sequence with the detected hardware type and revision. The field is for debug print use only. Change-Id: Ib7bf90ba3c618ad0cb715d80d6a937ceaae0adcf Signed-off-by: Kyösti Mälkki Reviewed-on: http://review.coreboot.org/1634 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi --- src/devices/device_util.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/devices') diff --git a/src/devices/device_util.c b/src/devices/device_util.c index 5cf5eabffd..224c58ee64 100644 --- a/src/devices/device_util.c +++ b/src/devices/device_util.c @@ -230,7 +230,9 @@ const char *dev_path(device_t dev) const char *dev_name(device_t dev) { - if (dev->chip_ops && dev->chip_ops->name) + if (dev->name) + return dev->name; + else if (dev->chip_ops && dev->chip_ops->name) return dev->chip_ops->name; else return "unknown"; -- cgit v1.2.3