From: Chris Dickens Date: Thu, 4 Jan 2018 23:52:56 +0000 (-0800) Subject: Windows: Remove port member from device's private structure X-Git-Tag: upstream/1.0.22~58 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=839235a0b4c55fe420da0c0a7cafbdfb44609820;p=platform%2Fupstream%2Flibusb.git Windows: Remove port member from device's private structure The libusb_device structure already has a port_number member that stores the same information, so don't duplicate this elsewhere. Signed-off-by: Chris Dickens --- diff --git a/libusb/os/windows_winusb.c b/libusb/os/windows_winusb.c index 897d931..7ab0cc7 100644 --- a/libusb/os/windows_winusb.c +++ b/libusb/os/windows_winusb.c @@ -903,7 +903,7 @@ static int cache_config_descriptors(struct libusb_device *dev, HANDLE hub_handle size = sizeof(cd_buf_short); memset(&cd_buf_short, 0, size); - cd_buf_short.req.ConnectionIndex = (ULONG)priv->port; + cd_buf_short.req.ConnectionIndex = (ULONG)dev->port_number; cd_buf_short.req.SetupPacket.bmRequest = LIBUSB_ENDPOINT_IN; cd_buf_short.req.SetupPacket.bRequest = LIBUSB_REQUEST_GET_DESCRIPTOR; cd_buf_short.req.SetupPacket.wValue = (LIBUSB_DT_CONFIG << 8) | i; @@ -932,7 +932,7 @@ static int cache_config_descriptors(struct libusb_device *dev, HANDLE hub_handle } // Actual call - cd_buf_actual->ConnectionIndex = (ULONG)priv->port; + cd_buf_actual->ConnectionIndex = (ULONG)dev->port_number; cd_buf_actual->SetupPacket.bmRequest = LIBUSB_ENDPOINT_IN; cd_buf_actual->SetupPacket.bRequest = LIBUSB_REQUEST_GET_DESCRIPTOR; cd_buf_actual->SetupPacket.wValue = (LIBUSB_DT_CONFIG << 8) | i; @@ -1035,7 +1035,6 @@ static int init_device(struct libusb_device *dev, struct libusb_device *parent_d } dev->bus_number = parent_dev->bus_number; - priv->port = port_number; dev->port_number = port_number; priv->depth = parent_priv->depth + 1; dev->parent_dev = parent_dev; @@ -1123,7 +1122,7 @@ static int init_device(struct libusb_device *dev, struct libusb_device *parent_d usbi_sanitize_device(dev); usbi_dbg("(bus: %u, addr: %u, depth: %u, port: %u): '%s'", - dev->bus_number, dev->device_address, priv->depth, priv->port, device_id); + dev->bus_number, dev->device_address, priv->depth, dev->port_number, device_id); return LIBUSB_SUCCESS; } diff --git a/libusb/os/windows_winusb.h b/libusb/os/windows_winusb.h index 6d9c3cd..c58847a 100644 --- a/libusb/os/windows_winusb.h +++ b/libusb/os/windows_winusb.h @@ -197,7 +197,6 @@ struct hid_device_priv { struct windows_device_priv { uint8_t depth; // distance to HCD - uint8_t port; // port number on the hub uint8_t active_config; struct windows_usb_api_backend const *apib; char *path; // device interface path diff --git a/libusb/version_nano.h b/libusb/version_nano.h index 6ecb77b..3ff898e 100644 --- a/libusb/version_nano.h +++ b/libusb/version_nano.h @@ -1 +1 @@ -#define LIBUSB_NANO 11253 +#define LIBUSB_NANO 11254