drivers: lsm9ds0_gyro: Initialise driver with DEVICE_AND_API_INIT

Replace DEVICE_INIT with DEVICE_AND_API_INIT to reduce code size

Signed-off-by: Punit Vara <punit.vara@intel.com>
This commit is contained in:
Punit Vara 2018-02-04 17:42:09 +05:30 committed by Maureen Helm
parent 1879a4a91f
commit c93ba2f017
1 changed files with 4 additions and 5 deletions

View File

@ -337,8 +337,6 @@ static int lsm9ds0_gyro_init(struct device *dev)
data->dev = dev;
#endif
dev->driver_api = &lsm9ds0_gyro_api_funcs;
return 0;
}
@ -353,6 +351,7 @@ static const struct lsm9ds0_gyro_config lsm9ds0_gyro_config = {
static struct lsm9ds0_gyro_data lsm9ds0_gyro_data;
DEVICE_INIT(lsm9ds0_gyro, CONFIG_LSM9DS0_GYRO_DEV_NAME, lsm9ds0_gyro_init,
&lsm9ds0_gyro_data, &lsm9ds0_gyro_config, POST_KERNEL,
CONFIG_SENSOR_INIT_PRIORITY);
DEVICE_AND_API_INIT(lsm9ds0_gyro, CONFIG_LSM9DS0_GYRO_DEV_NAME,
lsm9ds0_gyro_init, &lsm9ds0_gyro_data, &lsm9ds0_gyro_config,
POST_KERNEL, CONFIG_SENSOR_INIT_PRIORITY,
&lsm9ds0_gyro_api_funcs);