Skip to content

Commit

Permalink
libztex: in case the selectFpga() failed set the selected fpga to unk…
Browse files Browse the repository at this point in the history
…nown

after libztex_selectFpga() failed we can not be sure which fpga is now
selected. can be the old one or maybe even the new one. so set the
selected fpga variable to unknown so that the next call must set it
again.
  • Loading branch information
denis2342 committed Dec 9, 2012
1 parent f5a5759 commit 0559d0b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions libztex.c
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,7 @@ int libztex_selectFpga(struct libztex_device *ztex)
cnt = libusb_control_transfer(ztex->root->hndl, 0x40, 0x51, (uint16_t)number, 0, NULL, 0, 500);
if (unlikely(cnt < 0)) {
applog(LOG_ERR, "Ztex check device: Failed to set fpga with err %d", cnt);
ztex->root->selectedFpga = -1;
return cnt;
}
ztex->root->selectedFpga = number;
Expand Down

0 comments on commit 0559d0b

Please sign in to comment.