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>
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;