Changes in uspace/drv/uhci-rhd/main.c [f123909:275bf456] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-rhd/main.c
rf123909 r275bf456 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 /** @addtogroup drvusbuhcirh28 /** @addtogroup usb 29 29 * @{ 30 30 */ 31 31 /** @file 32 * @brief UHCI root hub initialization routines32 * @brief UHCI driver 33 33 */ 34 34 #include <ddf/driver.h> … … 40 40 #include <usb/debug.h> 41 41 42 43 42 44 #include "root_hub.h" 43 45 … … 45 47 static int hc_get_my_registers(ddf_dev_t *dev, 46 48 uintptr_t *io_reg_address, size_t *io_reg_size); 47 #if 048 49 /*----------------------------------------------------------------------------*/ 49 50 static int usb_iface_get_hc_handle(ddf_fun_t *fun, devman_handle_t *handle) … … 66 67 .interfaces[USB_DEV_IFACE] = &uhci_rh_usb_iface, 67 68 }; 68 #endif69 69 /*----------------------------------------------------------------------------*/ 70 /** Initialize a new ddf driver instance of UHCI root hub.70 /** Initializes a new ddf driver instance of UHCI root hub. 71 71 * 72 72 * @param[in] device DDF instance of the device to initialize. … … 81 81 82 82 //device->ops = &uhci_rh_ops; 83 (void) uhci_rh_ops; 84 85 uhci_root_hub_t *rh = malloc(sizeof(uhci_root_hub_t)); 86 if (!rh) { 87 usb_log_error("Failed to allocate memory for driver instance.\n"); 88 return ENOMEM; 89 } 90 83 91 uintptr_t io_regs = 0; 84 92 size_t io_size = 0; 85 93 86 94 int ret = hc_get_my_registers(device, &io_regs, &io_size); 87 if (ret != EOK) { 88 usb_log_error("Failed(%d) to get registers from parent hc.", 89 ret); 90 } 91 usb_log_info("I/O regs at %#X (size %zu).\n", io_regs, io_size); 95 assert(ret == EOK); 92 96 93 uhci_root_hub_t *rh = malloc(sizeof(uhci_root_hub_t)); 94 if (!rh) { 95 usb_log_error("Failed to allocate driver instance.\n"); 96 return ENOMEM; 97 } 98 97 /* TODO: verify values from hc */ 98 usb_log_info("I/O regs at 0x%X (size %zu).\n", io_regs, io_size); 99 99 ret = uhci_root_hub_init(rh, (void*)io_regs, io_size, device); 100 100 if (ret != EOK) { … … 119 119 }; 120 120 /*----------------------------------------------------------------------------*/ 121 /** Initialize global driver structures (NONE).121 /** Initializes global driver structures (NONE). 122 122 * 123 123 * @param[in] argc Nmber of arguments in argv vector (ignored).
Note:
See TracChangeset
for help on using the changeset viewer.