in platforms/iss/network.c [607:657]
static int __init iss_net_setup(char *str)
{
struct iss_net_private *device = NULL;
struct iss_net_init *new;
struct list_head *ele;
char *end;
int rc;
unsigned n;
end = strchr(str, '=');
if (!end) {
pr_err("Expected '=' after device number\n");
return 1;
}
*end = 0;
rc = kstrtouint(str, 0, &n);
*end = '=';
if (rc < 0) {
pr_err("Failed to parse '%s'\n", str);
return 1;
}
str = end;
spin_lock(&devices_lock);
list_for_each(ele, &devices) {
device = list_entry(ele, struct iss_net_private, device_list);
if (device->index == n)
break;
}
spin_unlock(&devices_lock);
if (device && device->index == n) {
pr_err("Device %u already configured\n", n);
return 1;
}
new = memblock_alloc(sizeof(*new), SMP_CACHE_BYTES);
if (new == NULL) {
pr_err("Alloc_bootmem failed\n");
return 1;
}
INIT_LIST_HEAD(&new->list);
new->index = n;
new->init = str + 1;
list_add_tail(&new->list, ð_cmd_line);
return 1;
}