driver Arygon: don't try to send commands if reset failed

This commit is contained in:
Philippe Teuwen 2013-10-01 12:27:19 +02:00
parent 252f590d5c
commit 1596255506

View file

@ -206,10 +206,8 @@ struct arygon_descriptor {
};
static void
arygon_close(nfc_device *pnd)
arygon_close_step2(nfc_device *pnd)
{
pn53x_idle(pnd);
// Release UART port
uart_close(DRIVER_DATA(pnd)->port);
@ -223,6 +221,13 @@ arygon_close(nfc_device *pnd)
nfc_device_free(pnd);
}
static void
arygon_close(nfc_device *pnd)
{
pn53x_idle(pnd);
arygon_close_step2(pnd);
}
static nfc_device *
arygon_open(const nfc_context *context, const nfc_connstring connstring)
{
@ -313,7 +318,7 @@ arygon_open(const nfc_context *context, const nfc_connstring connstring)
// Check communication using "Reset TAMA" command
if (arygon_reset_tama(pnd) < 0) {
arygon_close(pnd);
arygon_close_step2(pnd);
return NULL;
}