From 7e286bfc5e2e05e15ff27620366133df41509dde Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Wed, 6 Jul 2022 13:38:38 -0500 Subject: [PATCH] samples: basic: threads: Remove dts label prop usage Replace access to dts 'label' property (which we are phasing out) with simple int as the serve the purpose for error report. Signed-off-by: Kumar Gala --- samples/basic/threads/src/main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/samples/basic/threads/src/main.c b/samples/basic/threads/src/main.c index db39ddfaec..553bd99997 100644 --- a/samples/basic/threads/src/main.c +++ b/samples/basic/threads/src/main.c @@ -38,17 +38,17 @@ K_FIFO_DEFINE(printk_fifo); struct led { struct gpio_dt_spec spec; - const char *gpio_pin_name; + uint8_t num; }; static const struct led led0 = { .spec = GPIO_DT_SPEC_GET_OR(LED0_NODE, gpios, {0}), - .gpio_pin_name = DT_PROP_OR(LED0_NODE, label, ""), + .num = 0, }; static const struct led led1 = { .spec = GPIO_DT_SPEC_GET_OR(LED1_NODE, gpios, {0}), - .gpio_pin_name = DT_PROP_OR(LED1_NODE, label, ""), + .num = 1, }; void blink(const struct led *led, uint32_t sleep_ms, uint32_t id) @@ -64,8 +64,8 @@ void blink(const struct led *led, uint32_t sleep_ms, uint32_t id) ret = gpio_pin_configure_dt(spec, GPIO_OUTPUT); if (ret != 0) { - printk("Error %d: failed to configure pin %d (LED '%s')\n", - ret, spec->pin, led->gpio_pin_name); + printk("Error %d: failed to configure pin %d (LED '%d')\n", + ret, spec->pin, led->num); return; }