2005-03-07 19:12:27

by Jeff Dike

[permalink] [raw]
Subject: [PATCH 6/16] UML - make the ubd driver recognize letters in device names

ubd_get_config wasn't using the standard device number parser, which caused
it not to recognize letters.

Signed-off-by: Jeff Dike <[email protected]>

Index: linux-2.6.11/arch/um/drivers/ubd_kern.c
===================================================================
--- linux-2.6.11.orig/arch/um/drivers/ubd_kern.c 2005-03-05 12:07:35.000000000 -0500
+++ linux-2.6.11/arch/um/drivers/ubd_kern.c 2005-03-05 12:11:43.000000000 -0500
@@ -746,15 +746,9 @@
static int ubd_get_config(char *name, char *str, int size, char **error_out)
{
struct ubd *dev;
- char *end;
int n, len = 0;

- n = simple_strtoul(name, &end, 0);
- if((*end != '\0') || (end == name)){
- *error_out = "ubd_get_config : didn't parse device number";
- return(-1);
- }
-
+ n = parse_unit(&name);
if((n >= MAX_DEV) || (n < 0)){
*error_out = "ubd_get_config : device number out of range";
return(-1);