Move usb_reset(3) call.

As the documentation states, and as reported in isssue 81 (fixed in r421),
usb_reset()'s argument is invalid after the call and so usb_close(3) must be
called before usb_reset(3).
This commit is contained in:
Romain Tartiere 2010-07-29 10:47:53 +00:00
parent f7e8ec0a95
commit f01b73ab32

View file

@ -232,9 +232,9 @@ void pn53x_usb_disconnect(nfc_device_t* pnd)
if((ret = usb_release_interface(pus->pudh,0)) < 0) if((ret = usb_release_interface(pus->pudh,0)) < 0)
DBG("usb_release failed %i",ret); DBG("usb_release failed %i",ret);
DBG("%s","resetting USB"); DBG("%s","resetting USB");
usb_reset(pus->pudh);
if((ret = usb_close(pus->pudh)) < 0) if((ret = usb_close(pus->pudh)) < 0)
DBG("usb_close failed %i",ret); DBG("usb_close failed %i",ret);
usb_reset(pus->pudh);
free(pnd->nds); free(pnd->nds);
free(pnd); free(pnd);
DBG("%s","done!"); DBG("%s","done!");