]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
UBUNTU: SAUCE: xr-usb-serial: Changes to support updates in struct gpio_chip
authorShrirang Bagul <shrirang.bagul@canonical.com>
Wed, 19 Feb 2020 04:38:04 +0000 (12:38 +0800)
committerKhalid Elmously <khalid.elmously@canonical.com>
Wed, 11 Mar 2020 05:01:45 +0000 (01:01 -0400)
BugLink: https://bugs.launchpad.net/bugs/1863834
This patch is a forward port from the driver in Xenial kernel. It accounts
for the changes in the gpio_chip structure.

buglink: https://launchpad.net/bugs/1645591
Signed-off-by: Shrirang Bagul <shrirang.bagul@canonical.com>
Signed-off-by: Timo Aaltonen <timo.aaltonen@canonical.com>
(cherry picked from commit 3ab04497415e04be7779e999aee694a5214748a2)
(source tag: Ubuntu-oem-4.15.0-1073.83)
Signed-off-by: Shrirang Bagul <shrirang.bagul@canonical.com>
Acked-by: Kleber Souza <kleber.souza@canonical.com>
Acked-by: Wen-chien Jesse Sung <jesse.sung@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
ubuntu/xr-usb-serial/xr_usb_serial_common.c
ubuntu/xr-usb-serial/xr_usb_serial_common.h

index 09d21e63606e007613391ae3f91285b9bc903b45..2604177298c1db633c41038d06c256e1d55e8855 100644 (file)
@@ -1215,23 +1215,24 @@ static int xr_usb_serial_write_buffers_alloc(struct xr_usb_serial *xr_usb_serial
 }
 
 #ifdef CONFIG_GPIOLIB
+
 static int xr_usb_gpio_get(struct gpio_chip *chip, unsigned offset)
 {
     struct xr_usb_serial *xr_usb_serial = container_of(chip, struct xr_usb_serial, xr_usb_gpio);
-       dev_dbg(chip->dev, "xr_usb_gpio_get offset = %d channel = %d\n",offset,xr_usb_serial->channel);
+       dev_dbg(chip->parent, "xr_usb_gpio_get offset = %d channel = %d\n",offset,xr_usb_serial->channel);
        return 0;
 }
 
 static void xr_usb_gpio_set(struct gpio_chip *chip, unsigned offset, int val)
 {
    struct xr_usb_serial *xr_usb_serial = container_of(chip, struct xr_usb_serial, xr_usb_gpio);
-   dev_dbg(chip->dev, "xr_usb_gpio_set offset =%d val=%d channel = %d\n",offset,val,xr_usb_serial->channel);
+   dev_dbg(chip->parent, "xr_usb_gpio_set offset =%d val=%d channel = %d\n",offset,val,xr_usb_serial->channel);
 }
 
 static int xr_usb_gpio_direction_input(struct gpio_chip *chip,unsigned offset)
 {
        struct xr_usb_serial *xr_usb_serial = container_of(chip, struct xr_usb_serial, xr_usb_gpio);
-    dev_dbg(chip->dev, "xr_usb_gpio_direction_input offset =%d channel = %d\n",offset,xr_usb_serial->channel);
+    dev_dbg(chip->parent, "xr_usb_gpio_direction_input offset =%d channel = %d\n",offset,xr_usb_serial->channel);
        return 0;
 }
 
@@ -1239,7 +1240,7 @@ static int xr_usb_gpio_direction_output(struct gpio_chip *chip,
                                           unsigned offset, int val)
 {
     struct xr_usb_serial *xr_usb_serial = container_of(chip, struct xr_usb_serial, xr_usb_gpio);
-       dev_dbg(chip->dev, "xr_usb_gpio_direction_output offset =%d val=%d channel:%d\n",offset,val,xr_usb_serial->channel);
+       dev_dbg(chip->parent, "xr_usb_gpio_direction_output offset =%d val=%d channel:%d\n",offset,val,xr_usb_serial->channel);
        return 0;
 }
 #endif
@@ -1676,7 +1677,7 @@ skip_countries:
 #ifdef CONFIG_GPIOLIB  
        /* Setup GPIO cotroller */
        xr_usb_serial->xr_usb_gpio.owner                 = THIS_MODULE;
-       xr_usb_serial->xr_usb_gpio.dev           = &control_interface->dev;
+       xr_usb_serial->xr_usb_gpio.parent                = &control_interface->dev;
        xr_usb_serial->xr_usb_gpio.label                 = dev_name(&control_interface->dev);
        xr_usb_serial->xr_usb_gpio.direction_input       = xr_usb_gpio_direction_input;
        xr_usb_serial->xr_usb_gpio.get           = xr_usb_gpio_get;
index 97e9024257942124e8bd97fa54c90908ca225492..d462bb5751a4e598a4d076bc03e0cd6504e0ad5a 100644 (file)
@@ -14,6 +14,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
+#include <linux/gpio/driver.h>
 /*
  * CMSPAR, some architectures can't have space and mark parity.
  */