From b9c7bb89a7f804935c5cfa6ccda54b592d803978 Mon Sep 17 00:00:00 2001 From: Adam Laurie Date: Fri, 4 Dec 2009 13:51:30 +0000 Subject: [PATCH] reverse revision 230 - calling connect(NULL) is correct behaviour (selects 1st available device) --- src/lib/nfc.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/lib/nfc.c b/src/lib/nfc.c index f9e1be5..5b85dbc 100644 --- a/src/lib/nfc.c +++ b/src/lib/nfc.c @@ -124,10 +124,9 @@ nfc_device_t* nfc_connect(nfc_device_desc_t* pndd) DBG("Autodetecting available devices using %s driver.", drivers_callbacks_list[uiDriver].acDriver); pndd = drivers_callbacks_list[uiDriver].pick_device (); } - if (pndd != NULL) { - DBG("Auto-connecting to %s using %s driver", pndd->acDevice, drivers_callbacks_list[uiDriver].acDriver); - pnd = drivers_callbacks_list[uiDriver].connect(pndd); - } + // auto-connect with NULL descriptor is allowed (NULL means "first available") + DBG("Auto-connecting to %s using %s driver", pndd->acDevice, drivers_callbacks_list[uiDriver].acDriver); + pnd = drivers_callbacks_list[uiDriver].connect(pndd); if(pnd == NULL) { DBG("%s Not found",drivers_callbacks_list[uiDriver].acDriver);