style fixes on pegasus network driver

This commit is contained in:
Jérôme Duval
2012-02-02 22:23:57 +01:00
parent c4d3febeb4
commit fb2d44b120
@@ -185,14 +185,14 @@ create_device(const usb_device dev, const usb_interface_info *ii, uint16 ifno)
device->sem_lock = sem = create_sem(1, DRIVER_NAME "_lock");
if (sem < B_OK) {
DPRINTF_ERR("create_sem() failed %d\n", (int)sem);
DPRINTF_ERR("create_sem() failed 0x%lx\n", sem);
free(device);
return NULL;
}
device->rx_sem = sem = create_sem(1, DRIVER_NAME"_receive");
if (sem < B_OK) {
DPRINTF_ERR("create_sem() failed %d\n", (int)sem);
DPRINTF_ERR("create_sem() failed 0x%lx\n", sem);
delete_sem(device->sem_lock);
free(device);
return NULL;
@@ -201,7 +201,7 @@ create_device(const usb_device dev, const usb_interface_info *ii, uint16 ifno)
device->rx_sem_cb = sem = create_sem(0, DRIVER_NAME"_receive_cb");
if (sem < B_OK) {
DPRINTF_ERR("create_sem() failed %d\n", (int)sem);
DPRINTF_ERR("create_sem() failed 0x%lx\n", sem);
delete_sem(device->rx_sem);
delete_sem(device->sem_lock);
free(device);
@@ -271,15 +271,16 @@ setup_endpoints(const usb_interface_info *uii, pegasus_dev *dev)
size_t ep = 0;
for(; ep < uii->endpoint_count; ep++){
usb_endpoint_descriptor *ed = uii->endpoint[ep].descr;
DPRINTF_INFO("try endpoint:%ld %lx %lx %lx\n", ep, (int32)ed->attributes, (int32)ed->endpoint_address, uii->endpoint[ep].handle);
DPRINTF_INFO("try endpoint:%ld %x %x %lx\n", ep, ed->attributes,
ed->endpoint_address, uii->endpoint[ep].handle);
if ((ed->attributes & USB_ENDPOINT_ATTR_MASK) == USB_ENDPOINT_ATTR_BULK) {
if ((ed->endpoint_address & USB_ENDPOINT_ADDR_DIR_IN) == USB_ENDPOINT_ADDR_DIR_IN) {
if ((ed->endpoint_address & USB_ENDPOINT_ADDR_DIR_IN)
== USB_ENDPOINT_ADDR_DIR_IN) {
epts[0] = ep;
} else {
} else
epts[1] = ep;
}
} else {
if ((ed->attributes & USB_ENDPOINT_ATTR_MASK) == USB_ENDPOINT_ATTR_INTERRUPT)
} else if ((ed->attributes & USB_ENDPOINT_ATTR_MASK)
== USB_ENDPOINT_ATTR_INTERRUPT) {
epts[2] = ep;
}
}
@@ -352,9 +353,11 @@ pegasus_device_added(const usb_device dev, void **cookie)
dev_desc = usb->get_device_descriptor(dev);
DPRINTF_INFO("vendor ID 0x%04X, product ID 0x%04X\n", dev_desc->vendor_id, dev_desc->product_id);
DPRINTF_INFO("vendor ID 0x%04X, product ID 0x%04X\n", dev_desc->vendor_id,
dev_desc->product_id);
if ((conf = usb->get_nth_configuration(dev, DEFAULT_CONFIGURATION)) == NULL) {
if ((conf = usb->get_nth_configuration(dev, DEFAULT_CONFIGURATION))
== NULL) {
DPRINTF_ERR("cannot get default configuration\n");
return B_ERROR;
}