Skip to content

Commit 7e286bf

Browse files
galakcarlescufi
authored andcommitted
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 <galak@kernel.org>
1 parent 95ee615 commit 7e286bf

File tree

1 file changed

+5
-5
lines changed
  • samples/basic/threads/src

1 file changed

+5
-5
lines changed

samples/basic/threads/src/main.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,17 @@ K_FIFO_DEFINE(printk_fifo);
3838

3939
struct led {
4040
struct gpio_dt_spec spec;
41-
const char *gpio_pin_name;
41+
uint8_t num;
4242
};
4343

4444
static const struct led led0 = {
4545
.spec = GPIO_DT_SPEC_GET_OR(LED0_NODE, gpios, {0}),
46-
.gpio_pin_name = DT_PROP_OR(LED0_NODE, label, ""),
46+
.num = 0,
4747
};
4848

4949
static const struct led led1 = {
5050
.spec = GPIO_DT_SPEC_GET_OR(LED1_NODE, gpios, {0}),
51-
.gpio_pin_name = DT_PROP_OR(LED1_NODE, label, ""),
51+
.num = 1,
5252
};
5353

5454
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)
6464

6565
ret = gpio_pin_configure_dt(spec, GPIO_OUTPUT);
6666
if (ret != 0) {
67-
printk("Error %d: failed to configure pin %d (LED '%s')\n",
68-
ret, spec->pin, led->gpio_pin_name);
67+
printk("Error %d: failed to configure pin %d (LED '%d')\n",
68+
ret, spec->pin, led->num);
6969
return;
7070
}
7171

0 commit comments

Comments
 (0)