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>
This commit is contained in:
parent
7a6396d9ce
commit
bb80c76448
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user