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:
parent
51e774a3f4
commit
09ad92645e
1 changed files with 3 additions and 4 deletions
|
@ -60,7 +60,7 @@ static double rtd_temperature(int nom, double resistance)
|
||||||
|
|
||||||
void main(void)
|
void main(void)
|
||||||
{
|
{
|
||||||
const struct device *lmp90100;
|
const struct device *lmp90100 = DEVICE_DT_GET_ONE(ti_lmp90100);
|
||||||
double resistance;
|
double resistance;
|
||||||
int32_t buffer;
|
int32_t buffer;
|
||||||
int err;
|
int err;
|
||||||
|
@ -83,9 +83,8 @@ void main(void)
|
||||||
.calibrate = 0
|
.calibrate = 0
|
||||||
};
|
};
|
||||||
|
|
||||||
lmp90100 = device_get_binding(DT_LABEL(DT_INST(0, ti_lmp90100)));
|
if (!device_is_ready(lmp90100)) {
|
||||||
if (!lmp90100) {
|
LOG_ERR("LMP90100 device not ready");
|
||||||
LOG_ERR("LMP90100 device not found");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue