PT3_QM * create_pt3_qm(PT3_I2C *i2c, PT3_TC *tc) { PT3_QM *qm = NULL; if ((qm = pt3_vzalloc(sizeof(PT3_QM)))) { qm->i2c = i2c; qm->tc = tc; qm->sleep = 1; } return qm; }
PT3_MX * create_pt3_mx(PT3_I2C *i2c, PT3_TC *tc) { PT3_MX *mx; mx = NULL; mx = pt3_vzalloc(sizeof(PT3_MX)); if (mx == NULL) goto fail; mx->i2c = i2c; mx->tc = tc; mx->sleep = 1; return mx; fail: if (mx != NULL) vfree(mx); return NULL; }