drivers: dht: 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:24:58 +05:30 committed by Maureen Helm
commit 7c8dada6bc

View file

@ -225,12 +225,10 @@ static int dht_init(struct device *dev)
gpio_pin_write(drv_data->gpio, CONFIG_DHT_GPIO_PIN_NUM, 1);
dev->driver_api = &dht_api;
return 0;
}
struct dht_data dht_data;
DEVICE_INIT(dht_dev, CONFIG_DHT_NAME, &dht_init, &dht_data,
NULL, POST_KERNEL, CONFIG_SENSOR_INIT_PRIORITY);
DEVICE_AND_API_INIT(dht_dev, CONFIG_DHT_NAME, &dht_init, &dht_data,
NULL, POST_KERNEL, CONFIG_SENSOR_INIT_PRIORITY, &dht_api);