Пример #1
0
int __init rtcfg_init(void)
{
    int ret;


    printk("RTcfg: init real-time configuration distribution protocol\n");

    ret = rtcfg_init_ioctls();
    if (ret != 0)
	goto error1;

    rtcfg_init_state_machines();

    ret = rtcfg_init_frames();
    if (ret != 0)
	goto error2;

#ifdef CONFIG_XENO_OPT_VFILE
    ret = rtcfg_init_proc();
    if (ret != 0) {
	rtcfg_cleanup_frames();
	goto error2;
    }
#endif

    return 0;

  error2:
    rtcfg_cleanup_state_machines();
    rtcfg_cleanup_ioctls();

  error1:
    return ret;
}
Пример #2
0
int __init rtcfg_init(void)
{
    int ret;


    printk("RTcfg: init real-time configuration distribution protocol\n");

#if defined(CONFIG_RTAI_24) || defined(CONFIG_RTAI_30) || defined(CONFIG_RTAI_31)
    if (start_timer) {
        rt_set_oneshot_mode();
        start_rt_timer(0);
    }
#endif

    ret = rtcfg_init_ioctls();
    if (ret != 0)
        goto error1;

    rtcfg_init_state_machines();

    ret = rtcfg_init_frames();
    if (ret != 0)
        goto error2;

#ifdef CONFIG_PROC_FS
    ret = rtcfg_init_proc();
    if (ret != 0)
        goto error3;
#endif

    return 0;

  error3:
    rtcfg_cleanup_frames();

  error2:
    rtcfg_cleanup_state_machines();
    rtcfg_cleanup_ioctls();

  error1:
#if defined(CONFIG_RTAI_24) || defined(CONFIG_RTAI_30) || defined(CONFIG_RTAI_31)
    if (start_timer)
        stop_rt_timer();
#endif

    return ret;
}