Skip to content

Commit

Permalink
ftdi/mpsse: Attach kernel driver on mpsse_close.
Browse files Browse the repository at this point in the history
The kernel driver is used when the ftdi chip is connected as an UART.

Signed-off-by: Joakim Gebart <[email protected]>
  • Loading branch information
jnohlgard committed Nov 4, 2013
1 parent 75b4cbe commit fd5ebfa
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/jtag/drivers/mpsse.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,11 @@ struct mpsse_ctx *mpsse_open(const uint16_t *vid, const uint16_t *pid, const cha

void mpsse_close(struct mpsse_ctx *ctx)
{
if (ctx->usb_dev)
if (ctx->usb_dev) {
if (ctx->interface)
libusb_attach_kernel_driver(ctx->usb_dev, ctx->interface);
libusb_close(ctx->usb_dev);
}
if (ctx->usb_ctx)
libusb_exit(ctx->usb_ctx);
bit_copy_discard(&ctx->read_queue);
Expand Down

0 comments on commit fd5ebfa

Please sign in to comment.