drivers: gpio: gecko: Use SIZEOF_FIELD() macro
Use the utility macro instead of bare code. Signed-off-by: Adrien Ricciardi <aricciardi@baylibre.com>
This commit is contained in:
parent
bf8b1d67d6
commit
9f6451d086
1 changed files with 3 additions and 3 deletions
|
|
@ -9,6 +9,7 @@
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <zephyr/drivers/gpio.h>
|
#include <zephyr/drivers/gpio.h>
|
||||||
#include <zephyr/irq.h>
|
#include <zephyr/irq.h>
|
||||||
|
#include <zephyr/sys/util.h>
|
||||||
#include <soc.h>
|
#include <soc.h>
|
||||||
#include <em_gpio.h>
|
#include <em_gpio.h>
|
||||||
#ifdef CONFIG_SOC_GECKO_DEV_INIT
|
#ifdef CONFIG_SOC_GECKO_DEV_INIT
|
||||||
|
|
@ -63,9 +64,8 @@
|
||||||
#define GECKO_GPIO_MODEH(pin, mode) (mode << ((pin - 8) * 4))
|
#define GECKO_GPIO_MODEH(pin, mode) (mode << ((pin - 8) * 4))
|
||||||
|
|
||||||
|
|
||||||
#define member_size(type, member) sizeof(((type *)0)->member)
|
#define NUMBER_OF_PORTS (SIZEOF_FIELD(GPIO_TypeDef, P) / \
|
||||||
#define NUMBER_OF_PORTS (member_size(GPIO_TypeDef, P) / \
|
SIZEOF_FIELD(GPIO_TypeDef, P[0]))
|
||||||
member_size(GPIO_TypeDef, P[0]))
|
|
||||||
|
|
||||||
struct gpio_gecko_common_config {
|
struct gpio_gecko_common_config {
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue