src/app/host-serial/libftdi/ftdi.c
struct ftdi_context *ftdi_new(void)
{
    struct ftdi_context * ftdi = (struct ftdi_context *)malloc(sizeof(struct ftdi_context));

    if (ftdi == NULL)
    {
        return NULL;
    }

    if (ftdi_init(ftdi) != 0)
    {
        free(ftdi);
        return NULL;
    }

    return ftdi;
}
/**
    Allocate and initialize a new ftdi_context

    \return a pointer to a new ftdi_context, or NULL on failure
*/
Allocate and initialize a new ftdi_context
\return a pointer to a new ftdi_context, or NULL on failure
Allocate and initialize a new ftdi_context \ return a pointer to a new ftdi_context or NULL on failure
struct ftdi_context *ftdi_new(void)
{
    struct ftdi_context * ftdi = (struct ftdi_context *)malloc(sizeof(struct ftdi_context));
    if (ftdi == NULL)
    {
        return NULL;
    }
    if (ftdi_init(ftdi) != 0)
    {
        free(ftdi);
        return NULL;
    }
    return ftdi;
}
struct ftdi_context * ftdi_new ( void ) { struct ftdi_context * ftdi = ( struct ftdi_context * ) malloc ( sizeof ( struct ftdi_context ) ) ; if ( ftdi == NULL ) { return NULL ; } if ( ftdi_init ( ftdi ) != 0 ) { free ( ftdi ) ; return NULL ; } return ftdi ; }
Allocate and initialize a new ftdi_context
\return a pointer to a new ftdi_context, or NULL on failure
Allocate and initialize a new ftdi_context \ return a pointer to a new ftdi_context or NULL on failure