예제 #1
0
static int modem_data_init(struct viatel_modem_data *d)
{
    int ret = 0;

    d->ntf_flags = 0;
    RAW_INIT_NOTIFIER_HEAD(&d->ntf);
    wake_lock_init(&d->wlock, WAKE_LOCK_SUSPEND, "cbp_rst");
    spin_lock_init( &d->lock );
    INIT_WORK(&d->work, modem_notify_task);
    INIT_WORK(&d->via_uevent_work, via_uevent_work_func);
    d->rst_ntf.notifier_call = modem_reset_notify_misc;
    atomic_set(&d->count, 0);
end:
    return ret;
}
예제 #2
0
static int modem_data_init(struct viatel_modem_data *d)
{
    int ret = 0;
    d->modem_kobj = viatel_kobject_add("modem");
    if(!d->modem_kobj){
        ret = -ENOMEM;
        goto end;
    }
    d->ntf_flags = 0;
    RAW_INIT_NOTIFIER_HEAD(&d->ntf);
    wake_lock_init(&d->wlock, WAKE_LOCK_SUSPEND, "cbp_rst");
    INIT_WORK(&d->work, modem_notify_task);
    d->rst_ntf.notifier_call = modem_reset_notify_misc;
    d->pwr_ntf.notifier_call = modem_power_notify_misc;
    atomic_set(&d->count, 0);
end:
    return ret;
}