Changes in uspace/drv/nic/ar9271/ar9271.c [8a64320e:fe97c5e] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/nic/ar9271/ar9271.c
r8a64320e rfe97c5e 40 40 #include <stdio.h> 41 41 #include <ddf/interrupt.h> 42 #include <errno.h> 42 43 #include <nic.h> 43 44 #include <macros.h> … … 771 772 size_t chunk_size = min(remain_size, MAX_TRANSFER_SIZE); 772 773 memcpy(buffer, current_data, chunk_size); 773 int rc = usb_control_request_set(&usb_device->ctrl_pipe, 774 usb_pipe_t *ctrl_pipe = usb_device_get_default_pipe(usb_device); 775 int rc = usb_control_request_set(ctrl_pipe, 774 776 USB_REQUEST_TYPE_VENDOR, 775 777 USB_REQUEST_RECIPIENT_DEVICE, … … 798 800 * device side buffer which we will check in htc_check_ready function. 799 801 */ 800 int rc = usb_control_request_set(&usb_device->ctrl_pipe, 802 usb_pipe_t *ctrl_pipe = usb_device_get_default_pipe(usb_device); 803 int rc = usb_control_request_set(ctrl_pipe, 801 804 USB_REQUEST_TYPE_VENDOR, 802 805 USB_REQUEST_RECIPIENT_DEVICE, … … 828 831 { 829 832 /* USB framework initialization. */ 830 usb_device_t *usb_device = calloc(1, sizeof(usb_device_t));831 if (usb_device == NULL) {832 usb_log_error("USB device structure allocation failed.\n");833 return NULL;834 }835 836 833 const char *err_msg = NULL; 837 int rc = usb_device_init(usb_device, dev, endpoints, &err_msg); 838 if (rc != EOK) { 839 free(usb_device); 834 int rc = usb_device_create_ddf(dev, endpoints, &err_msg); 835 if (rc != EOK) { 840 836 usb_log_error("Failed to create USB device: %s, " 841 837 "ERR_NUM = %d\n", err_msg, rc); … … 846 842 ar9271_t *ar9271 = calloc(1, sizeof(ar9271_t)); 847 843 if (!ar9271) { 848 free(usb_device);849 844 usb_log_error("Failed to allocate memory for device " 850 845 "structure.\n"); … … 854 849 ar9271->ddf_dev = dev; 855 850 856 rc = ar9271_init(ar9271, usb_device );851 rc = ar9271_init(ar9271, usb_device_get(dev)); 857 852 if (rc != EOK) { 858 853 free(ar9271); 859 free(usb_device);860 854 usb_log_error("Failed to initialize AR9271 structure: %d\n", 861 855 rc);
Note:
See TracChangeset
for help on using the changeset viewer.