drivers: sensors: Convert to new DT_INST macros

Convert older DT_INST_ macro use the new include/devicetree.h
DT_INST macro APIs.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2020-03-30 10:08:08 -05:00 committed by Maureen Helm
commit 9872dc16b5
66 changed files with 491 additions and 399 deletions

View file

@ -4,6 +4,8 @@
* SPDX-License-Identifier: Apache-2.0
*/
#define DT_DRV_COMPAT adi_adt7420
#include <device.h>
#include <drivers/i2c.h>
#include <sys/byteorder.h>
@ -216,15 +218,15 @@ static int adt7420_init(struct device *dev)
static struct adt7420_data adt7420_driver;
static const struct adt7420_dev_config adt7420_config = {
.i2c_port = DT_INST_0_ADI_ADT7420_BUS_NAME,
.i2c_addr = DT_INST_0_ADI_ADT7420_BASE_ADDRESS,
.i2c_port = DT_INST_BUS_LABEL(0),
.i2c_addr = DT_INST_REG_ADDR(0),
#ifdef CONFIG_ADT7420_TRIGGER
.int_pin = DT_INST_0_ADI_ADT7420_INT_GPIOS_PIN,
.int_flags = DT_INST_0_ADI_ADT7420_INT_GPIOS_FLAGS,
.int_name = DT_INST_0_ADI_ADT7420_INT_GPIOS_CONTROLLER,
.int_pin = DT_INST_GPIO_PIN(0, int_gpios),
.int_flags = DT_INST_GPIO_FLAGS(0, int_gpios),
.int_name = DT_INST_GPIO_LABEL(0, int_gpios),
#endif
};
DEVICE_AND_API_INIT(adt7420, DT_INST_0_ADI_ADT7420_LABEL, adt7420_init, &adt7420_driver,
DEVICE_AND_API_INIT(adt7420, DT_INST_LABEL(0), adt7420_init, &adt7420_driver,
&adt7420_config, POST_KERNEL, CONFIG_SENSOR_INIT_PRIORITY,
&adt7420_driver_api);