diff options
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/hvc/hvcs.c | 9 | ||||
-rw-r--r-- | drivers/tty/serial/8250/8250.c | 52 | ||||
-rw-r--r-- | drivers/tty/serial/8250/8250_pci.c | 21 | ||||
-rw-r--r-- | drivers/tty/serial/8250/8250_pnp.c | 12 | ||||
-rw-r--r-- | drivers/tty/serial/Kconfig | 4 | ||||
-rw-r--r-- | drivers/tty/serial/bcm63xx_uart.c | 8 | ||||
-rw-r--r-- | drivers/tty/serial/mpc52xx_uart.c | 2 | ||||
-rw-r--r-- | drivers/tty/serial/of_serial.c | 6 | ||||
-rw-r--r-- | drivers/tty/serial/sunsu.c | 21 | ||||
-rw-r--r-- | drivers/tty/serial/vt8500_serial.c | 9 | ||||
-rw-r--r-- | drivers/tty/tty_buffer.c | 2 |
11 files changed, 95 insertions, 51 deletions
diff --git a/drivers/tty/hvc/hvcs.c b/drivers/tty/hvc/hvcs.c index 1956593ee89d..81e939e90c4c 100644 --- a/drivers/tty/hvc/hvcs.c +++ b/drivers/tty/hvc/hvcs.c | |||
@@ -881,17 +881,12 @@ static struct vio_driver hvcs_vio_driver = { | |||
881 | /* Only called from hvcs_get_pi please */ | 881 | /* Only called from hvcs_get_pi please */ |
882 | static void hvcs_set_pi(struct hvcs_partner_info *pi, struct hvcs_struct *hvcsd) | 882 | static void hvcs_set_pi(struct hvcs_partner_info *pi, struct hvcs_struct *hvcsd) |
883 | { | 883 | { |
884 | int clclength; | ||
885 | |||
886 | hvcsd->p_unit_address = pi->unit_address; | 884 | hvcsd->p_unit_address = pi->unit_address; |
887 | hvcsd->p_partition_ID = pi->partition_ID; | 885 | hvcsd->p_partition_ID = pi->partition_ID; |
888 | clclength = strlen(&pi->location_code[0]); | ||
889 | if (clclength > HVCS_CLC_LENGTH) | ||
890 | clclength = HVCS_CLC_LENGTH; | ||
891 | 886 | ||
892 | /* copy the null-term char too */ | 887 | /* copy the null-term char too */ |
893 | strncpy(&hvcsd->p_location_code[0], | 888 | strlcpy(&hvcsd->p_location_code[0], |
894 | &pi->location_code[0], clclength + 1); | 889 | &pi->location_code[0], sizeof(hvcsd->p_location_code)); |
895 | } | 890 | } |
896 | 891 | ||
897 | /* | 892 | /* |
diff --git a/drivers/tty/serial/8250/8250.c b/drivers/tty/serial/8250/8250.c index 0efc815a4968..cf6a5383748a 100644 --- a/drivers/tty/serial/8250/8250.c +++ b/drivers/tty/serial/8250/8250.c | |||
@@ -301,7 +301,28 @@ static const struct serial8250_config uart_config[] = { | |||
301 | }, | 301 | }, |
302 | [PORT_8250_CIR] = { | 302 | [PORT_8250_CIR] = { |
303 | .name = "CIR port" | 303 | .name = "CIR port" |
304 | } | 304 | }, |
305 | [PORT_ALTR_16550_F32] = { | ||
306 | .name = "Altera 16550 FIFO32", | ||
307 | .fifo_size = 32, | ||
308 | .tx_loadsz = 32, | ||
309 | .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10, | ||
310 | .flags = UART_CAP_FIFO | UART_CAP_AFE, | ||
311 | }, | ||
312 | [PORT_ALTR_16550_F64] = { | ||
313 | .name = "Altera 16550 FIFO64", | ||
314 | .fifo_size = 64, | ||
315 | .tx_loadsz = 64, | ||
316 | .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10, | ||
317 | .flags = UART_CAP_FIFO | UART_CAP_AFE, | ||
318 | }, | ||
319 | [PORT_ALTR_16550_F128] = { | ||
320 | .name = "Altera 16550 FIFO128", | ||
321 | .fifo_size = 128, | ||
322 | .tx_loadsz = 128, | ||
323 | .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10, | ||
324 | .flags = UART_CAP_FIFO | UART_CAP_AFE, | ||
325 | }, | ||
305 | }; | 326 | }; |
306 | 327 | ||
307 | /* Uart divisor latch read */ | 328 | /* Uart divisor latch read */ |
@@ -3396,3 +3417,32 @@ module_param_array(probe_rsa, ulong, &probe_rsa_count, 0444); | |||
3396 | MODULE_PARM_DESC(probe_rsa, "Probe I/O ports for RSA"); | 3417 | MODULE_PARM_DESC(probe_rsa, "Probe I/O ports for RSA"); |
3397 | #endif | 3418 | #endif |
3398 | MODULE_ALIAS_CHARDEV_MAJOR(TTY_MAJOR); | 3419 | MODULE_ALIAS_CHARDEV_MAJOR(TTY_MAJOR); |
3420 | |||
3421 | #ifndef MODULE | ||
3422 | /* This module was renamed to 8250_core in 3.7. Keep the old "8250" name | ||
3423 | * working as well for the module options so we don't break people. We | ||
3424 | * need to keep the names identical and the convenient macros will happily | ||
3425 | * refuse to let us do that by failing the build with redefinition errors | ||
3426 | * of global variables. So we stick them inside a dummy function to avoid | ||
3427 | * those conflicts. The options still get parsed, and the redefined | ||
3428 | * MODULE_PARAM_PREFIX lets us keep the "8250." syntax alive. | ||
3429 | * | ||
3430 | * This is hacky. I'm sorry. | ||
3431 | */ | ||
3432 | static void __used s8250_options(void) | ||
3433 | { | ||
3434 | #undef MODULE_PARAM_PREFIX | ||
3435 | #define MODULE_PARAM_PREFIX "8250." | ||
3436 | |||
3437 | module_param_cb(share_irqs, ¶m_ops_uint, &share_irqs, 0644); | ||
3438 | module_param_cb(nr_uarts, ¶m_ops_uint, &nr_uarts, 0644); | ||
3439 | module_param_cb(skip_txen_test, ¶m_ops_uint, &skip_txen_test, 0644); | ||
3440 | #ifdef CONFIG_SERIAL_8250_RSA | ||
3441 | __module_param_call(MODULE_PARAM_PREFIX, probe_rsa, | ||
3442 | ¶m_array_ops, .arr = &__param_arr_probe_rsa, | ||
3443 | 0444, -1); | ||
3444 | #endif | ||
3445 | } | ||
3446 | #else | ||
3447 | MODULE_ALIAS("8250"); | ||
3448 | #endif | ||
diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c index 791c5a77ec61..aa76825229dc 100644 --- a/drivers/tty/serial/8250/8250_pci.c +++ b/drivers/tty/serial/8250/8250_pci.c | |||
@@ -1571,6 +1571,7 @@ pci_wch_ch353_setup(struct serial_private *priv, | |||
1571 | 1571 | ||
1572 | /* Unknown vendors/cards - this should not be in linux/pci_ids.h */ | 1572 | /* Unknown vendors/cards - this should not be in linux/pci_ids.h */ |
1573 | #define PCI_SUBDEVICE_ID_UNKNOWN_0x1584 0x1584 | 1573 | #define PCI_SUBDEVICE_ID_UNKNOWN_0x1584 0x1584 |
1574 | #define PCI_SUBDEVICE_ID_UNKNOWN_0x1588 0x1588 | ||
1574 | 1575 | ||
1575 | /* | 1576 | /* |
1576 | * Master list of serial port init/setup/exit quirks. | 1577 | * Master list of serial port init/setup/exit quirks. |
@@ -1852,15 +1853,6 @@ static struct pci_serial_quirk pci_serial_quirks[] __refdata = { | |||
1852 | }, | 1853 | }, |
1853 | { | 1854 | { |
1854 | .vendor = PCI_VENDOR_ID_PLX, | 1855 | .vendor = PCI_VENDOR_ID_PLX, |
1855 | .device = PCI_DEVICE_ID_PLX_9050, | ||
1856 | .subvendor = PCI_VENDOR_ID_PLX, | ||
1857 | .subdevice = PCI_SUBDEVICE_ID_UNKNOWN_0x1584, | ||
1858 | .init = pci_plx9050_init, | ||
1859 | .setup = pci_default_setup, | ||
1860 | .exit = pci_plx9050_exit, | ||
1861 | }, | ||
1862 | { | ||
1863 | .vendor = PCI_VENDOR_ID_PLX, | ||
1864 | .device = PCI_DEVICE_ID_PLX_ROMULUS, | 1856 | .device = PCI_DEVICE_ID_PLX_ROMULUS, |
1865 | .subvendor = PCI_VENDOR_ID_PLX, | 1857 | .subvendor = PCI_VENDOR_ID_PLX, |
1866 | .subdevice = PCI_DEVICE_ID_PLX_ROMULUS, | 1858 | .subdevice = PCI_DEVICE_ID_PLX_ROMULUS, |
@@ -3733,7 +3725,12 @@ static struct pci_device_id serial_pci_tbl[] = { | |||
3733 | { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050, | 3725 | { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050, |
3734 | PCI_VENDOR_ID_PLX, | 3726 | PCI_VENDOR_ID_PLX, |
3735 | PCI_SUBDEVICE_ID_UNKNOWN_0x1584, 0, 0, | 3727 | PCI_SUBDEVICE_ID_UNKNOWN_0x1584, 0, 0, |
3736 | pbn_b0_4_115200 }, | 3728 | pbn_b2_4_115200 }, |
3729 | /* Unknown card - subdevice 0x1588 */ | ||
3730 | { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050, | ||
3731 | PCI_VENDOR_ID_PLX, | ||
3732 | PCI_SUBDEVICE_ID_UNKNOWN_0x1588, 0, 0, | ||
3733 | pbn_b2_8_115200 }, | ||
3737 | { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050, | 3734 | { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050, |
3738 | PCI_SUBVENDOR_ID_KEYSPAN, | 3735 | PCI_SUBVENDOR_ID_KEYSPAN, |
3739 | PCI_SUBDEVICE_ID_KEYSPAN_SX2, 0, 0, | 3736 | PCI_SUBDEVICE_ID_KEYSPAN_SX2, 0, 0, |
@@ -4791,6 +4788,10 @@ static struct pci_device_id serial_pci_tbl[] = { | |||
4791 | PCI_VENDOR_ID_IBM, 0x0299, | 4788 | PCI_VENDOR_ID_IBM, 0x0299, |
4792 | 0, 0, pbn_b0_bt_2_115200 }, | 4789 | 0, 0, pbn_b0_bt_2_115200 }, |
4793 | 4790 | ||
4791 | { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9835, | ||
4792 | 0x1000, 0x0012, | ||
4793 | 0, 0, pbn_b0_bt_2_115200 }, | ||
4794 | |||
4794 | { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9901, | 4795 | { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9901, |
4795 | 0xA000, 0x1000, | 4796 | 0xA000, 0x1000, |
4796 | 0, 0, pbn_b0_1_115200 }, | 4797 | 0, 0, pbn_b0_1_115200 }, |
diff --git a/drivers/tty/serial/8250/8250_pnp.c b/drivers/tty/serial/8250/8250_pnp.c index 35d9ab95c5cb..b3455a970a1d 100644 --- a/drivers/tty/serial/8250/8250_pnp.c +++ b/drivers/tty/serial/8250/8250_pnp.c | |||
@@ -429,6 +429,7 @@ serial_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id) | |||
429 | { | 429 | { |
430 | struct uart_8250_port uart; | 430 | struct uart_8250_port uart; |
431 | int ret, line, flags = dev_id->driver_data; | 431 | int ret, line, flags = dev_id->driver_data; |
432 | struct resource *res = NULL; | ||
432 | 433 | ||
433 | if (flags & UNKNOWN_DEV) { | 434 | if (flags & UNKNOWN_DEV) { |
434 | ret = serial_pnp_guess_board(dev); | 435 | ret = serial_pnp_guess_board(dev); |
@@ -439,11 +440,12 @@ serial_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id) | |||
439 | memset(&uart, 0, sizeof(uart)); | 440 | memset(&uart, 0, sizeof(uart)); |
440 | if (pnp_irq_valid(dev, 0)) | 441 | if (pnp_irq_valid(dev, 0)) |
441 | uart.port.irq = pnp_irq(dev, 0); | 442 | uart.port.irq = pnp_irq(dev, 0); |
442 | if ((flags & CIR_PORT) && pnp_port_valid(dev, 2)) { | 443 | if ((flags & CIR_PORT) && pnp_port_valid(dev, 2)) |
443 | uart.port.iobase = pnp_port_start(dev, 2); | 444 | res = pnp_get_resource(dev, IORESOURCE_IO, 2); |
444 | uart.port.iotype = UPIO_PORT; | 445 | else if (pnp_port_valid(dev, 0)) |
445 | } else if (pnp_port_valid(dev, 0)) { | 446 | res = pnp_get_resource(dev, IORESOURCE_IO, 0); |
446 | uart.port.iobase = pnp_port_start(dev, 0); | 447 | if (pnp_resource_enabled(res)) { |
448 | uart.port.iobase = res->start; | ||
447 | uart.port.iotype = UPIO_PORT; | 449 | uart.port.iotype = UPIO_PORT; |
448 | } else if (pnp_mem_valid(dev, 0)) { | 450 | } else if (pnp_mem_valid(dev, 0)) { |
449 | uart.port.mapbase = pnp_mem_start(dev, 0); | 451 | uart.port.mapbase = pnp_mem_start(dev, 0); |
diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig index cf9210db9fa9..7e7006fd404e 100644 --- a/drivers/tty/serial/Kconfig +++ b/drivers/tty/serial/Kconfig | |||
@@ -211,14 +211,14 @@ config SERIAL_SAMSUNG | |||
211 | config SERIAL_SAMSUNG_UARTS_4 | 211 | config SERIAL_SAMSUNG_UARTS_4 |
212 | bool | 212 | bool |
213 | depends on PLAT_SAMSUNG | 213 | depends on PLAT_SAMSUNG |
214 | default y if !(CPU_S3C2410 || SERIAL_S3C2412 || CPU_S3C2440 || CPU_S3C2442) | 214 | default y if !(CPU_S3C2410 || CPU_S3C2412 || CPU_S3C2440 || CPU_S3C2442) |
215 | help | 215 | help |
216 | Internal node for the common case of 4 Samsung compatible UARTs | 216 | Internal node for the common case of 4 Samsung compatible UARTs |
217 | 217 | ||
218 | config SERIAL_SAMSUNG_UARTS | 218 | config SERIAL_SAMSUNG_UARTS |
219 | int | 219 | int |
220 | depends on PLAT_SAMSUNG | 220 | depends on PLAT_SAMSUNG |
221 | default 6 if ARCH_S5P6450 | 221 | default 6 if CPU_S5P6450 |
222 | default 4 if SERIAL_SAMSUNG_UARTS_4 || CPU_S3C2416 | 222 | default 4 if SERIAL_SAMSUNG_UARTS_4 || CPU_S3C2416 |
223 | default 3 | 223 | default 3 |
224 | help | 224 | help |
diff --git a/drivers/tty/serial/bcm63xx_uart.c b/drivers/tty/serial/bcm63xx_uart.c index 719594e5fc21..52a3ecd40421 100644 --- a/drivers/tty/serial/bcm63xx_uart.c +++ b/drivers/tty/serial/bcm63xx_uart.c | |||
@@ -235,7 +235,7 @@ static const char *bcm_uart_type(struct uart_port *port) | |||
235 | */ | 235 | */ |
236 | static void bcm_uart_do_rx(struct uart_port *port) | 236 | static void bcm_uart_do_rx(struct uart_port *port) |
237 | { | 237 | { |
238 | struct tty_port *port = &port->state->port; | 238 | struct tty_port *tty_port = &port->state->port; |
239 | unsigned int max_count; | 239 | unsigned int max_count; |
240 | 240 | ||
241 | /* limit number of char read in interrupt, should not be | 241 | /* limit number of char read in interrupt, should not be |
@@ -260,7 +260,7 @@ static void bcm_uart_do_rx(struct uart_port *port) | |||
260 | bcm_uart_writel(port, val, UART_CTL_REG); | 260 | bcm_uart_writel(port, val, UART_CTL_REG); |
261 | 261 | ||
262 | port->icount.overrun++; | 262 | port->icount.overrun++; |
263 | tty_insert_flip_char(port, 0, TTY_OVERRUN); | 263 | tty_insert_flip_char(tty_port, 0, TTY_OVERRUN); |
264 | } | 264 | } |
265 | 265 | ||
266 | if (!(iestat & UART_IR_STAT(UART_IR_RXNOTEMPTY))) | 266 | if (!(iestat & UART_IR_STAT(UART_IR_RXNOTEMPTY))) |
@@ -299,11 +299,11 @@ static void bcm_uart_do_rx(struct uart_port *port) | |||
299 | 299 | ||
300 | 300 | ||
301 | if ((cstat & port->ignore_status_mask) == 0) | 301 | if ((cstat & port->ignore_status_mask) == 0) |
302 | tty_insert_flip_char(port, c, flag); | 302 | tty_insert_flip_char(tty_port, c, flag); |
303 | 303 | ||
304 | } while (--max_count); | 304 | } while (--max_count); |
305 | 305 | ||
306 | tty_flip_buffer_push(port); | 306 | tty_flip_buffer_push(tty_port); |
307 | } | 307 | } |
308 | 308 | ||
309 | /* | 309 | /* |
diff --git a/drivers/tty/serial/mpc52xx_uart.c b/drivers/tty/serial/mpc52xx_uart.c index c0e1fad51be7..018bad922554 100644 --- a/drivers/tty/serial/mpc52xx_uart.c +++ b/drivers/tty/serial/mpc52xx_uart.c | |||
@@ -550,7 +550,7 @@ static int mpc512x_psc_clock(struct uart_port *port, int enable) | |||
550 | return 0; | 550 | return 0; |
551 | 551 | ||
552 | psc_num = (port->mapbase & 0xf00) >> 8; | 552 | psc_num = (port->mapbase & 0xf00) >> 8; |
553 | snprintf(clk_name, sizeof(clk_name), "psc%d_clk", psc_num); | 553 | snprintf(clk_name, sizeof(clk_name), "psc%d_mclk", psc_num); |
554 | psc_clk = clk_get(port->dev, clk_name); | 554 | psc_clk = clk_get(port->dev, clk_name); |
555 | if (IS_ERR(psc_clk)) { | 555 | if (IS_ERR(psc_clk)) { |
556 | dev_err(port->dev, "Failed to get PSC clock entry!\n"); | 556 | dev_err(port->dev, "Failed to get PSC clock entry!\n"); |
diff --git a/drivers/tty/serial/of_serial.c b/drivers/tty/serial/of_serial.c index d5874605682b..b025d5438275 100644 --- a/drivers/tty/serial/of_serial.c +++ b/drivers/tty/serial/of_serial.c | |||
@@ -241,6 +241,12 @@ static struct of_device_id of_platform_serial_table[] = { | |||
241 | { .compatible = "ns16850", .data = (void *)PORT_16850, }, | 241 | { .compatible = "ns16850", .data = (void *)PORT_16850, }, |
242 | { .compatible = "nvidia,tegra20-uart", .data = (void *)PORT_TEGRA, }, | 242 | { .compatible = "nvidia,tegra20-uart", .data = (void *)PORT_TEGRA, }, |
243 | { .compatible = "nxp,lpc3220-uart", .data = (void *)PORT_LPC3220, }, | 243 | { .compatible = "nxp,lpc3220-uart", .data = (void *)PORT_LPC3220, }, |
244 | { .compatible = "altr,16550-FIFO32", | ||
245 | .data = (void *)PORT_ALTR_16550_F32, }, | ||
246 | { .compatible = "altr,16550-FIFO64", | ||
247 | .data = (void *)PORT_ALTR_16550_F64, }, | ||
248 | { .compatible = "altr,16550-FIFO128", | ||
249 | .data = (void *)PORT_ALTR_16550_F128, }, | ||
244 | #ifdef CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL | 250 | #ifdef CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL |
245 | { .compatible = "ibm,qpace-nwp-serial", | 251 | { .compatible = "ibm,qpace-nwp-serial", |
246 | .data = (void *)PORT_NWPSERIAL, }, | 252 | .data = (void *)PORT_NWPSERIAL, }, |
diff --git a/drivers/tty/serial/sunsu.c b/drivers/tty/serial/sunsu.c index e343d6670854..451687cb9685 100644 --- a/drivers/tty/serial/sunsu.c +++ b/drivers/tty/serial/sunsu.c | |||
@@ -968,6 +968,7 @@ static struct uart_ops sunsu_pops = { | |||
968 | #define UART_NR 4 | 968 | #define UART_NR 4 |
969 | 969 | ||
970 | static struct uart_sunsu_port sunsu_ports[UART_NR]; | 970 | static struct uart_sunsu_port sunsu_ports[UART_NR]; |
971 | static int nr_inst; /* Number of already registered ports */ | ||
971 | 972 | ||
972 | #ifdef CONFIG_SERIO | 973 | #ifdef CONFIG_SERIO |
973 | 974 | ||
@@ -1337,13 +1338,8 @@ static int __init sunsu_console_setup(struct console *co, char *options) | |||
1337 | printk("Console: ttyS%d (SU)\n", | 1338 | printk("Console: ttyS%d (SU)\n", |
1338 | (sunsu_reg.minor - 64) + co->index); | 1339 | (sunsu_reg.minor - 64) + co->index); |
1339 | 1340 | ||
1340 | /* | 1341 | if (co->index > nr_inst) |
1341 | * Check whether an invalid uart number has been specified, and | 1342 | return -ENODEV; |
1342 | * if so, search for the first available port that does have | ||
1343 | * console support. | ||
1344 | */ | ||
1345 | if (co->index >= UART_NR) | ||
1346 | co->index = 0; | ||
1347 | port = &sunsu_ports[co->index].port; | 1343 | port = &sunsu_ports[co->index].port; |
1348 | 1344 | ||
1349 | /* | 1345 | /* |
@@ -1408,7 +1404,6 @@ static enum su_type su_get_type(struct device_node *dp) | |||
1408 | 1404 | ||
1409 | static int su_probe(struct platform_device *op) | 1405 | static int su_probe(struct platform_device *op) |
1410 | { | 1406 | { |
1411 | static int inst; | ||
1412 | struct device_node *dp = op->dev.of_node; | 1407 | struct device_node *dp = op->dev.of_node; |
1413 | struct uart_sunsu_port *up; | 1408 | struct uart_sunsu_port *up; |
1414 | struct resource *rp; | 1409 | struct resource *rp; |
@@ -1418,16 +1413,16 @@ static int su_probe(struct platform_device *op) | |||
1418 | 1413 | ||
1419 | type = su_get_type(dp); | 1414 | type = su_get_type(dp); |
1420 | if (type == SU_PORT_PORT) { | 1415 | if (type == SU_PORT_PORT) { |
1421 | if (inst >= UART_NR) | 1416 | if (nr_inst >= UART_NR) |
1422 | return -EINVAL; | 1417 | return -EINVAL; |
1423 | up = &sunsu_ports[inst]; | 1418 | up = &sunsu_ports[nr_inst]; |
1424 | } else { | 1419 | } else { |
1425 | up = kzalloc(sizeof(*up), GFP_KERNEL); | 1420 | up = kzalloc(sizeof(*up), GFP_KERNEL); |
1426 | if (!up) | 1421 | if (!up) |
1427 | return -ENOMEM; | 1422 | return -ENOMEM; |
1428 | } | 1423 | } |
1429 | 1424 | ||
1430 | up->port.line = inst; | 1425 | up->port.line = nr_inst; |
1431 | 1426 | ||
1432 | spin_lock_init(&up->port.lock); | 1427 | spin_lock_init(&up->port.lock); |
1433 | 1428 | ||
@@ -1461,6 +1456,8 @@ static int su_probe(struct platform_device *op) | |||
1461 | } | 1456 | } |
1462 | dev_set_drvdata(&op->dev, up); | 1457 | dev_set_drvdata(&op->dev, up); |
1463 | 1458 | ||
1459 | nr_inst++; | ||
1460 | |||
1464 | return 0; | 1461 | return 0; |
1465 | } | 1462 | } |
1466 | 1463 | ||
@@ -1488,7 +1485,7 @@ static int su_probe(struct platform_device *op) | |||
1488 | 1485 | ||
1489 | dev_set_drvdata(&op->dev, up); | 1486 | dev_set_drvdata(&op->dev, up); |
1490 | 1487 | ||
1491 | inst++; | 1488 | nr_inst++; |
1492 | 1489 | ||
1493 | return 0; | 1490 | return 0; |
1494 | 1491 | ||
diff --git a/drivers/tty/serial/vt8500_serial.c b/drivers/tty/serial/vt8500_serial.c index a3f9dd5c9dff..705240e6c4ec 100644 --- a/drivers/tty/serial/vt8500_serial.c +++ b/drivers/tty/serial/vt8500_serial.c | |||
@@ -611,14 +611,7 @@ static int vt8500_serial_probe(struct platform_device *pdev) | |||
611 | vt8500_port->uart.dev = &pdev->dev; | 611 | vt8500_port->uart.dev = &pdev->dev; |
612 | vt8500_port->uart.flags = UPF_IOREMAP | UPF_BOOT_AUTOCONF; | 612 | vt8500_port->uart.flags = UPF_IOREMAP | UPF_BOOT_AUTOCONF; |
613 | 613 | ||
614 | vt8500_port->clk = of_clk_get(pdev->dev.of_node, 0); | 614 | vt8500_port->uart.uartclk = clk_get_rate(vt8500_port->clk); |
615 | if (!IS_ERR(vt8500_port->clk)) { | ||
616 | vt8500_port->uart.uartclk = clk_get_rate(vt8500_port->clk); | ||
617 | } else { | ||
618 | /* use the default of 24Mhz if not specified and warn */ | ||
619 | pr_warn("%s: serial clock source not specified\n", __func__); | ||
620 | vt8500_port->uart.uartclk = 24000000; | ||
621 | } | ||
622 | 615 | ||
623 | snprintf(vt8500_port->name, sizeof(vt8500_port->name), | 616 | snprintf(vt8500_port->name, sizeof(vt8500_port->name), |
624 | "VT8500 UART%d", pdev->id); | 617 | "VT8500 UART%d", pdev->id); |
diff --git a/drivers/tty/tty_buffer.c b/drivers/tty/tty_buffer.c index bb119934e76c..578aa7594b11 100644 --- a/drivers/tty/tty_buffer.c +++ b/drivers/tty/tty_buffer.c | |||
@@ -425,7 +425,7 @@ static void flush_to_ldisc(struct work_struct *work) | |||
425 | struct tty_ldisc *disc; | 425 | struct tty_ldisc *disc; |
426 | 426 | ||
427 | tty = port->itty; | 427 | tty = port->itty; |
428 | if (WARN_RATELIMIT(tty == NULL, "tty is NULL\n")) | 428 | if (tty == NULL) |
429 | return; | 429 | return; |
430 | 430 | ||
431 | disc = tty_ldisc_ref(tty); | 431 | disc = tty_ldisc_ref(tty); |