components/esp-cryptoauthlib/cryptoauthlib/lib/hal/hal_linux_i2c_userspace.c
ATCA_STATUS hal_i2c_release(void *hal_data)
{
    ATCAI2CMaster_t *hal = (ATCAI2CMaster_t*)hal_data;

    // if the use count for this bus has gone to 0 references, disable it.  protect against an unbracketed release
    if (hal && --(hal->ref_ct) <= 0)
    {
        free(hal);
    }

    return ATCA_SUCCESS;
}
/** \brief manages reference count on given bus and releases resource if no more refences exist
 * \param[in] hal_data - opaque pointer to hal data structure - known only to the HAL implementation
 * \return ATCA_SUCCESS on success, otherwise an error code.
 */
\brief manages reference count on given bus and releases resource if no more refences exist
\param[in] hal_data - opaque pointer to hal data structure - known only to the HAL implementation
\return ATCA_SUCCESS on success, otherwise an error code.
\ brief manages reference count on given bus and releases resource if no more refences exist \ param [ in ] hal_data - opaque pointer to hal data structure - known only to the HAL implementation \ return ATCA_SUCCESS on success otherwise an error code .
ATCA_STATUS hal_i2c_release(void *hal_data)
{
    ATCAI2CMaster_t *hal = (ATCAI2CMaster_t*)hal_data;
    if (hal && --(hal->ref_ct) <= 0)
    {
        free(hal);
    }
    return ATCA_SUCCESS;
}
ATCA_STATUS hal_i2c_release ( void * hal_data ) { ATCAI2CMaster_t * hal = ( ATCAI2CMaster_t * ) hal_data ; if ( hal && -- ( hal -> ref_ct ) <= 0 ) { free ( hal ) ; } return ATCA_SUCCESS ; }
\brief manages reference count on given bus and releases resource if no more refences exist
 \param[in] hal_data - opaque pointer to hal data structure - known only to the HAL implementation
 \return ATCA_SUCCESS on success, otherwise an error code.
\ brief manages reference count on given bus and releases resource if no more refences exist \ param [ in ] hal_data - opaque pointer to hal data structure - known only to the HAL implementation \ return ATCA_SUCCESS on success otherwise an error code .
// if the use count for this bus has gone to 0 references, disable it.  protect against an unbracketed release