drivers: sensor: drop DEV_DATA/DEV_CFG usage
Stop using redundant DEV_DATA/DEV_CFG macros and use dev->data and dev->config instead. Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
parent
1de05e6095
commit
e8c15f68b2
4 changed files with 28 additions and 35 deletions
|
@ -23,7 +23,7 @@ LOG_MODULE_DECLARE(BMP388, CONFIG_SENSOR_LOG_LEVEL);
|
|||
static void bmp388_handle_interrupts(const void *arg)
|
||||
{
|
||||
const struct device *dev = (const struct device *)arg;
|
||||
struct bmp388_data *data = DEV_DATA(dev);
|
||||
struct bmp388_data *data = dev->data;
|
||||
|
||||
struct sensor_trigger drdy_trigger = {
|
||||
.type = SENSOR_TRIG_DATA_READY,
|
||||
|
@ -45,7 +45,7 @@ static void bmp388_thread_main(void *arg1, void *unused1, void *unused2)
|
|||
ARG_UNUSED(unused1);
|
||||
ARG_UNUSED(unused2);
|
||||
const struct device *dev = (const struct device *)arg1;
|
||||
struct bmp388_data *data = DEV_DATA(dev);
|
||||
struct bmp388_data *data = dev->data;
|
||||
|
||||
while (1) {
|
||||
k_sem_take(&data->sem, K_FOREVER);
|
||||
|
@ -90,7 +90,7 @@ int bmp388_trigger_set(
|
|||
const struct sensor_trigger *trig,
|
||||
sensor_trigger_handler_t handler)
|
||||
{
|
||||
struct bmp388_data *data = DEV_DATA(dev);
|
||||
struct bmp388_data *data = dev->data;
|
||||
|
||||
#ifdef CONFIG_PM_DEVICE
|
||||
enum pm_device_state state;
|
||||
|
@ -121,8 +121,8 @@ int bmp388_trigger_set(
|
|||
|
||||
int bmp388_trigger_mode_init(const struct device *dev)
|
||||
{
|
||||
struct bmp388_data *data = DEV_DATA(dev);
|
||||
const struct bmp388_config *cfg = DEV_CFG(dev);
|
||||
struct bmp388_data *data = dev->data;
|
||||
const struct bmp388_config *cfg = dev->config;
|
||||
int ret;
|
||||
|
||||
if (!device_is_ready(cfg->gpio_int.port)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue