Commit 5ceea4fb authored by Jeremy Bettis's avatar Jeremy Bettis Committed by Carles Cufi
Browse files

drivers: Use #if



Use #if instead of IS_ENABLED for
CONFIG_SOC_IT8XXX2_GPIO_GROUP_K_L_DEFAULT_PULL_DOWN, otherwise DTS files
are required to provide gpiok and gpiol even if they are not used.

Bug #66401

Signed-off-by: default avatarJeremy Bettis <jbettis@google.com>
parent 864b1c57
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -478,9 +478,9 @@ DEVICE_DT_INST_DEFINE(inst, \

DT_INST_FOREACH_STATUS_OKAY(GPIO_ITE_DEV_CFG_DATA)

#ifdef CONFIG_SOC_IT8XXX2_GPIO_GROUP_K_L_DEFAULT_PULL_DOWN
static int gpio_it8xxx2_init_set(void)
{
	if (IS_ENABLED(CONFIG_SOC_IT8XXX2_GPIO_GROUP_K_L_DEFAULT_PULL_DOWN)) {
	const struct device *const gpiok = DEVICE_DT_GET(DT_NODELABEL(gpiok));
	const struct device *const gpiol = DEVICE_DT_GET(DT_NODELABEL(gpiol));

@@ -488,8 +488,8 @@ static int gpio_it8xxx2_init_set(void)
		gpio_pin_configure(gpiok, i, GPIO_INPUT | GPIO_PULL_DOWN);
		gpio_pin_configure(gpiol, i, GPIO_INPUT | GPIO_PULL_DOWN);
	}
	}

	return 0;
}
SYS_INIT(gpio_it8xxx2_init_set, PRE_KERNEL_1, CONFIG_GPIO_INIT_PRIORITY);
#endif /* CONFIG_SOC_IT8XXX2_GPIO_GROUP_K_L_DEFAULT_PULL_DOWN */