samples: shields: lmp90100_evb: convert to using DEVICE_DT_GET_ONE()

Convert from using device_get_binding() to DEVICE_DT_GET_ONE().

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
This commit is contained in:
Henrik Brix Andersen 2021-07-01 22:05:15 +02:00 committed by Christopher Friedt
commit 09ad92645e

View file

@ -60,7 +60,7 @@ static double rtd_temperature(int nom, double resistance)
void main(void)
{
const struct device *lmp90100;
const struct device *lmp90100 = DEVICE_DT_GET_ONE(ti_lmp90100);
double resistance;
int32_t buffer;
int err;
@ -83,9 +83,8 @@ void main(void)
.calibrate = 0
};
lmp90100 = device_get_binding(DT_LABEL(DT_INST(0, ti_lmp90100)));
if (!lmp90100) {
LOG_ERR("LMP90100 device not found");
if (!device_is_ready(lmp90100)) {
LOG_ERR("LMP90100 device not ready");
return;
}