Skip to content

Commit

Permalink
tests: fix zephyr/drivers/gpio.h usage
Browse files Browse the repository at this point in the history
Only include the header if using any of the GPIO API calls/
struct/defines.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
  • Loading branch information
gmarull authored and kartben committed Dec 20, 2024
1 parent 179576d commit b51f998
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 8 deletions.
2 changes: 0 additions & 2 deletions tests/drivers/gpio/gpio_reserved_ranges/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/devicetree.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/drivers/gpio/gpio_utils.h>

#define TEST_GPIO_1 DT_NODELABEL(test_gpio_1)
#define TEST_GPIO_2 DT_NODELABEL(test_gpio_2)
Expand Down
1 change: 1 addition & 0 deletions tests/drivers/input/gpio_keys/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include <zephyr/sys/util.h>
#include <zephyr/device.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/drivers/gpio/gpio_emul.h>
#include <zephyr/kernel.h>
#include <zephyr/ztest.h>
Expand Down
1 change: 1 addition & 0 deletions tests/drivers/mspi/api/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

#include <zephyr/device.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/drivers/mspi.h>
#include <zephyr/drivers/mspi_emul.h>
#include <zephyr/ztest.h>
Expand Down
1 change: 0 additions & 1 deletion tests/drivers/sensor/adltc2990/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

#include <zephyr/devicetree.h>
#include <zephyr/drivers/emul.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/drivers/sensor.h>
#include <zephyr/ztest.h>

Expand Down
2 changes: 0 additions & 2 deletions tests/drivers/sensor/akm09918c/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

#include <zephyr/devicetree.h>
#include <zephyr/drivers/emul.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/drivers/gpio/gpio_emul.h>
#include <zephyr/drivers/sensor.h>
#include <zephyr/ztest.h>

Expand Down
1 change: 0 additions & 1 deletion tests/lib/devicetree/api_ext/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <zephyr/ztest.h>
#include <zephyr/devicetree.h>
#include <zephyr/device.h>
#include <zephyr/drivers/gpio.h>

#include <zephyr/linker/devicetree_regions.h>

Expand Down
1 change: 0 additions & 1 deletion tests/lib/devicetree/devices/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <zephyr/ztest.h>
#include <zephyr/devicetree.h>
#include <zephyr/device.h>
#include <zephyr/drivers/gpio.h>

#define TEST_GPIO DT_NODELABEL(test_gpio_0)
#define TEST_I2C DT_NODELABEL(test_i2c)
Expand Down
1 change: 0 additions & 1 deletion tests/net/lib/lwm2m/interop/src/lwm2m-client.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
LOG_MODULE_REGISTER(LOG_MODULE_NAME);
#include <stdlib.h>
#include <zephyr/kernel.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/drivers/sensor.h>
#include <zephyr/net/lwm2m.h>
#include <zephyr/net/socket.h>
Expand Down

0 comments on commit b51f998

Please sign in to comment.