if (!request_mem_region(phys, size, subdev->name)) {
ret = -EBUSY; goto out;
}
if (subdev->plat->set_vpp)
subdev->map.set_vpp = sa1100_set_vpp;
subdev->map.phys = phys;
subdev->map.size = size;
subdev->map.virt = ioremap(phys, size); if (!subdev->map.virt) {
ret = -ENOMEM; goto err;
}
simple_map_init(&subdev->map);
/* * Now let's probe for the actual flash. Do it here since * specific machine settings might have been set above.
*/
subdev->mtd = do_map_probe(subdev->plat->map_name, &subdev->map); if (subdev->mtd == NULL) {
ret = -ENXIO; goto err;
}
ret = sa1100_probe_subdev(subdev, res); if (ret) break;
}
info->num_subdev = i;
/* * ENXIO is special. It means we didn't find a chip when we probed.
*/ if (ret != 0 && !(ret == -ENXIO && info->num_subdev > 0)) goto err;
/* * If we found one device, don't bother with concat support. If * we found multiple devices, use concat if we have it available, * otherwise fail. Either way, it'll be called "sa1100".
*/ if (info->num_subdev == 1) {
strcpy(info->subdev[0].name, plat->name);
info->mtd = info->subdev[0].mtd;
ret = 0;
} elseif (info->num_subdev > 1) { struct mtd_info **cdev;
cdev = kmalloc_array(nr, sizeof(*cdev), GFP_KERNEL); if (!cdev) {
ret = -ENOMEM; goto err;
}
/* * We detected multiple devices. Concatenate them together.
*/ for (i = 0; i < info->num_subdev; i++)
cdev[i] = info->subdev[i].mtd;
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.