Changes in / [458e40c:bfc12ef] in mainline
- Location:
- uspace
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhub/main.c
r458e40c rbfc12ef 65 65 int main(int argc, char *argv[]) 66 66 { 67 usb_ log_enable(USB_LOG_LEVEL_INFO, NAME);67 usb_dprintf_enable(NAME, USB_LOG_LEVEL_INFO); 68 68 69 69 fibril_mutex_initialize(&usb_hub_list_lock); -
uspace/drv/usbhub/usbhub_private.h
r458e40c rbfc12ef 65 65 //************ 66 66 #define dprintf(level, format, ...) \ 67 usb_ log_printf((level), format "\n", ##__VA_ARGS__)67 usb_dprintf(NAME, (level), format "\n", ##__VA_ARGS__) 68 68 69 69 -
uspace/lib/usb/src/debug.c
r458e40c rbfc12ef 206 206 void usb_log_printf(usb_log_level_t level, const char *format, ...) 207 207 { 208 FILE *s creen_stream = NULL;208 FILE *stream = NULL; 209 209 switch (level) { 210 210 case USB_LOG_LEVEL_FATAL: 211 211 case USB_LOG_LEVEL_ERROR: 212 s creen_stream = stderr;212 stream = stderr; 213 213 break; 214 214 default: 215 s creen_stream = stdout;215 stream = stdout; 216 216 break; 217 217 } 218 assert(s creen_stream != NULL);218 assert(stream != NULL); 219 219 220 220 va_list args; 221 va_start(args, format); 221 222 222 223 /* … … 230 231 231 232 if (log_stream != NULL) { 232 va_start(args, format);233 234 233 fprintf(log_stream, "[%s]%s: ", log_prefix, level_name); 235 234 vfprintf(log_stream, format, args); 236 fflush(log_stream);237 238 va_end(args);239 235 } 240 236 241 237 if (level <= log_level) { 242 va_start(args, format); 243 244 fprintf(screen_stream, "[%s]%s: ", log_prefix, level_name); 245 vfprintf(screen_stream, format, args); 246 fflush(screen_stream); 247 248 va_end(args); 238 fprintf(stream, "[%s]%s: ", log_prefix, level_name); 239 vfprintf(stream, format, args); 249 240 } 250 241 251 242 fibril_mutex_unlock(&log_serializer); 243 244 va_end(args); 252 245 } 253 246 -
uspace/lib/usb/src/recognise.c
r458e40c rbfc12ef 359 359 { 360 360 static size_t device_name_index = 0; 361 static FIBRIL_MUTEX_INITIALIZE(device_name_index_mutex);362 363 size_t this_device_name_index;364 365 fibril_mutex_lock(&device_name_index_mutex);366 this_device_name_index = device_name_index;367 device_name_index++;368 fibril_mutex_unlock(&device_name_index_mutex);369 370 361 371 362 device_t *child = NULL; … … 383 374 * naming etc., something more descriptive could be created. 384 375 */ 385 rc = asprintf(&child_name, "usbdev%02zu", this_device_name_index);376 rc = asprintf(&child_name, "usbdev%02zu", device_name_index); 386 377 if (rc < 0) { 387 378 goto failure; … … 405 396 } 406 397 398 device_name_index++; 399 407 400 return EOK; 408 401
Note:
See TracChangeset
for help on using the changeset viewer.