From bb80c76448b2463a1ecfe622df4f7b3c5fb39cdf Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 23 Feb 2016 22:51:45 -0800 Subject: [PATCH] greybus: gpio: handle api changes for 4.5 kernel release In kernel version 4.5, struct gpio_chip renamed the field 'dev' to 'parent' so handle this properly. Signed-off-by: Greg Kroah-Hartman Reviewed-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/gpio.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/staging/greybus/gpio.c b/drivers/staging/greybus/gpio.c index ec375c0475d9..e7dd99444ea2 100644 --- a/drivers/staging/greybus/gpio.c +++ b/drivers/staging/greybus/gpio.c @@ -651,7 +651,11 @@ static int gb_gpio_connection_init(struct gb_connection *connection) gpio = &ggc->chip; gpio->label = "greybus_gpio"; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0) + gpio->parent = &connection->bundle->dev; +#else gpio->dev = &connection->bundle->dev; +#endif gpio->owner = THIS_MODULE; gpio->request = gb_gpio_request; -- 2.39.5