From: Greg Kroah-Hartman Date: Wed, 24 Feb 2016 06:51:45 +0000 (-0800) Subject: greybus: gpio: handle api changes for 4.5 kernel release X-Git-Tag: Ubuntu-5.13.0-19.19~14927^2~378^2~21^2~649 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=bb80c76448b2463a1ecfe622df4f7b3c5fb39cdf;p=mirror_ubuntu-jammy-kernel.git 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 --- 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;