From 1f992e891c213ffc3cea497ff68f96d8baa436aa Mon Sep 17 00:00:00 2001 From: Punit Vara Date: Sun, 4 Feb 2018 17:08:08 +0530 Subject: [PATCH] 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 --- drivers/sensor/bma280/bma280.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/sensor/bma280/bma280.c b/drivers/sensor/bma280/bma280.c index 4eb0ee6477d..4afd41d987d 100644 --- a/drivers/sensor/bma280/bma280.c +++ b/drivers/sensor/bma280/bma280.c @@ -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);