Example #1
0
static int __init qmi_init(void)
{
	int ret;

	qmi_wq = create_singlethread_workqueue("qmi");
	if (qmi_wq == 0)
		return -ENOMEM;

	qmi_ctxt_init(&qmi_device0, 0);
	qmi_ctxt_init(&qmi_device1, 1);
	qmi_ctxt_init(&qmi_device2, 2);

	ret = misc_register(&qmi_device0.misc);
	if (ret == 0)
		ret = misc_register(&qmi_device1.misc);
	if (ret == 0)
		ret = misc_register(&qmi_device2.misc);
	return ret;
}
Example #2
0
static int __init qmi_init(void)
{
    int ret;

    qmi_wq = create_singlethread_workqueue("qmi");
    if (qmi_wq == NULL)
        return -ENOMEM;

    wake_lock_init(&wakelock, WAKE_LOCK_SUSPEND, "qmi");
    INIT_WORK(&read_work, qmi_read_work);
    INIT_WORK(&open_work, qmi_open_work);

    qmi_ctxt_init(&qmi_device0, 0);
    qmi_ctxt_init(&qmi_device1, 1);
    qmi_ctxt_init(&qmi_device2, 2);

    ret = misc_register(&qmi_device0.misc);
    if (ret == 0)
        ret = misc_register(&qmi_device1.misc);
    if (ret == 0)
        ret = misc_register(&qmi_device2.misc);
    return ret;
}