From 7a789d0775d9373b27da966ab57e5018a42bac4f Mon Sep 17 00:00:00 2001 From: raiden00pl Date: Mon, 22 Apr 2024 20:05:53 +0200 Subject: [PATCH] sensors/bmm150_uorb.c: fix compilation for poll interface --- drivers/sensors/bmm150_uorb.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/sensors/bmm150_uorb.c b/drivers/sensors/bmm150_uorb.c index f579f2110e..07ac6fc1c2 100644 --- a/drivers/sensors/bmm150_uorb.c +++ b/drivers/sensors/bmm150_uorb.c @@ -371,6 +371,8 @@ static int bmm150_activate(FAR struct sensor_lowerhalf_s *lower, #endif uint8_t val = 0; + dev = (FAR struct bmm150_sensor_dev_s *)lower; + nxmutex_lock(&dev->lock); if (enable) @@ -558,9 +560,9 @@ static int bmm150_fetch(FAR struct sensor_lowerhalf_s *lower, /* Get compensated data */ mag_data.timestamp = now; - mag_data.x = bmm150_getx(priv, data); - mag_data.y = bmm150_gety(priv, data); - mag_data.z = bmm150_getz(priv, data); + mag_data.x = bmm150_getx(dev, data); + mag_data.y = bmm150_gety(dev, data); + mag_data.z = bmm150_getz(dev, data); memcpy(buffer, &mag_data, sizeof(mag_data)); ret = sizeof(mag_data);