Lines Matching defs:cntlr
265 static int32_t i2cdrv_transfer(struct I2cCntlr *cntlr, struct I2cMsg *msgs, int16_t count)
278 if (cntlr == NULL) {
279 PRINT_ERR("%s: cntlr is null\n", __func__);
282 if (cntlr->priv == NULL) {
283 PRINT_ERR("%s: cntlr->priv is null\n", __func__);
291 bus = (struct i2c_bus *)cntlr->priv;
350 struct I2cCntlr *cntlr = NULL;
359 cntlr = (struct I2cCntlr *)OsalMemAlloc(sizeof(struct I2cCntlr));
362 if (cntlr == NULL) {
363 PRINT_ERR("%s: cntlr is null\n", __func__);
368 if (cntlr != NULL) {
369 OsalMemFree(cntlr);
370 cntlr = NULL;
380 if (cntlr != NULL) {
381 OsalMemFree(cntlr);
382 cntlr = NULL;
387 memset_s(cntlr, sizeof(struct I2cCntlr), 0, sizeof(struct I2cCntlr));
388 cntlr->ops = &m_i2c_method;
389 device->priv = (void *)cntlr;
394 cntlr->priv = NULL;
395 cntlr->ops = NULL;
401 if (cntlr != NULL) {
402 OsalMemFree(cntlr);
403 cntlr = NULL;
412 cntlr->priv = NULL;
413 cntlr->ops = NULL;
419 if (cntlr != NULL) {
420 OsalMemFree(cntlr);
421 cntlr = NULL;
426 cntlr->priv = (void *)bus;
428 ret = I2cCntlrAdd(cntlr);
430 PRINT_ERR("%s: i2c cntlr add failed\n", __func__);
431 I2cCntlrRemove(cntlr);
433 cntlr->priv = NULL;
434 cntlr->ops = NULL;
440 if (cntlr != NULL) {
441 OsalMemFree(cntlr);
442 cntlr = NULL;
453 struct I2cCntlr *cntlr = NULL;
461 cntlr = (struct I2cCntlr *)device->priv;
462 if (cntlr == NULL) {
463 PRINT_ERR("%s: cntlr is null\n", __func__);
467 bus = (struct i2c_bus *)cntlr->priv;
473 I2cCntlrRemove(cntlr);
475 cntlr->priv = NULL;
476 cntlr->ops = NULL;
482 if (cntlr != NULL) {
483 OsalMemFree(cntlr);
484 cntlr = NULL;