From 2e53d2662f2b78e73132cd381f36390558cf088f Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Thu, 16 May 2013 20:46:07 +0200 Subject: [PATCH] linux: Improve topology related debug messages And use usbi_dbg, rather then fprintf(stderr, ... Signed-off-by: Hans de Goede --- libusb/os/linux_usbfs.c | 8 +++++--- libusb/version_nano.h | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/libusb/os/linux_usbfs.c b/libusb/os/linux_usbfs.c index 6c7c32a..4eb6f16 100644 --- a/libusb/os/linux_usbfs.c +++ b/libusb/os/linux_usbfs.c @@ -1114,8 +1114,9 @@ static void linux_get_parent_info(struct libusb_device *dev, const char *sysfs_d dev->port_number = atoi(tmp + 1); *tmp = '\0'; } else { + usbi_warn(ctx, "Can not parse sysfs_dir: %s, no parent info", + parent_sysfs_dir); free (parent_sysfs_dir); - /* shouldn't happen */ return; } @@ -1149,6 +1150,9 @@ retry: goto retry; } + usbi_dbg("Dev %p (%s) has parent %p (%s) port %d", dev, sysfs_dir, + dev->parent_dev, parent_sysfs_dir, dev->port_number); + free (parent_sysfs_dir); } @@ -1186,8 +1190,6 @@ int linux_enumerate_device(struct libusb_context *ctx, goto out; linux_get_parent_info(dev, sysfs_dir); - fprintf (stderr, "Dev %p (%s) has parent %p\n", dev, sysfs_dir, - dev->parent_dev); out: if (r < 0) libusb_unref_device(dev); diff --git a/libusb/version_nano.h b/libusb/version_nano.h index 9929577..4810de9 100644 --- a/libusb/version_nano.h +++ b/libusb/version_nano.h @@ -1 +1 @@ -#define LIBUSB_NANO 10684 +#define LIBUSB_NANO 10685 -- 2.11.4.GIT