Skip to contentSkip to conversation

gpio: f7188x: use gpiochip_get_data instead of container_of

PATCH In review Amitesh Singh 2 participants 2 messages Sep 16, 2016 – Sep 18, 2016 GPIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpio: f7188x: use gpiochip_get_data instead of container_of

gpiochip_add_data is already used to add data pointer and chip. Lets rely on gpiochip_get_data which is getting used in other gpio_chip functions.

---
 drivers/gpio/gpio-f7188x.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpio/gpio-f7188x.c +1 -2
index 600be84..e8accde 100644
@@ -214,8 +214,7 @@ static struct f7188x_gpio_bank f81866_gpio_bank[] = {
 static int f7188x_gpio_get_direction(struct gpio_chip *chip, unsigned offset)
 {
 	int err;
-	struct f7188x_gpio_bank *bank =
-		container_of(chip, struct f7188x_gpio_bank, chip);
+	struct f7188x_gpio_bank *bank = gpiochip_get_data(chip);
 	struct f7188x_sio *sio = bank->data->sio;
 	u8 dir;
 
Signature · 1 line
2.7.4
#1 lore raw
Quoted 5 lines · Amitesh Singh

gpiochip_add_data is already used to add data pointer and chip. Lets rely on gpiochip_get_data which is getting used in other gpio_chip functions.

Patch applied.

Yours,
Linus Walleij