Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usb/src/pipes.c

    rf0fdc7d rc2343cc  
    4242#include <assert.h>
    4343
    44 #define IPC_AGAIN_DELAY (1000 * 2) /* 2ms */
    45 
    4644/** Tell USB address assigned to given device.
    4745 *
     
    152150        }
    153151
    154         /*
    155          * Asking for "my" address may require several attempts.
    156          * That is because following scenario may happen:
    157          *  - parent driver (i.e. driver of parent device) announces new device
    158          *    and devman launches current driver
    159          *  - parent driver is preempted and thus does not send address-handle
    160          *    binding to HC driver
    161          *  - this driver gets here and wants the binding
    162          *  - the HC does not know the binding yet and thus it answers ENOENT
    163          *  So, we need to wait for the HC to learn the binding.
    164          */
    165         do {
    166                 my_address = get_my_address(parent_phone, dev);
    167 
    168                 if (my_address == ENOENT) {
    169                         /* Be nice, let other fibrils run and try again. */
    170                         async_usleep(IPC_AGAIN_DELAY);
    171                 } else if (my_address < 0) {
    172                         /* Some other problem, no sense trying again. */
    173                         rc = my_address;
    174                         goto leave;
    175                 }
    176 
    177         } while (my_address < 0);
     152        my_address = get_my_address(parent_phone, dev);
     153        if (my_address < 0) {
     154                rc = my_address;
     155                goto leave;
     156        }
    178157
    179158        rc = usb_device_connection_initialize(connection,
Note: See TracChangeset for help on using the changeset viewer.