int i = 0;
int ret;
- pthread_mutex_lock(&dev->lock);
+ pthread_mutex_lock(dev->mutex);
if (flags & I2C_FLAG_ADDR16)
msgbuf[i++] = offset >> 8;
ret = i2c_transfer(dev, msg, 2);
exit:
- pthread_mutex_unlock(&dev->lock);
+ pthread_mutex_unlock(dev->mutex);
return ret;
}
int ret;
int i = 0;
- pthread_mutex_lock(&dev->lock);
+ pthread_mutex_lock(dev->mutex);
if (!dev->xfer) {
ret = -ENODEV;
opae_free(buf);
exit:
- pthread_mutex_unlock(&dev->lock);
+ pthread_mutex_unlock(dev->mutex);
return ret;
}
if (pthread_mutex_init(&dev->lock, NULL))
return NULL;
+ dev->mutex = &dev->lock;
altera_i2c_hardware_init(dev);