Skip to content

Commit a7dc80f

Browse files
galakMaureenHelm
authored andcommitted
samples: ams_iAQcore: Convert sample to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as we work on phasing out use of DTS 'label' property. Signed-off-by: Kumar Gala <[email protected]>
1 parent e3f991b commit a7dc80f

File tree

1 file changed

+3
-3
lines changed
  • samples/sensor/ams_iAQcore/src

1 file changed

+3
-3
lines changed

samples/sensor/ams_iAQcore/src/main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ void main(void)
1414
const struct device *dev;
1515
struct sensor_value co2, voc;
1616

17-
dev = device_get_binding(DT_LABEL(DT_INST(0, ams_iaqcore)));
18-
if (!dev) {
19-
printk("Failed to get device binding");
17+
dev = DEVICE_DT_GET_ONE(ams_iaqcore);
18+
if (!device_is_ready(dev)) {
19+
printk("sensor: device not ready.\n");
2020
return;
2121
}
2222

0 commit comments

Comments
 (0)