diff --git a/i2cbus.c b/i2cbus.c index fa87d29..389d18e 100644 --- a/i2cbus.c +++ b/i2cbus.c @@ -23,7 +23,7 @@ int i2cbus_open(i2cbus *dev, int id, int addr) { for (int i = 0; i < __I2CBUS_MAX_NUM; i++) { - int ret = pthread_mutex_init(&(__i2cbus_lock_ctx[i]), NULL); + int ret = pthread_mutex_init(&(__i2cbus_locks[i]), NULL); if (ret != 0) { eprintf("%s: Failed to init mutex %d, ", __func__, i); @@ -84,7 +84,7 @@ int i2cbus_close(i2cbus *dev) { for (int i = 0; i < __I2CBUS_MAX_NUM; i++) { - int ret = pthread_mutex_destroy(&(__i2cbus_lock_ctx[i])); + int ret = pthread_mutex_destroy(&(__i2cbus_locks[i])); if (ret != 0) { eprintf("%s: Failed to destroy mutex %d, ", __func__, i);