Changeset 2ef036a in mainline for uspace/drv/uhci-rhd/main.c
- Timestamp:
- 2011-03-14T22:51:09Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2180979
- Parents:
- 7ffe82f (diff), fcf07e6 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-rhd/main.c
r7ffe82f r2ef036a 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 /** @addtogroup usb28 /** @addtogroup drvusbuhcirh 29 29 * @{ 30 30 */ 31 31 /** @file 32 * @brief UHCI driver32 * @brief UHCI root hub initialization routines 33 33 */ 34 34 #include <ddf/driver.h> … … 40 40 #include <usb/debug.h> 41 41 42 43 44 42 #include "root_hub.h" 45 43 … … 47 45 static int hc_get_my_registers(ddf_dev_t *dev, 48 46 uintptr_t *io_reg_address, size_t *io_reg_size); 47 #if 0 49 48 /*----------------------------------------------------------------------------*/ 50 49 static int usb_iface_get_hc_handle(ddf_fun_t *fun, devman_handle_t *handle) … … 67 66 .interfaces[USB_DEV_IFACE] = &uhci_rh_usb_iface, 68 67 }; 68 #endif 69 69 /*----------------------------------------------------------------------------*/ 70 /** Initialize sa new ddf driver instance of UHCI root hub.70 /** Initialize 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 91 83 uintptr_t io_regs = 0; 92 84 size_t io_size = 0; 93 85 94 86 int ret = hc_get_my_registers(device, &io_regs, &io_size); 95 assert(ret == EOK); 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); 96 92 97 /* TODO: verify values from hc */ 98 usb_log_info("I/O regs at 0x%X (size %zu).\n", io_regs, io_size); 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 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 sglobal driver structures (NONE).121 /** Initialize 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.