Changeset cd50486 in mainline for uspace/lib/usb/src/recognise.c


Ignore:
Timestamp:
2011-02-06T22:03:55Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
25971d2
Parents:
1110ebd (diff), 960ff451 (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.
Message:

Merge development/ changes

File:
1 edited

Legend:

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

    r1110ebd rcd50486  
    3333 * @brief Functions for recognising kind of attached devices.
    3434 */
     35#include <sys/types.h>
    3536#include <usb_iface.h>
    3637#include <usb/usbdrv.h>
     
    359360{
    360361        static size_t device_name_index = 0;
     362        static FIBRIL_MUTEX_INITIALIZE(device_name_index_mutex);
     363
     364        size_t this_device_name_index;
     365
     366        fibril_mutex_lock(&device_name_index_mutex);
     367        this_device_name_index = device_name_index;
     368        device_name_index++;
     369        fibril_mutex_unlock(&device_name_index_mutex);
     370
    361371
    362372        device_t *child = NULL;
     
    374384         * naming etc., something more descriptive could be created.
    375385         */
    376         rc = asprintf(&child_name, "usbdev%02zu", device_name_index);
     386        rc = asprintf(&child_name, "usbdev%02zu", this_device_name_index);
    377387        if (rc < 0) {
    378388                goto failure;
     
    396406        }
    397407       
    398         device_name_index++;
    399 
    400408        return EOK;
    401409
Note: See TracChangeset for help on using the changeset viewer.