samples: fxas21002: drop device_get_binding/DT_INST
Use DEVICE_DT_GET_ANY. Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
This commit is contained in:
parent
36bd4cbcf2
commit
2c793f72ae
1 changed files with 2 additions and 2 deletions
|
@ -19,9 +19,9 @@ static void trigger_handler(const struct device *dev,
|
||||||
void main(void)
|
void main(void)
|
||||||
{
|
{
|
||||||
struct sensor_value gyro[3];
|
struct sensor_value gyro[3];
|
||||||
const struct device *dev = device_get_binding(DT_LABEL(DT_INST(0, nxp_fxas21002)));
|
const struct device *dev = DEVICE_DT_GET_ANY(nxp_fxas21002);
|
||||||
|
|
||||||
if (dev == NULL) {
|
if (dev == NULL || !device_is_ready(dev)) {
|
||||||
printf("Could not get fxas21002 device\n");
|
printf("Could not get fxas21002 device\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue