[SRU][B][PATCH 3/4] UBUNTU: SAUCE: xr-usb-serial: Changes to support updates in struct gpio_chip

Shrirang Bagul shrirang.bagul at canonical.com
Wed Feb 19 04:38:04 UTC 2020


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.

linux-oem buglink: https://launchpad.net/bugs/1645591

Signed-off-by: Shrirang Bagul <shrirang.bagul at canonical.com>
Signed-off-by: Timo Aaltonen <timo.aaltonen at canonical.com>
(cherry picked from commit 3ab04497415e04be7779e999aee694a5214748a2)
(source tag: Ubuntu-oem-4.15.0-1073.83)
Signed-off-by: Shrirang Bagul <shrirang.bagul at canonical.com>
---
 ubuntu/xr-usb-serial/xr_usb_serial_common.c | 11 ++++++-----
 ubuntu/xr-usb-serial/xr_usb_serial_common.h |  1 +
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/ubuntu/xr-usb-serial/xr_usb_serial_common.c b/ubuntu/xr-usb-serial/xr_usb_serial_common.c
index 09d21e63606e..2604177298c1 100644
--- a/ubuntu/xr-usb-serial/xr_usb_serial_common.c
+++ b/ubuntu/xr-usb-serial/xr_usb_serial_common.c
@@ -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 @@ static int xr_usb_serial_probe(struct usb_interface *intf,
 #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;
diff --git a/ubuntu/xr-usb-serial/xr_usb_serial_common.h b/ubuntu/xr-usb-serial/xr_usb_serial_common.h
index 97e902425794..d462bb5751a4 100644
--- a/ubuntu/xr-usb-serial/xr_usb_serial_common.h
+++ b/ubuntu/xr-usb-serial/xr_usb_serial_common.h
@@ -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.
  */
-- 
2.17.1




More information about the kernel-team mailing list