static int bcmbt_tty_init(void) { int err; pr_debug("%s: BLUETOOTH:\n", __func__); /* Inherit the N_TTY's ops */ n_tty_inherit_ops(&bcmbt_ldisc_ops); bcmbt_ldisc_ops.owner = THIS_MODULE; bcmbt_ldisc_ops.name = "bcmbt_tty"; bcmbt_ldisc_ops.ioctl = bcmbt_tty_ioctl; bcmbt_ldisc_saved.open = bcmbt_ldisc_ops.open; bcmbt_ldisc_saved.close = bcmbt_ldisc_ops.close; bcmbt_ldisc_ops.open = bcmbt_tty_open; bcmbt_ldisc_ops.close = bcmbt_tty_close; err = tty_register_ldisc(N_BRCM_HCI, &bcmbt_ldisc_ops); if (err) pr_err("can't register N_BRCM_HCI line discipline\n"); else pr_info("N_BRCM_HCI line discipline registered\n"); pr_debug("%s BLUETOOTH:Exiting.\n", __func__); return err; }
static int __init pps_tty_init(void) { int err; /* Inherit the N_TTY's ops */ n_tty_inherit_ops(&pps_ldisc_ops); /* Save N_TTY's open()/close() methods */ alias_n_tty_open = pps_ldisc_ops.open; alias_n_tty_close = pps_ldisc_ops.close; /* Init PPS_TTY data */ pps_ldisc_ops.owner = THIS_MODULE; pps_ldisc_ops.magic = PPS_TTY_MAGIC; pps_ldisc_ops.name = "pps_tty"; pps_ldisc_ops.dcd_change = pps_tty_dcd_change; pps_ldisc_ops.open = pps_tty_open; pps_ldisc_ops.close = pps_tty_close; err = tty_register_ldisc(N_PPS, &pps_ldisc_ops); if (err) pr_err("can't register PPS line discipline\n"); else pr_info("PPS line discipline registered\n"); return err; }