drivers: spi: nrfx_spi(m|s): s/_DEVICE/_DEFINE

Use SPI_NRFX_SPI(M|S)_DEFINE, since the macro _defines_ a device.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
Gerard Marull-Paretas 2022-06-20 22:27:32 +02:00 committed by Marti Bolivar
commit a8b444f956
3 changed files with 15 additions and 15 deletions

View file

@ -346,7 +346,7 @@ static int spi_nrfx_pm_action(const struct device *dev,
NRFX_SPI_PIN_NOT_USED), \
.miso_pull = SPI_NRFX_MISO_PULL(idx),))
#define SPI_NRFX_SPI_DEVICE(idx) \
#define SPI_NRFX_SPI_DEFINE(idx) \
NRF_DT_CHECK_PIN_ASSIGNMENTS(SPI(idx), 1, \
sck_pin, mosi_pin, miso_pin); \
BUILD_ASSERT(IS_ENABLED(CONFIG_PINCTRL) || \
@ -406,13 +406,13 @@ static int spi_nrfx_pm_action(const struct device *dev,
&spi_nrfx_driver_api)
#ifdef CONFIG_SPI_0_NRF_SPI
SPI_NRFX_SPI_DEVICE(0);
SPI_NRFX_SPI_DEFINE(0);
#endif
#ifdef CONFIG_SPI_1_NRF_SPI
SPI_NRFX_SPI_DEVICE(1);
SPI_NRFX_SPI_DEFINE(1);
#endif
#ifdef CONFIG_SPI_2_NRF_SPI
SPI_NRFX_SPI_DEVICE(2);
SPI_NRFX_SPI_DEFINE(2);
#endif

View file

@ -520,7 +520,7 @@ static int spim_nrfx_pm_action(const struct device *dev,
NRFX_SPIM_PIN_NOT_USED), \
.miso_pull = SPIM_NRFX_MISO_PULL(idx),))
#define SPI_NRFX_SPIM_DEVICE(idx) \
#define SPI_NRFX_SPIM_DEFINE(idx) \
NRF_DT_CHECK_PIN_ASSIGNMENTS(SPIM(idx), 1, \
sck_pin, mosi_pin, miso_pin); \
BUILD_ASSERT(IS_ENABLED(CONFIG_PINCTRL) || \
@ -600,21 +600,21 @@ static int spim_nrfx_pm_action(const struct device *dev,
())
#ifdef CONFIG_SPI_0_NRF_SPIM
SPI_NRFX_SPIM_DEVICE(0);
SPI_NRFX_SPIM_DEFINE(0);
#endif
#ifdef CONFIG_SPI_1_NRF_SPIM
SPI_NRFX_SPIM_DEVICE(1);
SPI_NRFX_SPIM_DEFINE(1);
#endif
#ifdef CONFIG_SPI_2_NRF_SPIM
SPI_NRFX_SPIM_DEVICE(2);
SPI_NRFX_SPIM_DEFINE(2);
#endif
#ifdef CONFIG_SPI_3_NRF_SPIM
SPI_NRFX_SPIM_DEVICE(3);
SPI_NRFX_SPIM_DEFINE(3);
#endif
#ifdef CONFIG_SPI_4_NRF_SPIM
SPI_NRFX_SPIM_DEVICE(4);
SPI_NRFX_SPIM_DEFINE(4);
#endif

View file

@ -272,7 +272,7 @@ static int init_spis(const struct device *dev,
.csn_pullup = NRF_GPIO_PIN_NOPULL, \
.miso_drive = NRF_GPIO_PIN_S0S1,))
#define SPI_NRFX_SPIS_DEVICE(idx) \
#define SPI_NRFX_SPIS_DEFINE(idx) \
NRF_DT_CHECK_PIN_ASSIGNMENTS(SPIS(idx), 0, \
sck_pin, mosi_pin, miso_pin, csn_pin); \
static int spi_##idx##_init(const struct device *dev) \
@ -319,17 +319,17 @@ static int init_spis(const struct device *dev,
&spi_nrfx_driver_api)
#ifdef CONFIG_SPI_0_NRF_SPIS
SPI_NRFX_SPIS_DEVICE(0);
SPI_NRFX_SPIS_DEFINE(0);
#endif
#ifdef CONFIG_SPI_1_NRF_SPIS
SPI_NRFX_SPIS_DEVICE(1);
SPI_NRFX_SPIS_DEFINE(1);
#endif
#ifdef CONFIG_SPI_2_NRF_SPIS
SPI_NRFX_SPIS_DEVICE(2);
SPI_NRFX_SPIS_DEFINE(2);
#endif
#ifdef CONFIG_SPI_3_NRF_SPIS
SPI_NRFX_SPIS_DEVICE(3);
SPI_NRFX_SPIS_DEFINE(3);
#endif