samples: bmg160: drop device_get_binding
Use DEVICE_DT_GET_ANY. Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
This commit is contained in:
parent
aacab5e866
commit
5832e588e3
1 changed files with 5 additions and 2 deletions
|
@ -168,16 +168,19 @@ static void test_trigger_mode(const struct device *bmg160)
|
|||
|
||||
void main(void)
|
||||
{
|
||||
const struct device *bmg160;
|
||||
const struct device *bmg160 = DEVICE_DT_GET_ANY(bosch_bmg160);
|
||||
#if defined(CONFIG_BMG160_RANGE_RUNTIME)
|
||||
struct sensor_value attr;
|
||||
#endif
|
||||
|
||||
bmg160 = device_get_binding("bmg160");
|
||||
if (!bmg160) {
|
||||
printf("Device not found.\n");
|
||||
return;
|
||||
}
|
||||
if (!device_is_ready(bmg160)) {
|
||||
printf("Device %s is not ready.\n", bmg160->name);
|
||||
return;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_BMG160_RANGE_RUNTIME)
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue