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:
Martí Bolívar 2021-04-26 14:12:01 -07:00 committed by Carles Cufí
commit 2c793f72ae

View file

@ -19,9 +19,9 @@ static void trigger_handler(const struct device *dev,
void main(void)
{
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");
return;
}