if (tty->flip.count >= TTY_FLIPBUF_SIZE)
drop = 1;
if (ZS_IS_ASLEEP(uap))
- return NULL;
+ return 0;
if (!ZS_IS_OPEN(uap))
goto retry;
}
ioremap(np->addrs[np->n_addrs - 1].address, 0x1000);
if (uap->rx_dma_regs == NULL) {
iounmap((void *)uap->tx_dma_regs);
- uap->tx_dma_regs = NULL;
uap->flags &= ~PMACZILOG_FLAG_HAS_DMA;
goto no_dma;
}
uap->port.ops = &pmz_pops;
uap->port.type = PORT_PMAC_ZILOG;
uap->port.flags = 0;
+ spin_lock_init(&uap->port.lock);
/* Setup some valid baud rate information in the register
* shadows so we don't write crap there before baud rate is
{
struct device_node *np;
- np = uap->node;
- iounmap((void *)uap->rx_dma_regs);
- iounmap((void *)uap->tx_dma_regs);
iounmap((void *)uap->control_reg);
+ np = uap->node;
uap->node = NULL;
of_node_put(np);
- memset(uap, 0, sizeof(struct uart_pmac_port));
}
/*
* Register this driver with the serial core
*/
rc = uart_register_driver(&pmz_uart_reg);
- if (rc)
+ if (rc != 0)
return rc;
/*
struct uart_pmac_port *uport = &pmz_ports[i];
/* NULL node may happen on wallstreet */
if (uport->node != NULL)
- rc = uart_add_one_port(&pmz_uart_reg, &uport->port);
- if (rc)
- goto err_out;
+ uart_add_one_port(&pmz_uart_reg, &uport->port);
}
return 0;
-err_out:
- while (i-- > 0) {
- struct uart_pmac_port *uport = &pmz_ports[i];
- uart_remove_one_port(&pmz_uart_reg, &uport->port);
- }
- uart_unregister_driver(&pmz_uart_reg);
- return rc;
}
static struct of_match pmz_match[] =
static int __init init_pmz(void)
{
- int rc, i;
printk(KERN_INFO "%s\n", version);
/*
/*
* Now we register with the serial layer
*/
- rc = pmz_register();
- if (rc) {
- printk(KERN_ERR
- "pmac_zilog: Error registering serial device, disabling pmac_zilog.\n"
- "pmac_zilog: Did another serial driver already claim the minors?\n");
- /* effectively "pmz_unprobe()" */
- for (i=0; i < pmz_ports_count; i++)
- pmz_dispose_port(&pmz_ports[i]);
- return rc;
- }
+ pmz_register();
/*
* Then we register the macio driver itself