samples: lwm2m_client: Convert 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-07-06 11:24:39 -05:00 committed by Kumar Gala
commit c4cdba3833

View file

@ -188,7 +188,12 @@ static void *temperature_get_buf(uint16_t obj_inst_id, uint16_t res_id,
const struct device *dev = NULL;
#if defined(CONFIG_FXOS8700_TEMP)
dev = device_get_binding(DT_LABEL(DT_INST(0, nxp_fxos8700)));
dev = DEVICE_DT_GET_ONE(nxp_fxos8700);
if (!device_is_ready(dev)) {
LOG_ERR("%s: device not ready.", dev->name);
return;
}
#endif
if (dev != NULL) {