From 5840bc63e2029d22682d8de77dc8fcc4da1b436c Mon Sep 17 00:00:00 2001 From: "greg@kroah.com" Date: Mon, 20 Oct 2003 22:48:44 -0700 Subject: [PATCH] major database cleanups Now we standardise on a struct udevice to pass around, and store in the database. This cleaned up the database code a lot. --- udev-remove.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'udev-remove.c') diff --git a/udev-remove.c b/udev-remove.c index 430f1c901e..c61a948fa0 100644 --- a/udev-remove.c +++ b/udev-remove.c @@ -40,15 +40,20 @@ * something different from the kernel name. If we have, us it. If not, use * the default kernel name for lack of anything else to know to do. */ -static char *get_name(char *dev, int major, int minor) +static char *get_name(char *path, int major, int minor) { static char name[100]; + struct udevice *dev; char *temp; - if (udevdb_get_dev(dev, &name[0], sizeof(name)) == 0) + dev = udevdb_get_dev(path); + if (dev != NULL) { + strcpy(name, dev->name); goto exit; + } - temp = strrchr(dev, '/'); + dbg("%s not found in database, falling back on default name", path); + temp = strrchr(path, '/'); if (temp == NULL) return NULL; strncpy(name, &temp[1], sizeof(name)); @@ -84,7 +89,6 @@ int udev_remove_device(char *device, char *subsystem) goto exit; } - udevdb_delete_udevice(name); udevdb_delete_dev(device); return delete_node(name); -- cgit v1.2.3-54-g00ecf