diff options
author | greg@kroah.com <greg@kroah.com> | 2003-10-20 22:48:44 -0700 |
---|---|---|
committer | Greg KH <gregkh@suse.de> | 2005-04-26 21:01:42 -0700 |
commit | 5840bc63e2029d22682d8de77dc8fcc4da1b436c (patch) | |
tree | 620021f8bb1d66f60cf98d6e356d0f90d1e9d8b1 /udev-remove.c | |
parent | c8c47999ff59b0235b217fbab4cba0c86b0fd075 (diff) |
[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.
Diffstat (limited to 'udev-remove.c')
-rw-r--r-- | udev-remove.c | 12 |
1 files changed, 8 insertions, 4 deletions
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); |