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 <galak@kernel.org>
This commit is contained in:
parent
e3f991b7b8
commit
a7dc80f12e
1 changed files with 3 additions and 3 deletions
|
@ -14,9 +14,9 @@ void main(void)
|
|||
const struct device *dev;
|
||||
struct sensor_value co2, voc;
|
||||
|
||||
dev = device_get_binding(DT_LABEL(DT_INST(0, ams_iaqcore)));
|
||||
if (!dev) {
|
||||
printk("Failed to get device binding");
|
||||
dev = DEVICE_DT_GET_ONE(ams_iaqcore);
|
||||
if (!device_is_ready(dev)) {
|
||||
printk("sensor: device not ready.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue