summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Pyhalov <apyhalov@gmail.com>2018-05-24 14:54:02 +0300
committerNathan Hjelm <hjelmn@me.com>2019-04-04 22:27:57 -0600
commit028e75355e2a97b7a3e7ab67f0356a06d1fa303e (patch)
tree1550fa550e2d6f7351a1ad14ded95a7da6d03dca
parentfcce301c7fcfc254d8f4e67312fff944b1d15ec8 (diff)
downloadlibusb-028e75355e2a97b7a3e7ab67f0356a06d1fa303e.tar.gz
Use more portable di_prop_lookup_ints() interface
Closes #433 Signed-off-by: Nathan Hjelm <hjelmn@me.com>
-rw-r--r--libusb/os/sunos_usb.c14
-rw-r--r--libusb/version_nano.h2
2 files changed, 8 insertions, 8 deletions
diff --git a/libusb/os/sunos_usb.c b/libusb/os/sunos_usb.c
index ecd4aad..05a5ef6 100644
--- a/libusb/os/sunos_usb.c
+++ b/libusb/os/sunos_usb.c
@@ -476,7 +476,7 @@ static int
sunos_fill_in_dev_info(di_node_t node, struct libusb_device *dev)
{
int proplen;
- int n, *addr, *port_prop;
+ int *i, n, *addr, *port_prop;
char *phypath;
uint8_t *rdata;
struct libusb_device_descriptor *descr;
@@ -546,13 +546,13 @@ sunos_fill_in_dev_info(di_node_t node, struct libusb_device *dev)
}
/* speed */
- if (di_prop_exists(DDI_DEV_T_ANY, node, "low-speed") == 1) {
+ if (di_prop_lookup_ints(DDI_DEV_T_ANY, node, "low-speed", &i) >= 0) {
dev->speed = LIBUSB_SPEED_LOW;
- } else if (di_prop_exists(DDI_DEV_T_ANY, node, "high-speed") == 1) {
+ } else if (di_prop_lookup_ints(DDI_DEV_T_ANY, node, "high-speed", &i) >= 0) {
dev->speed = LIBUSB_SPEED_HIGH;
- } else if (di_prop_exists(DDI_DEV_T_ANY, node, "full-speed") == 1) {
+ } else if (di_prop_lookup_ints(DDI_DEV_T_ANY, node, "full-speed", &i) >= 0) {
dev->speed = LIBUSB_SPEED_FULL;
- } else if (di_prop_exists(DDI_DEV_T_ANY, node, "super-speed") == 1) {
+ } else if (di_prop_lookup_ints(DDI_DEV_T_ANY, node, "super-speed", &i) >= 0) {
dev->speed = LIBUSB_SPEED_SUPER;
}
@@ -574,7 +574,7 @@ sunos_add_devices(di_devlink_t link, void *arg)
uint64_t bdf = 0;
struct libusb_device *dev;
sunos_dev_priv_t *devpriv;
- int n;
+ int n, *j;
int i = 0;
int *addr_prop;
uint8_t bus_number = 0;
@@ -594,7 +594,7 @@ sunos_add_devices(di_devlink_t link, void *arg)
dn = myself;
/* find the root hub */
- while (di_prop_exists(DDI_DEV_T_ANY, dn, "root-hub") != 1) {
+ while (di_prop_lookup_ints(DDI_DEV_T_ANY, dn, "root-hub", &j) != 0) {
usbi_dbg("find_root_hub:%s", di_devfs_path(dn));
n = di_prop_lookup_ints(DDI_DEV_T_ANY, dn,
"assigned-address", &addr_prop);
diff --git a/libusb/version_nano.h b/libusb/version_nano.h
index 13ff675..ec9aa04 100644
--- a/libusb/version_nano.h
+++ b/libusb/version_nano.h
@@ -1 +1 @@
-#define LIBUSB_NANO 11354
+#define LIBUSB_NANO 11355