Rename dev_config_option to nfc_device_option_t.

Use NULL instead of INVALID_DEVICE_INFO to know if device is valid (all occurences are now replaced).
This commit is contained in:
Romuald Conty 2009-11-18 11:11:06 +00:00
parent 2a0ff6c5d0
commit 2feedddbfe
15 changed files with 84 additions and 85 deletions

View file

@ -87,7 +87,7 @@ nfc_device_t* pn533_usb_connect(const nfc_device_desc_t* pndd)
int idproduct = 0x5591;
struct usb_bus *bus;
struct usb_device *dev;
nfc_device_t* pnd = INVALID_DEVICE_INFO;
nfc_device_t* pnd = NULL;
usb_spec_t* pus;
usb_spec_t us;
uint32_t uiDevIndex;
@ -97,8 +97,8 @@ nfc_device_t* pn533_usb_connect(const nfc_device_desc_t* pndd)
us.pudh = NULL;
usb_init();
if (usb_find_busses() < 0) return INVALID_DEVICE_INFO;
if (usb_find_devices() < 0) return INVALID_DEVICE_INFO;
if (usb_find_busses() < 0) return NULL;
if (usb_find_devices() < 0) return NULL;
// Initialize the device index we are seaching for
if( pndd == NULL ) {
@ -133,14 +133,14 @@ nfc_device_t* pn533_usb_connect(const nfc_device_desc_t* pndd)
{
DBG("Setting config failed");
usb_close(us.pudh);
return INVALID_DEVICE_INFO;
return NULL;
}
if(usb_claim_interface(us.pudh,0) < 0)
{
DBG("Can't claim interface");
usb_close(us.pudh);
return INVALID_DEVICE_INFO;
return NULL;
}
// Allocate memory for the device info and specification, fill it and return the info
pus = malloc(sizeof(usb_spec_t));