diff options
| author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2013-12-06 04:59:18 -0500 |
|---|---|---|
| committer | Simon Horman <horms+renesas@verge.net.au> | 2013-12-23 21:17:50 -0500 |
| commit | 520402bbc6fe328ae28e08bfc87a2b1eb7f10b2c (patch) | |
| tree | 1d13d938c31ca8a612be09ff28398253dee9a781 /drivers/tty | |
| parent | 3ae988d97b160c07463b980ccf26ed9226660fef (diff) | |
serial: sh-sci: Remove unused GPIO request code
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>
Diffstat (limited to 'drivers/tty')
| -rw-r--r-- | drivers/tty/serial/sh-sci.c | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index 98b8e3c98586..99a64fd16d46 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c | |||
| @@ -32,7 +32,6 @@ | |||
| 32 | #include <linux/dma-mapping.h> | 32 | #include <linux/dma-mapping.h> |
| 33 | #include <linux/err.h> | 33 | #include <linux/err.h> |
| 34 | #include <linux/errno.h> | 34 | #include <linux/errno.h> |
| 35 | #include <linux/gpio.h> | ||
| 36 | #include <linux/init.h> | 35 | #include <linux/init.h> |
| 37 | #include <linux/interrupt.h> | 36 | #include <linux/interrupt.h> |
| 38 | #include <linux/ioport.h> | 37 | #include <linux/ioport.h> |
| @@ -79,7 +78,6 @@ struct sci_port { | |||
| 79 | 78 | ||
| 80 | int irqs[SCIx_NR_IRQS]; | 79 | int irqs[SCIx_NR_IRQS]; |
| 81 | char *irqstr[SCIx_NR_IRQS]; | 80 | char *irqstr[SCIx_NR_IRQS]; |
| 82 | char *gpiostr[SCIx_NR_FNS]; | ||
| 83 | 81 | ||
| 84 | struct dma_chan *chan_tx; | 82 | struct dma_chan *chan_tx; |
| 85 | struct dma_chan *chan_rx; | 83 | struct dma_chan *chan_rx; |
| @@ -1153,67 +1151,6 @@ static void sci_free_irq(struct sci_port *port) | |||
| 1153 | } | 1151 | } |
| 1154 | } | 1152 | } |
| 1155 | 1153 | ||
| 1156 | static const char *sci_gpio_names[SCIx_NR_FNS] = { | ||
| 1157 | "sck", "rxd", "txd", "cts", "rts", | ||
| 1158 | }; | ||
| 1159 | |||
| 1160 | static const char *sci_gpio_str(unsigned int index) | ||
| 1161 | { | ||
| 1162 | return sci_gpio_names[index]; | ||
| 1163 | } | ||
| 1164 | |||
| 1165 | static void sci_init_gpios(struct sci_port *port) | ||
| 1166 | { | ||
| 1167 | struct uart_port *up = &port->port; | ||
| 1168 | int i; | ||
| 1169 | |||
| 1170 | if (!port->cfg) | ||
| 1171 | return; | ||
| 1172 | |||
| 1173 | for (i = 0; i < SCIx_NR_FNS; i++) { | ||
| 1174 | const char *desc; | ||
| 1175 | int ret; | ||
| 1176 | |||
| 1177 | if (!port->cfg->gpios[i]) | ||
| 1178 | continue; | ||
| 1179 | |||
| 1180 | desc = sci_gpio_str(i); | ||
| 1181 | |||
| 1182 | port->gpiostr[i] = kasprintf(GFP_KERNEL, "%s:%s", | ||
| 1183 | dev_name(up->dev), desc); | ||
| 1184 | |||
| 1185 | /* | ||
| 1186 | * If we've failed the allocation, we can still continue | ||
| 1187 | * on with a NULL string. | ||
| 1188 | */ | ||
| 1189 | if (!port->gpiostr[i]) | ||
| 1190 | dev_notice(up->dev, "%s string allocation failure\n", | ||
| 1191 | desc); | ||
| 1192 | |||
| 1193 | ret = gpio_request(port->cfg->gpios[i], port->gpiostr[i]); | ||
| 1194 | if (unlikely(ret != 0)) { | ||
| 1195 | dev_notice(up->dev, "failed %s gpio request\n", desc); | ||
| 1196 | |||
| 1197 | /* | ||
| 1198 | * If we can't get the GPIO for whatever reason, | ||
| 1199 | * no point in keeping the verbose string around. | ||
| 1200 | */ | ||
| 1201 | kfree(port->gpiostr[i]); | ||
| 1202 | } | ||
| 1203 | } | ||
| 1204 | } | ||
| 1205 | |||
| 1206 | static void sci_free_gpios(struct sci_port *port) | ||
| 1207 | { | ||
| 1208 | int i; | ||
| 1209 | |||
| 1210 | for (i = 0; i < SCIx_NR_FNS; i++) | ||
| 1211 | if (port->cfg->gpios[i]) { | ||
| 1212 | gpio_free(port->cfg->gpios[i]); | ||
| 1213 | kfree(port->gpiostr[i]); | ||
| 1214 | } | ||
| 1215 | } | ||
| 1216 | |||
| 1217 | static unsigned int sci_tx_empty(struct uart_port *port) | 1154 | static unsigned int sci_tx_empty(struct uart_port *port) |
| 1218 | { | 1155 | { |
| 1219 | unsigned short status = serial_port_in(port, SCxSR); | 1156 | unsigned short status = serial_port_in(port, SCxSR); |
| @@ -2240,8 +2177,6 @@ static int sci_init_single(struct platform_device *dev, | |||
| 2240 | 2177 | ||
| 2241 | port->dev = &dev->dev; | 2178 | port->dev = &dev->dev; |
| 2242 | 2179 | ||
| 2243 | sci_init_gpios(sci_port); | ||
| 2244 | |||
| 2245 | pm_runtime_enable(&dev->dev); | 2180 | pm_runtime_enable(&dev->dev); |
| 2246 | } | 2181 | } |
| 2247 | 2182 | ||
| @@ -2298,8 +2233,6 @@ static int sci_init_single(struct platform_device *dev, | |||
| 2298 | 2233 | ||
| 2299 | static void sci_cleanup_single(struct sci_port *port) | 2234 | static void sci_cleanup_single(struct sci_port *port) |
| 2300 | { | 2235 | { |
| 2301 | sci_free_gpios(port); | ||
| 2302 | |||
| 2303 | clk_put(port->iclk); | 2236 | clk_put(port->iclk); |
| 2304 | clk_put(port->fclk); | 2237 | clk_put(port->fclk); |
| 2305 | 2238 | ||
