diff --git a/include/i2c.h b/include/i2c.h index 45f84324068..838d9372d29 100644 --- a/include/i2c.h +++ b/include/i2c.h @@ -199,7 +199,8 @@ __syscall int i2c_configure(struct device *dev, u32_t dev_config); static inline int _impl_i2c_configure(struct device *dev, u32_t dev_config) { - const struct i2c_driver_api *api = dev->driver_api; + const struct i2c_driver_api *api = + (const struct i2c_driver_api *)dev->driver_api; return api->configure(dev, dev_config); } @@ -230,7 +231,8 @@ static inline int _impl_i2c_transfer(struct device *dev, struct i2c_msg *msgs, u8_t num_msgs, u16_t addr) { - const struct i2c_driver_api *api = dev->driver_api; + const struct i2c_driver_api *api = + (const struct i2c_driver_api *)dev->driver_api; return api->transfer(dev, msgs, num_msgs, addr); } @@ -264,7 +266,8 @@ __syscall int i2c_slave_register(struct device *dev, static inline int _impl_i2c_slave_register(struct device *dev, struct i2c_slave_config *cfg) { - const struct i2c_driver_api *api = dev->driver_api; + const struct i2c_driver_api *api = + (const struct i2c_driver_api *)dev->driver_api; if (!api->slave_register) { return -ENOTSUP; @@ -294,7 +297,8 @@ __syscall int i2c_slave_unregister(struct device *dev, static inline int _impl_i2c_slave_unregister(struct device *dev, struct i2c_slave_config *cfg) { - const struct i2c_driver_api *api = dev->driver_api; + const struct i2c_driver_api *api = + (const struct i2c_driver_api *)dev->driver_api; if (!api->slave_unregister) { return -ENOTSUP; @@ -319,7 +323,8 @@ __syscall int i2c_slave_driver_register(struct device *dev); static inline int _impl_i2c_slave_driver_register(struct device *dev) { - const struct i2c_slave_driver_api *api = dev->driver_api; + const struct i2c_slave_driver_api *api = + (const struct i2c_slave_driver_api *)dev->driver_api; return api->driver_register(dev); } @@ -340,7 +345,8 @@ __syscall int i2c_slave_driver_unregister(struct device *dev); static inline int _impl_i2c_slave_driver_unregister(struct device *dev) { - const struct i2c_slave_driver_api *api = dev->driver_api; + const struct i2c_slave_driver_api *api = + (const struct i2c_slave_driver_api *)dev->driver_api; return api->driver_unregister(dev); }