disk: sdhc: Convert drivers to new DT device macros
Convert sdhc drivers from: DEVICE_AND_API_INIT -> DEVICE_DT_INST_DEFINE DEVICE_DECLARE -> DEVICE_DT_INST_DECLARE Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
parent
f19e36f4a6
commit
07d1e4a45b
3 changed files with 9 additions and 9 deletions
|
@ -4,6 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define DT_DRV_COMPAT zephyr_mmc_spi_slot
|
||||
|
||||
#include <logging/log.h>
|
||||
|
||||
LOG_MODULE_REGISTER(sdhc_spi, CONFIG_DISK_LOG_LEVEL);
|
||||
|
@ -20,7 +22,7 @@ LOG_MODULE_REGISTER(sdhc_spi, CONFIG_DISK_LOG_LEVEL);
|
|||
/* Clock speed used after initialisation */
|
||||
#define SDHC_SPI_SPEED 4000000
|
||||
|
||||
#define SPI_SDHC_NODE DT_INST(0, zephyr_mmc_spi_slot)
|
||||
#define SPI_SDHC_NODE DT_DRV_INST(0)
|
||||
|
||||
#if !DT_NODE_HAS_STATUS(SPI_SDHC_NODE, okay)
|
||||
#warning NO SDHC slot specified on board
|
||||
|
@ -39,7 +41,7 @@ struct sdhc_spi_data {
|
|||
#endif
|
||||
};
|
||||
|
||||
DEVICE_DECLARE(sdhc_spi_0);
|
||||
DEVICE_DT_INST_DECLARE(0);
|
||||
|
||||
/* Traces card traffic for LOG_LEVEL_DBG */
|
||||
static int sdhc_spi_trace(struct sdhc_spi_data *data, int dir, int err,
|
||||
|
@ -977,8 +979,7 @@ static int disk_spi_sdhc_init(const struct device *dev)
|
|||
|
||||
static struct sdhc_spi_data sdhc_spi_data_0;
|
||||
|
||||
DEVICE_AND_API_INIT(sdhc_spi_0,
|
||||
DT_LABEL(SPI_SDHC_NODE),
|
||||
sdhc_spi_init, &sdhc_spi_data_0, NULL,
|
||||
DEVICE_DT_INST_DEFINE(0, sdhc_spi_init, device_pm_control_nop,
|
||||
&sdhc_spi_data_0, NULL,
|
||||
APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, NULL);
|
||||
#endif
|
||||
|
|
|
@ -434,8 +434,7 @@ static struct stm32_sdmmc_priv stm32_sdmmc_priv_1 = {
|
|||
}
|
||||
};
|
||||
|
||||
DEVICE_AND_API_INIT(stm32_sdmmc_dev1,
|
||||
DT_INST_LABEL(0), disk_stm32_sdmmc_init,
|
||||
DEVICE_DT_INST_DEFINE(0, disk_stm32_sdmmc_init, device_pm_control_nop,
|
||||
&stm32_sdmmc_priv_1, NULL, APPLICATION,
|
||||
CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
|
||||
NULL);
|
||||
|
|
|
@ -2845,9 +2845,9 @@ static int disk_usdhc_init(const struct device *dev)
|
|||
\
|
||||
static struct usdhc_priv usdhc_priv_##n; \
|
||||
\
|
||||
DEVICE_AND_API_INIT(usdhc_dev##n, \
|
||||
DT_INST_LABEL(n), \
|
||||
DEVICE_DT_INST_DEFINE(n, \
|
||||
&disk_usdhc_init, \
|
||||
device_pm_control_nop, \
|
||||
&usdhc_priv_##n, \
|
||||
&usdhc_config_##n, \
|
||||
APPLICATION, \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue