Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1485182

[PATCH] gpio: f7188x: use gpiochip_get_data instead of container_of

From Amitesh Singh <singh.amitesh@gmail.com>
Newsgroups linux.kernel
Subject [PATCH] gpio: f7188x: use gpiochip_get_data instead of container_of
Date 2016-09-16 19:00 +0200
Message-ID <si4Ex-7lj-13@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


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.

Signed-off-by: Amitesh Singh <singh.amitesh@gmail.com>
---
 drivers/gpio/gpio-f7188x.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpio/gpio-f7188x.c b/drivers/gpio/gpio-f7188x.c
index 600be84..e8accde 100644
--- a/drivers/gpio/gpio-f7188x.c
+++ b/drivers/gpio/gpio-f7188x.c
@@ -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;
 
-- 
2.7.4

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] gpio: f7188x: use gpiochip_get_data instead of container_of Amitesh Singh <singh.amitesh@gmail.com> - 2016-09-16 19:00 +0200
  Re: [PATCH] gpio: f7188x: use gpiochip_get_data instead of container_of Linus Walleij <linus.walleij@linaro.org> - 2016-09-18 13:40 +0200

csiph-web