rc = cdev_add(unit->cdev, MKDEV(unit->major, unit->lowest_minor),
unit->num_nodes); if (rc) {
dev_err(dev, "Failed to add cdev.\n"); /* kobject_put() is normally done by cdev_del() */
kobject_put(&unit->cdev->kobj); goto unregister_chrdev;
}
for (i = 0; i < num_nodes; i++) {
namelen = strnlen(idt, len);
if (namelen == len) {
dev_err(dev, "IDT's list of names is too short. This is exceptionally weird, because its CRC is OK\n");
rc = -ENODEV; goto unroll_device_create;
}
if (IS_ERR(device)) {
dev_err(dev, "Failed to create %s device. Aborting.\n",
devname);
rc = -ENODEV; goto unroll_device_create;
}
}
if (len) {
dev_err(dev, "IDT's list of names is too long. This is exceptionally weird, because its CRC is OK\n");
rc = -ENODEV; goto unroll_device_create;
}
int xillybus_find_inode(struct inode *inode, void **private_data, int *index)
{ int minor = iminor(inode); int major = imajor(inode); struct xilly_unit *unit = NULL, *iter;
mutex_lock(&unit_mutex);
list_for_each_entry(iter, &unit_list, list_entry) if (iter->major == major &&
minor >= iter->lowest_minor &&
minor < (iter->lowest_minor + iter->num_nodes)) {
unit = iter; break;
}
if (!unit) {
mutex_unlock(&unit_mutex); return -ENODEV;
}
*private_data = unit->private_data;
*index = minor - unit->lowest_minor;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.