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:
Kumar Gala 2022-06-13 18:14:29 -05:00 committed by Maureen Helm
commit a7dc80f12e

View file

@ -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;
}