--- trunk/src/device.c 2007/10/08 16:18:31 11 +++ trunk/src/device.c 2007/10/08 16:18:38 12 @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * - * $Id: device.c,v 1.14 2005/06/22 08:13:38 debug Exp $ + * $Id: device.c,v 1.16 2005/08/10 22:25:50 debug Exp $ * * Device registry framework. */ @@ -181,7 +181,7 @@ */ int device_unregister(char *name) { - size_t i; + ssize_t i; struct device_entry *p = device_lookup(name); if (p == NULL) { @@ -233,6 +233,7 @@ /* Default values: */ devinit.addr_mult = 1; + devinit.in_use = 1; /* Get the device name first: */ s2 = name_and_params; @@ -290,6 +291,19 @@ devinit.addr_mult = mystrtoull(s3, NULL, 0); } else if (strncmp(s2, "irq=", 4) == 0) { devinit.irq_nr = mystrtoull(s3, NULL, 0); + } else if (strncmp(s2, "in_use=", 7) == 0) { + devinit.in_use = mystrtoull(s3, NULL, 0); + } else if (strncmp(s2, "name2=", 6) == 0) { + char *h = s2 + 6; + size_t len = 0; + while (*h && *h != ' ') + h++, len++; + devinit.name2 = malloc(len + 1); + if (devinit.name2 == NULL) { + fprintf(stderr, "out of memory\n"); + exit(1); + } + snprintf(devinit.name2, len + 1, s2 + 6); } else { fatal("unknown param: %s\n", s2); if (device_exit_on_error)