From f89ca1164c280ef4a5203c5a712a091f8e11690d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Thu, 20 Jul 2023 09:59:51 +0200 Subject: [PATCH] drivers: sensor: qdec_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/sensor/qdec_nrfx/qdec_nrfx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/sensor/qdec_nrfx/qdec_nrfx.c b/drivers/sensor/qdec_nrfx/qdec_nrfx.c index 7d8f71cede2..81c3614fc05 100644 --- a/drivers/sensor/qdec_nrfx/qdec_nrfx.c +++ b/drivers/sensor/qdec_nrfx/qdec_nrfx.c @@ -299,10 +299,10 @@ static int qdec_nrfx_init(const struct device *dev) CONFIG_SENSOR_INIT_PRIORITY, \ &qdec_nrfx_driver_api) -#if DT_NODE_HAS_STATUS(DT_NODELABEL(qdec0), okay) +#ifdef CONFIG_HAS_HW_NRF_QDEC0 SENSOR_NRFX_QDEC_DEVICE(0); #endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(qdec1), okay) +#ifdef CONFIG_HAS_HW_NRF_QDEC1 SENSOR_NRFX_QDEC_DEVICE(1); #endif