diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-10-22 13:14:46 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-10-22 13:14:46 +0200 |
commit | e41b08fc6261f5386e28e01cda2ae410d883e367 (patch) | |
tree | 849602958a433c00627532a05f8494458dcdd16d | |
parent | 8a80f70a8afb2f6831b150a69cdf8f566deefe66 (diff) | |
download | usbutils-e41b08fc6261f5386e28e01cda2ae410d883e367.tar.gz |
lsusb-t: if a driver is not bound to an interface, report "[none]"
For the output of 'lsusb -t' if a driver is not bound to an interface,
the result looks odd. Fix that up by printing out "[none]" instead.
This changes the output of a line that previous looked like:
|__ Port 004: Dev 006, If 0, Class=[unknown], Driver=, 12M
to be:
|__ Port 004: Dev 006, If 0, Class=[unknown], Driver=[none], 12M
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | lsusb-t.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -357,6 +357,8 @@ static void add_usb_interface(const char *d_name) p = strrchr(driver, '/'); if (p) snprintf(e->driver, sizeof(e->driver), "%s", p + 1); + } else { + snprintf(e->driver, sizeof(e->driver), "[none]"); } } else printf("Can not read driver link for '%s': %d\n", d_name, l); |