tests: subsys: sd: sdmmc: Convert to use DEVICE_DT_GET
Move to use DEVICE_DT_GET instead of device_get_binding as we work on phasing out use of DTS 'label' property. Move to using alias 'sdhc0' for SDHC controller. Signed-off-by: Kumar Gala <galak@kernel.org>
This commit is contained in:
parent
459425c7b9
commit
02d0d20d59
3 changed files with 3 additions and 17 deletions
|
@ -1,13 +0,0 @@
|
|||
# Copyright 2022 NXP
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
mainmenu "SD Host controller test"
|
||||
|
||||
source "Kconfig.zephyr"
|
||||
|
||||
config SDHC_LABEL
|
||||
string "SD host controller label"
|
||||
default "SDHC_0"
|
||||
help
|
||||
Devicetree label for SD host controller. Used to get reference to
|
||||
device
|
|
@ -14,7 +14,7 @@
|
|||
#define SECTOR_COUNT 32
|
||||
#define SECTOR_SIZE 512 /* subsystem should set all cards to 512 byte blocks */
|
||||
#define BUF_SIZE SECTOR_SIZE * SECTOR_COUNT
|
||||
const struct device *sdhc_dev;
|
||||
static const struct device *sdhc_dev = DEVICE_DT_GET(DT_ALIAS(sdhc0));
|
||||
static struct sd_card card;
|
||||
static uint8_t buf[BUF_SIZE] __aligned(CONFIG_SDHC_BUFFER_ALIGNMENT);
|
||||
static uint8_t check_buf[BUF_SIZE] __aligned(CONFIG_SDHC_BUFFER_ALIGNMENT);
|
||||
|
@ -29,8 +29,7 @@ ZTEST(sd_stack, test_init)
|
|||
{
|
||||
int ret;
|
||||
|
||||
sdhc_dev = device_get_binding(CONFIG_SDHC_LABEL);
|
||||
zassert_not_null(sdhc_dev, "Could not get SD host controller dev");
|
||||
zassert_true(device_is_ready(sdhc_dev), "SDHC device is not ready");
|
||||
|
||||
ret = sd_is_card_present(sdhc_dev);
|
||||
zassert_equal(ret, 1, "SD card not present in slot");
|
||||
|
|
|
@ -6,7 +6,7 @@ tests:
|
|||
harness: ztest
|
||||
harness_config:
|
||||
fixture: fixture_sdhc
|
||||
filter: CONFIG_SD_STACK
|
||||
filter: dt_alias_exists("sdhc0")
|
||||
tags: sdhc
|
||||
min_ram: 32
|
||||
integration_platforms:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue