serial: sh-sci: Remove unused GPIO request code
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Fri, 6 Dec 2013 09:59:18 +0000 (10:59 +0100)
committerSimon Horman <horms+renesas@verge.net.au>
Tue, 24 Dec 2013 02:17:50 +0000 (11:17 +0900)
The driver requests at initialization time GPIOs passed through platform
data. No platform makes use of this feature, remove it.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
drivers/tty/serial/sh-sci.c
include/linux/serial_sci.h

index 98b8e3c985860440c9c96a1e63153062bd13d886..99a64fd16d4698380bcfd2411ec3980cbe0d310a 100644 (file)
@@ -32,7 +32,6 @@
 #include <linux/dma-mapping.h>
 #include <linux/err.h>
 #include <linux/errno.h>
-#include <linux/gpio.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/ioport.h>
@@ -79,7 +78,6 @@ struct sci_port {
 
        int                     irqs[SCIx_NR_IRQS];
        char                    *irqstr[SCIx_NR_IRQS];
-       char                    *gpiostr[SCIx_NR_FNS];
 
        struct dma_chan                 *chan_tx;
        struct dma_chan                 *chan_rx;
@@ -1153,67 +1151,6 @@ static void sci_free_irq(struct sci_port *port)
        }
 }
 
-static const char *sci_gpio_names[SCIx_NR_FNS] = {
-       "sck", "rxd", "txd", "cts", "rts",
-};
-
-static const char *sci_gpio_str(unsigned int index)
-{
-       return sci_gpio_names[index];
-}
-
-static void sci_init_gpios(struct sci_port *port)
-{
-       struct uart_port *up = &port->port;
-       int i;
-
-       if (!port->cfg)
-               return;
-
-       for (i = 0; i < SCIx_NR_FNS; i++) {
-               const char *desc;
-               int ret;
-
-               if (!port->cfg->gpios[i])
-                       continue;
-
-               desc = sci_gpio_str(i);
-
-               port->gpiostr[i] = kasprintf(GFP_KERNEL, "%s:%s",
-                                            dev_name(up->dev), desc);
-
-               /*
-                * If we've failed the allocation, we can still continue
-                * on with a NULL string.
-                */
-               if (!port->gpiostr[i])
-                       dev_notice(up->dev, "%s string allocation failure\n",
-                                  desc);
-
-               ret = gpio_request(port->cfg->gpios[i], port->gpiostr[i]);
-               if (unlikely(ret != 0)) {
-                       dev_notice(up->dev, "failed %s gpio request\n", desc);
-
-                       /*
-                        * If we can't get the GPIO for whatever reason,
-                        * no point in keeping the verbose string around.
-                        */
-                       kfree(port->gpiostr[i]);
-               }
-       }
-}
-
-static void sci_free_gpios(struct sci_port *port)
-{
-       int i;
-
-       for (i = 0; i < SCIx_NR_FNS; i++)
-               if (port->cfg->gpios[i]) {
-                       gpio_free(port->cfg->gpios[i]);
-                       kfree(port->gpiostr[i]);
-               }
-}
-
 static unsigned int sci_tx_empty(struct uart_port *port)
 {
        unsigned short status = serial_port_in(port, SCxSR);
@@ -2240,8 +2177,6 @@ static int sci_init_single(struct platform_device *dev,
 
                port->dev = &dev->dev;
 
-               sci_init_gpios(sci_port);
-
                pm_runtime_enable(&dev->dev);
        }
 
@@ -2298,8 +2233,6 @@ static int sci_init_single(struct platform_device *dev,
 
 static void sci_cleanup_single(struct sci_port *port)
 {
-       sci_free_gpios(port);
-
        clk_put(port->iclk);
        clk_put(port->fclk);
 
index af9834bc67719b9c78b112ecea37be575506a3c4..e9c3021a37ae149bb1f2844068cc9507d49a2db3 100644 (file)
@@ -69,17 +69,6 @@ enum {
        SCIx_MUX_IRQ = SCIx_NR_IRQS,    /* special case */
 };
 
-/* Offsets into the sci_port->gpios array */
-enum {
-       SCIx_SCK,
-       SCIx_RXD,
-       SCIx_TXD,
-       SCIx_CTS,
-       SCIx_RTS,
-
-       SCIx_NR_FNS,
-};
-
 enum {
        SCIx_PROBE_REGTYPE,
 
@@ -141,7 +130,6 @@ struct plat_sci_port_ops {
 struct plat_sci_port {
        unsigned long   mapbase;                /* resource base */
        unsigned int    irqs[SCIx_NR_IRQS];     /* ERI, RXI, TXI, BRI */
-       unsigned int    gpios[SCIx_NR_FNS];     /* SCK, RXD, TXD, CTS, RTS */
        unsigned int    type;                   /* SCI / SCIF / IRDA / HSCIF */
        upf_t           flags;                  /* UPF_* flags */
        unsigned long   capabilities;           /* Port features/capabilities */