Date:2011-04-10 22:34:46 (12 years 11 months ago)
Author:Werner Almesberger
Commit:7be700df117fd33c76d96eca9a801502a88329cc
Message:tools/lib/atrf.c: perform driver-specific operations only if using that driver

- atrf.c (atrf_usb_handle): only return the handle if using the atusb
driver
- atrf.c (atrf_ben_regs): only call atben_regs if using the atben driver
Files: tools/lib/atrf.c (1 diff)

Change Details

tools/lib/atrf.c
3131void *atrf_usb_handle(struct atrf_dsc *dsc)
3232{
3333#ifdef HAVE_USB
34    return dsc->handle;
35#else
36    return NULL;
34    if (dsc->driver == &atusb_driver)
35        return dsc->handle;
3736#endif
37    return NULL;
3838}
3939
4040
4141void *atrf_ben_regs(struct atrf_dsc *dsc)
4242{
4343#ifdef HAVE_BEN
44    return atben_regs(dsc->handle);
45#else
46    return NULL;
44    if (dsc->driver == &atben_driver)
45        return atben_regs(dsc->handle);
4746#endif
47    return NULL;
4848}
4949
5050

Archive Download the corresponding diff file



interactive