struct tty_driver *driver = line->driver->driver;
int err = -EINVAL;
- mutex_lock(&line->count_lock);
-
if (line->port.count) {
*error_out = "Device is already open";
goto out;
}
}
out:
- mutex_unlock(&line->count_lock);
return err;
}
line = &lines[dev];
- mutex_lock(&line->count_lock);
if (!line->valid)
CONFIG_CHUNK(str, size, n, "none", 1);
else {
tty_kref_put(tty);
}
}
- mutex_unlock(&line->count_lock);
return n;
}
tty_port_init(&lines[i].port);
lines[i].port.ops = &line_port_ops;
spin_lock_init(&lines[i].lock);
- mutex_init(&lines[i].count_lock);
lines[i].driver = line_driver;
INIT_LIST_HEAD(&lines[i].chan_list);
}