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:
parent
1f992e891c
commit
7c8dada6bc
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue