summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgreg@kroah.com <greg@kroah.com>2004-02-11 23:49:04 -0800
committerGreg KH <gregkh@suse.de>2005-04-26 21:32:26 -0700
commit1b9410278e40850bdcedb2fdfc0f815361b1c303 (patch)
tree45f45a98433e9ebc61805048f150ce97ae50dae4
parentf0142622b8b68d58694d0c97396bb24d0830c5df (diff)
[PATCH] Handle the '!' character that some block devices have.
-rw-r--r--namedev.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/namedev.c b/namedev.c
index 7984adfb31..3e2182ae7b 100644
--- a/namedev.c
+++ b/namedev.c
@@ -313,6 +313,19 @@ exit:
return; /* here to prevent compiler warning... */
}
+static void fix_kernel_name(struct udevice *udev)
+{
+ char *temp = udev->kernel_name;
+
+ while (*temp != 0x00) {
+ /* Some block devices have a ! in their name,
+ * we need to change that to / */
+ if (*temp == '!')
+ *temp = '/';
+ ++temp;
+ }
+}
+
static int execute_program(char *path, char *value, int len)
{
int retval;
@@ -701,11 +714,12 @@ int namedev_name_device(struct sysfs_class_device *class_dev, struct udevice *ud
dbg("sysfs_device->bus='%s'", sysfs_device->bus);
strfieldcpy(udev->bus_id, sysfs_device->bus_id);
wait_for_device_to_initialize(sysfs_device);
- } else {
- dbg("class_dev->name = '%s'", class_dev->name);
}
+ dbg("class_dev->name = '%s'", class_dev->name);
strfieldcpy(udev->kernel_name, class_dev->name);
+ fix_kernel_name(udev);
+ dbg("udev->kernel_name = '%s'", udev->kernel_name);
/* get kernel number */
pos = class_dev->name + strlen(class_dev->name);