Merge tag 'tty-3.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
[firefly-linux-kernel-4.4.55.git] / drivers / tty / serial / atmel_serial.c
index d2a98da2613311fe1e2aa18f6ac35743dd57590f..b95886c1198de58ad7d8b26f6d343db7ad276b61 100644 (file)
@@ -39,6 +39,7 @@
 #include <linux/atmel_pdc.h>
 #include <linux/atmel_serial.h>
 #include <linux/uaccess.h>
+#include <linux/pinctrl/consumer.h>
 
 #include <asm/io.h>
 #include <asm/ioctls.h>
@@ -1773,6 +1774,7 @@ static int atmel_serial_probe(struct platform_device *pdev)
        struct atmel_uart_data *pdata = pdev->dev.platform_data;
        void *data;
        int ret = -ENODEV;
+       struct pinctrl *pinctrl;
 
        BUILD_BUG_ON(ATMEL_SERIAL_RINGSIZE & (ATMEL_SERIAL_RINGSIZE - 1));
 
@@ -1805,6 +1807,12 @@ static int atmel_serial_probe(struct platform_device *pdev)
 
        atmel_init_port(port, pdev);
 
+       pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
+       if (IS_ERR(pinctrl)) {
+               ret = PTR_ERR(pinctrl);
+               goto err;
+       }
+
        if (!atmel_use_dma_rx(&port->uart)) {
                ret = -ENOMEM;
                data = kmalloc(sizeof(struct atmel_uart_char)