mirror of
https://github.com/linux-msm/cdba.git
synced 2026-02-25 13:11:56 -08:00
device: Support device listing of devices without name
Some devices doesn't have a configured "name", don't print "(null)" in this case. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
This commit is contained in:
5
device.c
5
device.c
@@ -223,7 +223,10 @@ void device_list_devices(void)
|
||||
char buf[80];
|
||||
|
||||
list_for_each_entry(device, &devices, node) {
|
||||
len = snprintf(buf, sizeof(buf), "%-20s %s", device->board, device->name);
|
||||
if (device->name)
|
||||
len = snprintf(buf, sizeof(buf), "%-20s %s", device->board, device->name);
|
||||
else
|
||||
len = snprintf(buf, sizeof(buf), "%s", device->board);
|
||||
|
||||
hdr.type = MSG_LIST_DEVICES;
|
||||
hdr.len = len;
|
||||
|
||||
Reference in New Issue
Block a user