From bf4392f1a16d6e4f056e23889af69addda04180a Mon Sep 17 00:00:00 2001 From: Gerard Marull-Paretas Date: Fri, 9 Jul 2021 17:26:21 +0200 Subject: [PATCH] drivers: sensor: examplesensor: use gpio_pin_get_dt Use the recently introduced GPIO API that allows obtaining pin state using the gpio_dt_spec struct. Signed-off-by: Gerard Marull-Paretas --- drivers/sensor/examplesensor/examplesensor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/sensor/examplesensor/examplesensor.c b/drivers/sensor/examplesensor/examplesensor.c index 2443948..83cd4cb 100644 --- a/drivers/sensor/examplesensor/examplesensor.c +++ b/drivers/sensor/examplesensor/examplesensor.c @@ -26,7 +26,7 @@ static int examplesensor_sample_fetch(const struct device *dev, const struct examplesensor_config *config = dev->config; struct examplesensor_data *data = dev->data; - data->state = gpio_pin_get(config->input.port, config->input.pin); + data->state = gpio_pin_get_dt(&config->input); return 0; }