From 8bc0fdaf5651a8c3ba1b2ca3b4d03ac0ab2d7cc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Thu, 20 Jul 2023 09:58:15 +0200 Subject: [PATCH] drivers: pwm_nrfx: Clean up driver instantiation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - use CONFIG_HAS_HW_NRF_* symbols consistently in nRF multi-instance drivers when creating particular driver instances - remove unnecessary hidden Kconfig options that indicated the type of peripheral to be used by a given instance (e.g. SPI, SPIM, or SPIS) and enabled proper nrfx driver instance; instead, use one option per peripheral type and include the corresponding shim driver flavor into compilation basing on that option (not the one that enables the nrfx driver as it was incorrectly done so far in some cases) Signed-off-by: Andrzej Głąbek --- drivers/pwm/pwm_nrfx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/pwm/pwm_nrfx.c b/drivers/pwm/pwm_nrfx.c index 1a671aaf731..373f8eef7e2 100644 --- a/drivers/pwm/pwm_nrfx.c +++ b/drivers/pwm/pwm_nrfx.c @@ -351,18 +351,18 @@ static int pwm_nrfx_pm_action(const struct device *dev, POST_KERNEL, CONFIG_PWM_INIT_PRIORITY, \ &pwm_nrfx_drv_api_funcs) -#if DT_NODE_HAS_STATUS(DT_NODELABEL(pwm0), okay) +#ifdef CONFIG_HAS_HW_NRF_PWM0 PWM_NRFX_DEVICE(0); #endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(pwm1), okay) +#ifdef CONFIG_HAS_HW_NRF_PWM1 PWM_NRFX_DEVICE(1); #endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(pwm2), okay) +#ifdef CONFIG_HAS_HW_NRF_PWM2 PWM_NRFX_DEVICE(2); #endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(pwm3), okay) +#ifdef CONFIG_HAS_HW_NRF_PWM3 PWM_NRFX_DEVICE(3); #endif