struct gpio_desc *gpios[GPIO_LATCH_LINES];
};
-static inline struct gpio_latch_chip *to_gpio_latch_chip(struct gpio_chip *gc)
-{
- return container_of(gc, struct gpio_latch_chip, gc);
-}
-
static void gpio_latch_lock(struct gpio_latch_chip *glc, bool enable)
{
mutex_lock(&glc->mutex);
static int
gpio_latch_get(struct gpio_chip *gc, unsigned offset)
{
- struct gpio_latch_chip *glc = to_gpio_latch_chip(gc);
+ struct gpio_latch_chip *glc = gpiochip_get_data(gc);
int ret;
gpio_latch_lock(glc, false);
static void
gpio_latch_set(struct gpio_chip *gc, unsigned offset, int value)
{
- struct gpio_latch_chip *glc = to_gpio_latch_chip(gc);
+ struct gpio_latch_chip *glc = gpiochip_get_data(gc);
bool enable_latch = false;
bool disable_latch = false;
static int
gpio_latch_direction_output(struct gpio_chip *gc, unsigned offset, int value)
{
- struct gpio_latch_chip *glc = to_gpio_latch_chip(gc);
+ struct gpio_latch_chip *glc = gpiochip_get_data(gc);
bool enable_latch = false;
bool disable_latch = false;
int ret;