Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset d1df381 in mainline


Ignore:
Timestamp:
2013-12-31T23:20:40Z (8 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master
Children:
7813516
Parents:
ba4a03a5
Message:

libusbhost: Make ddf interrupt helper return the used irq.

Location:
uspace
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/ehci/ehci.c

    rba4a03a5 rd1df381  
    9595        }
    9696        addr_range_t regs = hw_res.mem_ranges.ranges[0];
    97         const int irq = hw_res.irqs.irqs[0];
    9897
    9998        /* Initialize generic HCD driver */
     
    117116        /* Try to enable interrupts */
    118117        bool interrupts = false;
    119         ret = hcd_ddf_setup_interrupts(device, &hw_res, irq_handler,
     118        const int irq = hcd_ddf_setup_interrupts(device, &hw_res, irq_handler,
    120119            hc_gen_irq_code);
    121         if (ret != EOK) {
     120        if (irq < 0) {
    122121                usb_log_warning("Failed to enable interrupts: %s."
    123                     " Falling back to polling\n", str_error(ret));
     122                    " Falling back to polling\n", str_error(irq));
    124123        } else {
    125124                usb_log_debug("Hw interrupts enabled.\n");
  • uspace/drv/bus/usb/ohci/ohci.c

    rba4a03a5 rd1df381  
    9595        }
    9696        addr_range_t regs = hw_res.mem_ranges.ranges[0];
    97         const int irq = hw_res.irqs.irqs[0];
    9897
    9998        /* Initialize generic HCD driver */
     
    117116        /* Try to enable interrupts */
    118117        bool interrupts = false;
    119         ret = hcd_ddf_setup_interrupts(device, &hw_res, irq_handler,
     118        const int irq = hcd_ddf_setup_interrupts(device, &hw_res, irq_handler,
    120119            hc_gen_irq_code);
    121         if (ret != EOK) {
     120        if (irq < 0) {
    122121                usb_log_warning("Failed to enable interrupts: %s."
    123                     " Falling back to polling\n", str_error(ret));
     122                    " Falling back to polling\n", str_error(irq));
    124123        } else {
    125124                usb_log_debug("Hw interrupts enabled.\n");
  • uspace/drv/bus/usb/uhci/uhci.c

    rba4a03a5 rd1df381  
    9797        }
    9898        addr_range_t regs = hw_res.io_ranges.ranges[0];
    99         const int irq = hw_res.irqs.irqs[0];
    10099
    101100        ret = hcd_ddf_setup_hc(device, USB_SPEED_FULL,
     
    116115
    117116        bool interrupts = false;
    118         ret = hcd_ddf_setup_interrupts(device, &hw_res, irq_handler,
     117        const int irq = hcd_ddf_setup_interrupts(device, &hw_res, irq_handler,
    119118            hc_gen_irq_code);
    120         if (ret != EOK) {
     119        if (irq < 0) {
    121120                usb_log_warning("Failed to enable interrupts: %s."
    122                     " Falling back to polling.\n", str_error(ret));
     121                    " Falling back to polling.\n", str_error(irq));
    123122        } else {
    124123                usb_log_debug("Hw interrupts enabled.\n");
  • uspace/lib/usbhost/src/ddf_helpers.c

    rba4a03a5 rd1df381  
    725725        irq_code_t irq_code = {0};
    726726
    727         int irq = gen_irq_code(&irq_code, hw_res);
     727        const int irq = gen_irq_code(&irq_code, hw_res);
    728728        if (irq < 0) {
    729729                usb_log_error("Failed to generate IRQ code: %s.\n",
     
    749749                return ret;
    750750        }
    751 
    752         return EOK;
     751        assert(irq > 0);
     752        return irq;
    753753}
    754754/**
Note: See TracChangeset for help on using the changeset viewer.