summaryrefslogtreecommitdiff
path: root/namedev.c
diff options
context:
space:
mode:
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>2005-02-21 13:48:10 +0100
committerGreg KH <gregkh@suse.de>2005-04-26 23:36:13 -0700
commit8f2f6e426fc4cc1fa39b864a1792428a4269b751 (patch)
treeefacf88145a24ec9767099c50f313b4900dc5e86 /namedev.c
parent311a2b0a1d65a1bd02bbedda0dda90f10d6b6788 (diff)
[PATCH] cleanup db functions
Diffstat (limited to 'namedev.c')
-rw-r--r--namedev.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/namedev.c b/namedev.c
index aa45b79b13..c1c22a6cfb 100644
--- a/namedev.c
+++ b/namedev.c
@@ -299,6 +299,8 @@ static void apply_format(struct udevice *udev, char *string, size_t maxsize,
}
break;
case 'P':
+ if (!class_dev)
+ break;
class_dev_parent = sysfs_get_classdev_parent(class_dev);
if (class_dev_parent != NULL) {
struct udevice udev_parent;
@@ -306,8 +308,7 @@ static void apply_format(struct udevice *udev, char *string, size_t maxsize,
dbg("found parent '%s', get the node name", class_dev_parent->path);
memset(&udev_parent, 0x00, sizeof(struct udevice));
/* lookup the name in the udev_db with the DEVPATH of the parent */
- strfieldcpy(udev_parent.devpath, &class_dev_parent->path[strlen(sysfs_path)]);
- if (udev_db_get_device(&udev_parent) == 0) {
+ if (udev_db_get_device_by_devpath(&udev_parent, &class_dev_parent->path[strlen(sysfs_path)]) == 0) {
strfieldcatmax(string, udev_parent.name, maxsize);
dbg("substitute parent node name'%s'", udev_parent.name);
} else