1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2025-04-21 12:27:27 +03:00

tools/lib/atusb.c: eliminated global variable to allow for multiple sessions

- atusb.c: introduced descriptor structure, replacing direct USB device
  handle
- atusb.c (error): moved global variable into descriptor
- driver.h (atusb_dev_handle), atusb.c (atusb_dev_handle), atrf.c
  (atrf_usb_handle): call driver to perform the no longer trivial
  translation
This commit is contained in:
Werner Almesberger
2011-04-12 09:22:40 -03:00
parent 02b80879bf
commit 95c8fce729
3 changed files with 87 additions and 62 deletions

View File

@@ -44,7 +44,7 @@ void *atrf_usb_handle(struct atrf_dsc *dsc)
{
#ifdef HAVE_USB
if (dsc->driver == &atusb_driver)
return dsc->handle;
return atusb_dev_handle(dsc->handle);
#endif
return NULL;
}