chips/pn53x: drivers now uses pn53x_data_new() and pn53x_data_free() to handle strcut pn53x_data allocation, initialization and freeing.

This commit is contained in:
Romuald Conty 2011-05-25 10:25:17 +00:00
parent c45d4e685a
commit 22e25a8b1e
8 changed files with 22 additions and 8 deletions

View file

@ -2467,3 +2467,12 @@ pn53x_data_new (nfc_device_t * pnd, const struct pn53x_io* io)
CHIP_DATA (pnd)->wb_trigged = false;
memset (CHIP_DATA (pnd)->wb_mask, 0x00, PN53X_CACHE_REGISTER_SIZE);
}
void
pn53x_data_free (nfc_device_t * pnd)
{
if (CHIP_DATA (pnd)->current_target) {
free (CHIP_DATA (pnd)->current_target);
}
free (pnd->chip_data);
}

View file

@ -337,5 +337,6 @@ bool pn53x_check_error_frame (nfc_device_t * pnd, const byte_t * pbtRxFrame,
bool pn53x_build_frame (byte_t * pbtFrame, size_t * pszFrame, const byte_t * pbtData, const size_t szData);
void pn53x_data_new (nfc_device_t * pnd, const struct pn53x_io* io);
void pn53x_data_free (nfc_device_t * pnd);
#endif // __NFC_CHIPS_PN53X_H__