drivers: bma280: 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:08:08 +05:30 committed by Maureen Helm
parent 3754a4f77f
commit 1f992e891c
1 changed files with 3 additions and 4 deletions

View File

@ -152,12 +152,11 @@ int bma280_init(struct device *dev)
}
#endif
dev->driver_api = &bma280_driver_api;
return 0;
}
struct bma280_data bma280_driver;
DEVICE_INIT(bma280, CONFIG_BMA280_NAME, bma280_init, &bma280_driver,
NULL, POST_KERNEL, CONFIG_SENSOR_INIT_PRIORITY);
DEVICE_AND_API_INIT(bma280, CONFIG_BMA280_NAME, bma280_init, &bma280_driver,
NULL, POST_KERNEL, CONFIG_SENSOR_INIT_PRIORITY,
&bma280_driver_api);