Commit a5375ead authored by Kumar Gala's avatar Kumar Gala Committed by Kumar Gala
Browse files

tests: Convert to new DT_INST macros



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

Signed-off-by: default avatarKumar Gala <kumar.gala@linaro.org>
parent 36049b16
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@ static int powerup_adv7513(struct device *i2c_dev)

static int test_i2c_adv7513(void)
{
	struct device *i2c_dev = device_get_binding(DT_INST_0_NIOS2_I2C_LABEL);
	struct device *i2c_dev = device_get_binding(DT_LABEL(DT_INST(0, nios2_i2c)));
	u32_t i2c_cfg = I2C_SPEED_SET(I2C_SPEED_STANDARD) | I2C_MODE_MASTER;
	u8_t data;

+1 −1
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@
#define GPIO_OUT_PIN            23
#define GPIO_INT_PIN            24
#define GPIO_NAME               "GPIO_"
#define GPIO_DRV_NAME           DT_INST_0_SNPS_DESIGNWARE_GPIO_LABEL
#define GPIO_DRV_NAME           DT_LABEL(DT_INST(0, snps_designware_gpio))

/* size of stack area used by each thread */
#define STACKSIZE               1024
+1 −1
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ void test_flash(void)
	u32_t magic[4];
	int i;

	flash_dev = device_get_binding(DT_INST_0_JEDEC_SPI_NOR_LABEL);
	flash_dev = device_get_binding(DT_LABEL(DT_INST(0, jedec_spi_nor)));

	if (!flash_dev) {
		LOG_ERR("SPI flash driver was not found!\n");
+1 −1
Original line number Diff line number Diff line
@@ -127,7 +127,7 @@

#elif defined(CONFIG_SOC_FAMILY_SAM0)
#include <soc.h>
#define ADC_DEVICE_NAME         DT_INST_0_ATMEL_SAM0_ADC_LABEL
#define ADC_DEVICE_NAME         DT_LABEL(DT_INST(0, atmel_sam0_adc))
#define ADC_RESOLUTION          12
#define ADC_GAIN                ADC_GAIN_1
#define ADC_REFERENCE           ADC_REF_INTERNAL
+3 −3
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@
#include <logging/log.h>
LOG_MODULE_REGISTER(test);

#ifdef DT_INST_0_NORDIC_NRF_CLOCK_LABEL
#if DT_HAS_NODE(DT_INST(0, nordic_nrf_clock))
#include <drivers/clock_control/nrf_clock_control.h>
#endif

@@ -24,9 +24,9 @@ struct device_data {
};

static const struct device_data devices[] = {
#ifdef DT_INST_0_NORDIC_NRF_CLOCK_LABEL
#if DT_HAS_NODE(DT_INST(0, nordic_nrf_clock))
	{
		.name = DT_INST_0_NORDIC_NRF_CLOCK_LABEL,
		.name = DT_LABEL(DT_INST(0, nordic_nrf_clock)),
		.subsys_data =  (const struct device_subsys_data[]){
			{
				.subsys = CLOCK_CONTROL_NRF_SUBSYS_HF,
Loading