diff options
author | Greg Kroah-Hartman <gregkh@google.com> | 2016-02-23 22:51:45 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@google.com> | 2016-02-24 17:44:11 -0800 |
commit | bb80c76448b2463a1ecfe622df4f7b3c5fb39cdf (patch) | |
tree | 0a35e41d4954042c892678f2159bf54a8fec233c /drivers | |
parent | 7a6396d9ce81564b09d91586b29fdd02e6814c28 (diff) |
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 <gregkh@google.com>
Reviewed-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/greybus/gpio.c | 4 |
1 files changed, 4 insertions, 0 deletions
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; |