summaryrefslogtreecommitdiff
path: root/zephyr/test/drivers/src/temp_sensor.c
diff options
context:
space:
mode:
authorFabio Baltieri <fabiobaltieri@google.com>2021-06-24 17:24:55 +0000
committerCommit Bot <commit-bot@chromium.org>2021-06-28 12:57:02 +0000
commitd1c28d2974d8f573e727abb41e783b855b52f99d (patch)
tree1647614c99db0c73e18e2dd0ed1e0459f56dd6ff /zephyr/test/drivers/src/temp_sensor.c
parent96528ae712a9ebfa3658ba4943b60c7a527cfba4 (diff)
downloadchrome-ec-d1c28d2974d8f573e727abb41e783b855b52f99d.tar.gz
zephyr: test: convert tests to DEVICE_DT_GETstabilize-RUST-14057.B-mainstabilize-14057.B-main
Convert Zephyr tests from device_get_binding to DEVICE_DT_GET. BRANCH=none BUG=none TEST=cq dry drun Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I0da71b58d70c66bf68503b7c80e57051aace60c7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2985465 Reviewed-by: Yuval Peress <peress@chromium.org>
Diffstat (limited to 'zephyr/test/drivers/src/temp_sensor.c')
-rw-r--r--zephyr/test/drivers/src/temp_sensor.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/zephyr/test/drivers/src/temp_sensor.c b/zephyr/test/drivers/src/temp_sensor.c
index 2e25bab67a..7cfc40b9d5 100644
--- a/zephyr/test/drivers/src/temp_sensor.c
+++ b/zephyr/test/drivers/src/temp_sensor.c
@@ -19,7 +19,7 @@
#define GPIO_PG_EC_DSW_PWROK_PATH DT_PATH(named_gpios, pg_ec_dsw_pwrok)
#define GPIO_PG_EC_DSW_PWROK_PORT DT_GPIO_PIN(GPIO_PG_EC_DSW_PWROK_PATH, gpios)
-#define ADC_DEVICE_NAME DT_LABEL(DT_NODELABEL(adc0))
+#define ADC_DEVICE_NODE DT_NODELABEL(adc0)
#define ADC_CHANNELS_NUM DT_PROP(DT_NODELABEL(adc0), nchannels)
/** Test error code when invalid sensor is passed to temp_sensor_read() */
@@ -96,7 +96,7 @@ static void check_valid_temperature(const struct device *adc_dev, int sensor)
/** Test if temp_sensor_read() returns temperature on success */
static void test_temp_sensor_read(void)
{
- const struct device *adc_dev = device_get_binding(ADC_DEVICE_NAME);
+ const struct device *adc_dev = DEVICE_DT_GET(ADC_DEVICE_NODE);
int chan;
zassert_not_null(adc_dev, "Cannot get ADC device");