示例#1
0
static int sc16is7xx_remove(struct device *dev)
{
	struct sc16is7xx_port *s = dev_get_drvdata(dev);
	int i, ret = 0;

#ifdef CONFIG_GPIOLIB
	if (s->devtype->nr_gpio) {
		ret = gpiochip_remove(&s->gpio);
		if (ret)
			return ret;
	}
#endif

	for (i = 0; i < s->uart.nr; i++) {
		cancel_work_sync(&s->p[i].tx_work);
		cancel_work_sync(&s->p[i].md_work);
		uart_remove_one_port(&s->uart, &s->p[i].port);
		sc16is7xx_power(&s->p[i].port, 0);
	}

	mutex_destroy(&s->mutex);
	uart_unregister_driver(&s->uart);
	if (!IS_ERR(s->clk))
		clk_disable_unprepare(s->clk);

	return ret;
}
示例#2
0
static void __exit ks8695uart_exit(void)
{
	int i;

	for (i = 0; i < SERIAL_KS8695_NR; i++)
		uart_remove_one_port(&ks8695_reg, &ks8695uart_ports[0]);
	uart_unregister_driver(&ks8695_reg);
}
示例#3
0
static int __init virtual_uart_init(void)
{
    int result, i, size;
    unsigned int line;

    result = uart_register_driver(&virtual_uart_console_reg);

    if (result) {
        ErrorMsg("Cant Register Driver");
        return result;
    }

    for (line=0; line < VIRTUAL_UART_NR; line++) {
        virtual_uart_console_port[line].line = line;
        result = uart_add_one_port(&virtual_uart_console_reg, &virtual_uart_console_port[line]);

        if (result) {
            for(; line > 0; line--) {
                virtual_uart_console_port[line].line = line;
                uart_remove_one_port(&virtual_uart_console_reg, &virtual_uart_console_port[line]);
            }
            virtual_uart_console_port[line].line = line;
            uart_remove_one_port(&virtual_uart_console_reg, &virtual_uart_console_port[line]);
            uart_unregister_driver(&virtual_uart_console_reg);
            return result;
        }
    }


    size = USER_CMD_SIZE + 4 + 4 + USER_RESULT_SIZE + 4 + 4 + 4;

    for (i=0; i<VIRTUAL_UART_NR; i++) {
        virt_uart_tx_rx[i].tx_fifo = i*size + (unsigned char *) VIRT_UART_BUF_START;
        virt_uart_tx_rx[i].tx_pro = (unsigned int *) (virt_uart_tx_rx[i].tx_fifo + USER_CMD_SIZE);
        virt_uart_tx_rx[i].tx_con = (unsigned int *) (virt_uart_tx_rx[i].tx_pro + 1);
        virt_uart_tx_rx[i].rx_fifo = (unsigned char *) (virt_uart_tx_rx[i].tx_con + 1);
        virt_uart_tx_rx[i].rx_pro = (unsigned int *) (virt_uart_tx_rx[i].rx_fifo + USER_RESULT_SIZE);
        virt_uart_tx_rx[i].rx_con = (unsigned int *) (virt_uart_tx_rx[i].rx_pro + 1);
        virt_uart_tx_rx[i].status = (unsigned int *) (virt_uart_tx_rx[i].rx_con + 1);
        *(virt_uart_tx_rx[i].tx_pro) = *(virt_uart_tx_rx[i].tx_con) =
                                           *(virt_uart_tx_rx[i].rx_pro) = *(virt_uart_tx_rx[i].rx_con) = 0;
        *(virt_uart_tx_rx[i].status) = 0;
    }

    return 0;
}
static int __exit sc26xx_driver_remove(struct platform_device *dev)
{
	struct uart_sc26xx_port *up = dev_get_drvdata(&dev->dev);

	free_irq(up->port[0].irq, up);

	uart_remove_one_port(&sc26xx_reg, &up->port[0]);
	uart_remove_one_port(&sc26xx_reg, &up->port[1]);

	uart_unregister_driver(&sc26xx_reg);

	kfree(up);
	sc26xx_port = NULL;

	dev_set_drvdata(&dev->dev, NULL);
	return 0;
}
示例#5
0
static int tegra_uart_remove(struct platform_device *pdev)
{
	struct tegra_uart_port *tup = platform_get_drvdata(pdev);
	struct uart_port *u = &tup->uport;

	uart_remove_one_port(&tegra_uart_driver, u);
	return 0;
}
示例#6
0
static int digicolor_uart_remove(struct platform_device *pdev)
{
	struct uart_port *port = platform_get_drvdata(pdev);

	uart_remove_one_port(&digicolor_uart, port);

	return 0;
}
示例#7
0
int uart_plat_remove(struct platform_device *dev)
{
  printk(KERN_INFO " uart_plat_remove \n");
  platform_set_drvdata(dev, NULL);
  /* remove port to uart driver */
  uart_remove_one_port(&uart_reg, &my_uart_port);
  return 0;
}
static int sirfsoc_uart_remove(struct platform_device *pdev)
{
	struct sirfsoc_uart_port *sirfport = platform_get_drvdata(pdev);
	struct uart_port *port = &sirfport->port;
	clk_disable_unprepare(sirfport->clk);
	clk_put(sirfport->clk);
	uart_remove_one_port(&sirfsoc_uart_drv, port);
	return 0;
}
示例#9
0
文件: pnx8xxx_uart.c 项目: 7799/linux
static int pnx8xxx_serial_remove(struct platform_device *pdev)
{
	struct pnx8xxx_port *sport = platform_get_drvdata(pdev);

	if (sport)
		uart_remove_one_port(&pnx8xxx_reg, &sport->port);

	return 0;
}
示例#10
0
static void __exit lh7a40xuart_exit(void)
{
	int i;

	for (i = 0; i < DEV_NR; i++)
		uart_remove_one_port (&lh7a40x_reg, &lh7a40x_ports[i].port);

	uart_unregister_driver (&lh7a40x_reg);
}
示例#11
0
int s3c24xx_serial_remove(struct device *_dev)
{
	struct uart_port *port = s3c24xx_dev_to_port(_dev);

	if (port)
		uart_remove_one_port(&s3c24xx_uart_drv, port);

	return 0;
}
示例#12
0
static void __exit sa1100_serial_exit(void)
{
	int i;

	for (i = 0; i < NR_PORTS; i++)
		uart_remove_one_port(&sa1100_reg, &sa1100_ports[i].port);

	uart_unregister_driver(&sa1100_reg);
}
示例#13
0
static void __exit leonuart_exit(void)
{
	int i;

	for (i = 0; i < UART_NR; i++)
		uart_remove_one_port(&leon_reg, &leon_ports[i].port);

	uart_unregister_driver(&leon_reg);
}
示例#14
0
文件: m32r_sio.c 项目: 19Dan01/linux
static void __exit m32r_sio_exit(void)
{
	int i;

	for (i = 0; i < UART_NR; i++)
		uart_remove_one_port(&m32r_sio_reg, &m32r_sio_ports[i].port);

	uart_unregister_driver(&m32r_sio_reg);
}
示例#15
0
文件: mvebu-uart.c 项目: 020gzh/linux
static int mvebu_uart_remove(struct platform_device *pdev)
{
	struct mvebu_uart_data *data = platform_get_drvdata(pdev);

	uart_remove_one_port(&mvebu_uart_driver, data->port);
	data->port->private_data = NULL;
	data->port->mapbase      = 0;
	return 0;
}
示例#16
0
static void __exit clps711xuart_exit(void)
{
	int i;

	for (i = 0; i < UART_NR; i++)
		uart_remove_one_port(&clps711x_reg, &clps711x_ports[i]);

	uart_unregister_driver(&clps711x_reg);
}
示例#17
0
static int s3c24xx_serial_remove(struct platform_device *dev)
{
	struct uart_port *port = s3c24xx_dev_to_port(&dev->dev);

	if (port)
		uart_remove_one_port(&s3c24xx_uart_drv, port);

	return 0;
}
示例#18
0
static void __exit serial8250_exit(void)
{
	int i;

	for (i = 0; i < UART_NR; i++)
		uart_remove_one_port(&serial8250_reg, &serial8250_ports[i].port);

	uart_unregister_driver(&serial8250_reg);
}
示例#19
0
static int vt8500_serial_remove(struct platform_device *pdev)
{
	struct vt8500_port *vt8500_port = platform_get_drvdata(pdev);

	clk_disable_unprepare(vt8500_port->clk);
	uart_remove_one_port(&vt8500_uart_driver, &vt8500_port->uart);

	return 0;
}
示例#20
0
static int etraxfs_uart_remove(struct platform_device *pdev)
{
	struct uart_port *port;

	port = platform_get_drvdata(pdev);
	uart_remove_one_port(&etraxfs_uart_driver, port);
	etraxfs_uart_ports[port->line] = NULL;

	return 0;
}
示例#21
0
static void __exit v850e_uart_exit (void)
{
	unsigned chan;

	for (chan = 0; chan < V850E_UART_NUM_CHANNELS; chan++)
		uart_remove_one_port (&v850e_uart_driver,
				      &v850e_uart_ports[chan]);

	uart_unregister_driver (&v850e_uart_driver);
}
示例#22
0
static void __exit gaisler_apbuart_exit(void)
{
	int i;

	for (i = 0; i < leon_ports_nr; i++)
		uart_remove_one_port(&leon_reg, &leon_ports[i].port);

	uart_unregister_driver(&leon_reg);

}
示例#23
0
static int sirfsoc_uart_remove(struct platform_device *pdev)
{
	struct sirfsoc_uart_port *sirfport = platform_get_drvdata(pdev);
	struct uart_port *port = &sirfport->port;
	platform_set_drvdata(pdev, NULL);
	if (sirfport->hw_flow_ctrl)
		pinctrl_put(sirfport->p);
	uart_remove_one_port(&sirfsoc_uart_drv, port);
	return 0;
}
示例#24
0
文件: meson_uart.c 项目: 3null/linux
static int meson_uart_remove(struct platform_device *pdev)
{
	struct uart_port *port;

	port = platform_get_drvdata(pdev);
	uart_remove_one_port(&meson_uart_driver, port);
	meson_ports[pdev->id] = NULL;

	return 0;
}
示例#25
0
static int milkymist_uart_remove(struct platform_device *dev)
{
	struct uart_port *port = dev_get_drvdata(&dev->dev);

	uart_remove_one_port(&milkymist_uart_driver, port);
	dev_set_drvdata(&dev->dev, NULL);
	port->mapbase = 0;

	return 0;
}
示例#26
0
static void __exit virtual_uart_console_cleanup(void)
{
    int line;

    for (line=0; line < VIRTUAL_UART_NR; line++)  {
        virtual_uart_console_port[line].line = line;
        uart_remove_one_port(&virtual_uart_console_reg, &virtual_uart_console_port[line]);
    }
    uart_unregister_driver(&virtual_uart_console_reg);
}
示例#27
0
void nwpserial_unregister_port(int line)
{
	struct nwpserial_port *up = &nwpserial_ports[line];
	mutex_lock(&nwpserial_mutex);
	uart_remove_one_port(&nwpserial_reg, &up->port);

	up->port.type = PORT_UNKNOWN;

	mutex_unlock(&nwpserial_mutex);
}
示例#28
0
static int sa1100_serial_remove(struct platform_device *pdev)
{
	struct sa1100_port *sport = platform_get_drvdata(pdev);

	platform_set_drvdata(pdev, NULL);

	if (sport)
		uart_remove_one_port(&sa1100_reg, &sport->port);

	return 0;
}
示例#29
0
static int cpm_uart_drv_remove(struct device *dev)
{
	struct platform_device  *pdev = to_platform_device(dev);
	struct fs_uart_platform_info *pdata = pdev->dev.platform_data;

	pr_debug("cpm_uart_drv_remove: Removing CPM UART %d\n",
			cpm_uart_id2nr(pdata->fs_no));

        uart_remove_one_port(&cpm_reg, &cpm_uart_ports[pdata->fs_no].port);
        return 0;
}
示例#30
0
static int timbuart_remove(struct platform_device *dev)
{
	struct timbuart_port *uart = platform_get_drvdata(dev);

	tasklet_kill(&uart->tasklet);
	uart_remove_one_port(&timbuart_driver, &uart->port);
	uart_unregister_driver(&timbuart_driver);
	kfree(uart);

	return 0;
}