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
parent 1f992e891c
commit 7c8dada6bc
1 changed files with 2 additions and 4 deletions

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); gpio_pin_write(drv_data->gpio, CONFIG_DHT_GPIO_PIN_NUM, 1);
dev->driver_api = &dht_api;
return 0; return 0;
} }
struct dht_data dht_data; struct dht_data dht_data;
DEVICE_INIT(dht_dev, CONFIG_DHT_NAME, &dht_init, &dht_data, DEVICE_AND_API_INIT(dht_dev, CONFIG_DHT_NAME, &dht_init, &dht_data,
NULL, POST_KERNEL, CONFIG_SENSOR_INIT_PRIORITY); NULL, POST_KERNEL, CONFIG_SENSOR_INIT_PRIORITY, &dht_api);