]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
greybus: gpio: handle api changes for 4.5 kernel release
authorGreg Kroah-Hartman <gregkh@google.com>
Wed, 24 Feb 2016 06:51:45 +0000 (22:51 -0800)
committerGreg Kroah-Hartman <gregkh@google.com>
Thu, 25 Feb 2016 01:44:11 +0000 (17:44 -0800)
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>
drivers/staging/greybus/gpio.c

index ec375c0475d93b1132b17551d41ffc8bcf1bc498..e7dd99444ea2f5097cbb3ad262363a9c994ec73b 100644 (file)
@@ -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;