static int __init msm_serial_hsl_init_irda(void) { int ret; /* Switch Uart Debug by Kernel Flag */ if (get_kernel_flag() & KERNEL_FLAG_SERIAL_HSL_ENABLE) msm_serial_hsl_enable = 1; if (!msm_serial_hsl_enable) msm_hsl_uart_driver.cons = NULL; ret = uart_register_driver(&msm_hsl_uart_driver); if (unlikely(ret)) return ret; debug_base = debugfs_create_dir("msm_serial_irda", NULL); if (IS_ERR_OR_NULL(debug_base)) E("%s():Cannot create debugfs dir\n", __func__); ret = platform_driver_register(&msm_hsl_platform_driver); if (unlikely(ret)) uart_unregister_driver(&msm_hsl_uart_driver); D("%s(): driver initialized, msm_serial_hsl_enable %d\n", __func__, msm_serial_hsl_enable); return ret; }
//******** init and exit ******** int __init uart_init(void) { int retval; /* register uart driver */ printk(KERN_INFO "The process has started \n"); if ((retval = uart_register_driver(&uart_reg))) { printk(KERN_INFO "Error Registering Driver, Error Code :%d\n",retval); return retval; } /* register platform device, usually called during arch-specific setup */ uart_plat_device = platform_device_register_simple("uart", 0, NULL, 0); if(IS_ERR(uart_plat_device)) { uart_unregister_driver(&uart_reg); printk(KERN_INFO "Error platform simple registeration \n"); return PTR_ERR(uart_plat_device); } /* Announce a matching plat-driver for plat-dev registered above */ retval = platform_driver_register(&uart_plat_driver); if(retval) { uart_unregister_driver(&uart_reg); platform_device_unregister(uart_plat_device); printk(KERN_INFO "Error platform registeration \n"); return -EFAULT; } printk(KERN_INFO " I am alive !! \n"); return 0; }
static int __init tegra_uart_init(void) { int ret; struct dentry *d; ret = uart_register_driver(&tegra_uart_driver); if (unlikely(ret)) { pr_err("Could not register %s driver\n", tegra_uart_driver.driver_name); return ret; } ret = platform_driver_register(&tegra_uart_platform_driver); if (unlikely(ret)) { pr_err("Could not register the UART platfrom driver\n"); uart_unregister_driver(&tegra_uart_driver); return ret; } irda_test_dir = debugfs_create_dir("tegra_irda", NULL); if (!irda_test_dir) { pr_err("Error in debugfs creation\n"); return PTR_ERR(irda_test_dir); } d = debugfs_create_u8("irda_loop", S_IWUSR | S_IRUGO, irda_test_dir, &irda_loop); if (!d) { pr_err("Error in debugfs entry creation\n"); return PTR_ERR(d); } pr_info("Initialized tegra uart driver\n"); return 0; }
static int __init sunxi_uart_init(void) { int ret; u32 i; struct sw_uart_pdata *pdata; sunxi_uart_device_scan(); ret = sw_uart_get_devinfo(); if (unlikely(ret)) return ret; ret = uart_register_driver(&sw_uart_driver); if (unlikely(ret)) { SERIAL_MSG("driver initializied\n"); return ret; } for (i=0; i<SUNXI_UART_NUM; i++) { pdata = &sw_uport_pdata[i]; if (!pdata->used) continue; platform_device_register(&sw_uport_device[i]); sunxi_uart_sysfs(&sw_uport_device[i]); } return platform_driver_register(&sw_uport_platform_driver); }
static int __init cpm_uart_init(void) { int ret, i; printk(KERN_INFO "Serial: CPM driver $Revision: 1.1 $\n"); #ifndef CONFIG_SERIAL_CPM_CONSOLE ret = cpm_uart_init_portdesc(); if (ret) return ret; #endif cpm_reg.nr = cpm_uart_nr; ret = uart_register_driver(&cpm_reg); if (ret) return ret; for (i = 0; i < cpm_uart_nr; i++) { int con = cpm_uart_port_map[i]; cpm_uart_ports[con].port.line = i; cpm_uart_ports[con].port.flags = UPF_BOOT_AUTOCONF; uart_add_one_port(&cpm_reg, &cpm_uart_ports[con].port); } return ret; }
static int __init cpm_uart_init(void) { int ret, i; printk(KERN_INFO "Serial: CPM driver $Revision: 1.1.1.1 $\n"); #ifndef CONFIG_SERIAL_CPM_CONSOLE ret = cpm_uart_init_portdesc(); if (ret) return ret; #endif cpm_reg.nr = cpm_uart_nr; ret = uart_register_driver(&cpm_reg); if (ret) return ret; for (i = 0; i < cpm_uart_nr; i++) { int con = cpm_uart_port_map[i]; cpm_uart_ports[con].port.line = i; cpm_uart_ports[con].port.flags = UPF_BOOT_AUTOCONF; uart_add_one_port(&cpm_reg, &cpm_uart_ports[con].port); /* <8272-2.6><SGT><26-Jun-05> */ /* Do not initialise scc if configured as console as it is done during console initialisation */ if(i != cpm_uart_ports[con].port.cons->index) cpm_uart_init_scc(&cpm_uart_ports[con].port); } return ret; }
static int __init grlib_apbuart_init(void) { int ret; /* Find all APBUARTS in device the tree and initialize their ports */ ret = grlib_apbuart_configure(); if (ret) return ret; printk(KERN_INFO "Serial: GRLIB APBUART driver\n"); ret = uart_register_driver(&grlib_apbuart_driver); if (ret) { printk(KERN_ERR "%s: uart_register_driver failed (%i)\n", __FILE__, ret); return ret; } ret = platform_driver_register(&grlib_apbuart_of_driver); if (ret) { printk(KERN_ERR "%s: platform_driver_register failed (%i)\n", __FILE__, ret); uart_unregister_driver(&grlib_apbuart_driver); return ret; } return ret; }
static int __init ip22zilog_ports_init(void) { int ret; printk(KERN_INFO "Serial: IP22 Zilog driver (%d chips).\n", NUM_IP22ZILOG); ip22zilog_prepare(); if (request_irq(zilog_irq, ip22zilog_interrupt, 0, "IP22-Zilog", ip22zilog_irq_chain)) { panic("IP22-Zilog: Unable to register zs interrupt handler.\n"); } ip22zilog_init_hw(); ret = uart_register_driver(&ip22zilog_reg); if (ret == 0) { int i; for (i = 0; i < NUM_CHANNELS; i++) { struct uart_ip22zilog_port *up = &ip22zilog_port_table[i]; uart_add_one_port(&ip22zilog_reg, &up->port); } } return ret; }
static int __init grlib_apbuart_init(void) { int ret; /* Find all APBUARTS in device the tree and initialize their ports */ ret = grlib_apbuart_configure(); if (ret) return ret; ; ret = uart_register_driver(&grlib_apbuart_driver); if (ret) { // printk(KERN_ERR "%s: uart_register_driver failed (%i)\n", ; return ret; } ret = platform_driver_register(&grlib_apbuart_of_driver); if (ret) { // printk(KERN_ERR // "%s: platform_driver_register failed (%i)\n", ; uart_unregister_driver(&grlib_apbuart_driver); return ret; } return ret; }
static int __init msm_serial_init(void) { int ret; /* FIH, Debbie, 2010/01/04 {*/ #ifdef CONFIG_FIH_FXX serial_debug_mask = *(uint32_t *)SER_DEBUG_MASK_OFFSET; #endif /* FIH, Debbie, 2010/01/04 }*/ ret = uart_register_driver(&msm_uart_driver); if (unlikely(ret)) return ret; ret = platform_driver_probe(&msm_platform_driver, msm_serial_probe); if (unlikely(ret)) uart_unregister_driver(&msm_uart_driver); /* FIH, Debbie, 2010/01/04 { */ #ifdef CONFIG_FIH_FXX fih_printk(serial_debug_mask, FIH_DEBUG_ZONE_G0, "msm_serial: driver initialized\n"); #else printk(KERN_INFO "msm_serial: driver initialized\n"); #endif /* FIH, Debbie, 2010/01/04 } */ return ret; }
static int __init dz_init(void) { int ret, i; if (IOASIC) return -ENXIO; printk("%s%s\n", dz_name, dz_version); dz_init_ports(); #ifndef CONFIG_SERIAL_DZ_CONSOLE /* reset the chip */ dz_reset(&dz_ports[0]); #endif if (request_irq(dz_ports[0].port.irq, dz_interrupt, IRQF_DISABLED, "DZ", &dz_ports[0])) panic("Unable to register DZ interrupt"); ret = uart_register_driver(&dz_reg); if (ret != 0) return ret; for (i = 0; i < DZ_NB_PORT; i++) uart_add_one_port(&dz_reg, &dz_ports[i].port); return ret; }
static int __init l4ser_shm_serial_init(void) { int ret; int i; pr_info("l4ser_shm: L4 shared mem serial driver\n"); ret = uart_register_driver(&l4ser_shm_reg); if (ret) return ret; ret = -ENODEV; for (i = 0; i < ports_to_add_pos; ++i) { if (!*l4ser_shm_port[i].name) continue; if (l4ser_shm_init_port(i, l4ser_shm_port[i].name)) { pr_warn("l4ser_shm: Failed to initialize additional port '%s'.\n", l4ser_shm_port[i].name); continue; } pr_info("l4ser_shm: Adding '%s'\n", l4ser_shm_port[i].name); uart_add_one_port(&l4ser_shm_reg, &l4ser_shm_port[i].port); ret = 0; } return ret; }
int __init dz_init(void) { unsigned long flags; int ret, i; printk("%s%s\n", dz_name, dz_version); dz_init_ports(); save_flags(flags); cli(); #ifndef CONFIG_SERIAL_DZ_CONSOLE /* reset the chip */ dz_reset(&dz_ports[0]); #endif /* order matters here... the trick is that flags is updated... in request_irq - to immediatedly obliterate it is unwise. */ restore_flags(flags); if (request_irq(dz_ports[0].port.irq, dz_interrupt, SA_INTERRUPT, "DZ", &dz_ports[0])) panic("Unable to register DZ interrupt"); ret = uart_register_driver(&dz_reg); if (ret != 0) return ret; for (i = 0; i < DZ_NB_PORT; i++) uart_add_one_port(&dz_reg, &dz_ports[i].port); return ret; }
int __init ulite_init(void) { int ret; pr_debug("uartlite: calling uart_register_driver()\n"); ret = uart_register_driver(&ulite_uart_driver); if (ret) goto err_uart; ret = ulite_of_register(); if (ret) goto err_of; pr_debug("uartlite: calling platform_driver_register()\n"); ret = platform_driver_register(&ulite_platform_driver); if (ret) goto err_plat; return 0; err_plat: ulite_of_unregister(); err_of: uart_unregister_driver(&ulite_uart_driver); err_uart: printk(KERN_ERR "registering uartlite driver failed: err=%i", ret); return ret; }
static int __init uart00_init(void) { int ret; int i; ret = uart_register_driver(&uart00_reg); if (ret) { printk(KERN_ERR "uart00: Couldn't register driver\n"); return ret; } unregister_console(&uart00_console); for(i=0;i<UART_NR;i++){ uart00_ports[i].ops=&uart00_pops; } printk(KERN_WARNING "uart00:Using temporary major/minor pairs - these WILL change in the future\n"); #ifdef CONFIG_PLD_HOTSWAP pldhs_register_driver(&uart00_pldhs_ops); #endif for (i=0; i<UART_NR; i++) uart_add_one_port(&uart00_reg,&uart00_ports[i]); uart00_console.flags = 0; register_console(&uart00_console); #ifdef CONFIG_ARCH_CAMELOT dev_port_map[0].port=uart00_ports; #endif return ret; }
int synopsys_uart_drv_init(void) { int ret = 0; ret = uart_register_driver(&synopsys_driver); return ret; }
static int __init altera_uart_init(void) { int rc; rc = uart_register_driver(&altera_uart_driver); if (rc) return rc; rc = platform_driver_register(&altera_uart_platform_driver); if (rc) uart_unregister_driver(&altera_uart_driver); return rc; }
static int __init jsm_init_module(void) { int rc; rc = uart_register_driver(&jsm_uart_driver); if (!rc) { rc = pci_register_driver(&jsm_driver); if (rc) uart_unregister_driver(&jsm_uart_driver); } return rc; }
static int __init s3c2440_serial_init(void) { int i, ret; s3c2440_init_ports(); ret = uart_register_driver(&s3c2440_reg); if (ret) return ret; return 0; }
static int __init serial_omap_init(void) { int ret; ret = uart_register_driver(&serial_omap_reg); if (ret != 0) return ret; ret = platform_driver_register(&serial_omap_driver); if (ret != 0) uart_unregister_driver(&serial_omap_reg); return ret; }
static int __init cpm_uart_init(void) { int ret = uart_register_driver(&cpm_reg); if (ret) return ret; ret = of_register_platform_driver(&cpm_uart_driver); if (ret) uart_unregister_driver(&cpm_reg); return ret; }
static int __init s3c24xx_serial_modinit(void) { int ret; ret = uart_register_driver(&s3c24xx_uart_drv); if (ret < 0) { printk(KERN_ERR "failed to register UART driver\n"); return -1; } return 0; }
static int __init hsu_pci_init(void) { int ret; hsu_global_init(); ret = uart_register_driver(&serial_hsu_reg); if (ret) return ret; return pci_register_driver(&hsu_pci_driver); }
static int __init tc3162ser_init(void) { int ret, i; ret = uart_register_driver(&tc3162ser_reg); if (!ret) { for (i = 0; i < TC3162_NR_PORTS; i++) uart_add_one_port(&tc3162ser_reg, &tc3162ser_ports[i]); } return ret; }
static int __init pl011_init(void) { int ret; printk(KERN_INFO "Serial: AMBA PL011 UART driver\n"); ret = uart_register_driver(&amba_reg); if (ret == 0) { ret = amba_driver_register(&pl011_driver); if (ret) uart_unregister_driver(&amba_reg); } return ret; }
static int __init ambauart_init(void) { int ret; ret = uart_register_driver(&amba_reg); if (ret == 0) { int i; for (i = 0; i < UART_NR; i++) uart_add_one_port(&amba_reg, &amba_ports[i].port); } return ret; }
static int __init lpc32xx_hsuart_init(void) { int ret; ret = uart_register_driver(&lpc32xx_hs_reg); if (ret == 0) { ret = platform_driver_register(&serial_hs_lpc32xx_driver); if (ret) uart_unregister_driver(&lpc32xx_hs_reg); } return ret; }
static int __init s3c_serial_modinit(void) { int ret; wake_lock_init(&uart_wakelock, WAKE_LOCK_SUSPEND, "s3c_uart_wakelock"); ret = uart_register_driver(&s3c_uart_drv); if (ret < 0) { printk(KERN_ERR "failed to register UART driver\n"); return -1; } return 0; }
static int __init etraxfs_uart_init(void) { int ret; ret = uart_register_driver(&etraxfs_uart_driver); if (ret) return ret; ret = platform_driver_register(&etraxfs_uart_platform_driver); if (ret) uart_unregister_driver(&etraxfs_uart_driver); return ret; }
static int __init pl010_init(void) { int ret; printk(KERN_INFO "Serial: AMBA driver $Revision: 1.41 $\n"); ret = uart_register_driver(&amba_reg); if (ret == 0) { ret = amba_driver_register(&pl010_driver); if (ret) uart_unregister_driver(&amba_reg); } return ret; }