Skip to content

Commit 09ad926

Browse files
henrikbrixandersencfriedt
authored andcommitted
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>
1 parent 51e774a commit 09ad926

File tree

1 file changed

+3
-4
lines changed
  • samples/shields/lmp90100_evb/rtd/src

1 file changed

+3
-4
lines changed

samples/shields/lmp90100_evb/rtd/src/main.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ static double rtd_temperature(int nom, double resistance)
6060

6161
void main(void)
6262
{
63-
const struct device *lmp90100;
63+
const struct device *lmp90100 = DEVICE_DT_GET_ONE(ti_lmp90100);
6464
double resistance;
6565
int32_t buffer;
6666
int err;
@@ -83,9 +83,8 @@ void main(void)
8383
.calibrate = 0
8484
};
8585

86-
lmp90100 = device_get_binding(DT_LABEL(DT_INST(0, ti_lmp90100)));
87-
if (!lmp90100) {
88-
LOG_ERR("LMP90100 device not found");
86+
if (!device_is_ready(lmp90100)) {
87+
LOG_ERR("LMP90100 device not ready");
8988
return;
9089
}
9190

0 commit comments

Comments
 (0)