diff --git a/drivers/sensor/lsm9ds0_gyro/lsm9ds0_gyro.c b/drivers/sensor/lsm9ds0_gyro/lsm9ds0_gyro.c index c70259e8248..8de11353de6 100644 --- a/drivers/sensor/lsm9ds0_gyro/lsm9ds0_gyro.c +++ b/drivers/sensor/lsm9ds0_gyro/lsm9ds0_gyro.c @@ -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);