chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f014262
)
[PATCH] Handle the '!' character that some block devices have.
author
greg@kroah.com
<greg@kroah.com>
Thu, 12 Feb 2004 07:49:04 +0000
(23:49 -0800)
committer
Greg KH
<gregkh@suse.de>
Wed, 27 Apr 2005 04:32:26 +0000
(21:32 -0700)
namedev.c
patch
|
blob
|
history
diff --git
a/namedev.c
b/namedev.c
index 7984adfb31d87fc1d42ebcefe7e9d4576cdfba24..3e2182ae7b8f7c3678bc66f966409f3b8ae24476 100644
(file)
--- a/
namedev.c
+++ b/
namedev.c
@@
-313,6
+313,19
@@
exit:
return; /* here to prevent compiler warning... */
}
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;
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);
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);
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);
/* get kernel number */
pos = class_dev->name + strlen(class_dev->name);