summaryrefslogtreecommitdiff
path: root/dev_d.c
diff options
context:
space:
mode:
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>2004-10-18 19:11:51 -0700
committerGreg KH <gregkh@suse.de>2005-04-26 22:02:46 -0700
commit7a947ce51586fd4212447643df90580542777ab9 (patch)
treed9d30236cf65e489b9bc2c5003ef9e1fa838f53e /dev_d.c
parent8e0871196c916be60a9d0327ce8483c4f9763c17 (diff)
[PATCH] big cleanup of internal udev api
Here is the first patch to cleanup the internal processing of the various stages of an udev event. It should not change any behavior, but if your system depends on udev, please always test it before reboot :) We pass only one generic structure around between add, remove, namedev, db and dev_d handling and make all relevant data available to all internal stages. All udev structures are renamed to "udev". We replace the fake parameter by a flag in the udev structure. We open the class device in the main binaries and not in udev_add, to make it possible to use libsysfs for udevstart directory crawling. The last sleep parameters are removed.
Diffstat (limited to 'dev_d.c')
-rw-r--r--dev_d.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/dev_d.c b/dev_d.c
index eaf9b1dc12..5580b5a362 100644
--- a/dev_d.c
+++ b/dev_d.c
@@ -80,7 +80,7 @@ static int run_program(char *name)
* subsystem/
* default/
*/
-void dev_d_send(struct udevice *dev, const char *subsystem, const char *devpath)
+void dev_d_send(struct udevice *udev)
{
char dirname[256];
char env_devname[NAME_SIZE];
@@ -91,17 +91,17 @@ void dev_d_send(struct udevice *dev, const char *subsystem, const char *devpath)
return;
memset(env_devname, 0x00, sizeof(env_devname));
- if (dev->type == 'b' || dev->type == 'c') {
+ if (udev->type == 'b' || udev->type == 'c') {
strfieldcpy(env_devname, udev_root);
- strfieldcat(env_devname, dev->name);
- } else if (dev->type == 'n') {
- strfieldcpy(env_devname, dev->name);
- setenv("DEVPATH", devpath, 1);
+ strfieldcat(env_devname, udev->name);
+ } else if (udev->type == 'n') {
+ strfieldcpy(env_devname, udev->name);
+ setenv("DEVPATH", udev->devpath, 1);
}
setenv("DEVNAME", env_devname, 1);
dbg("DEVNAME='%s'", env_devname);
- devname = strdup(dev->name);
+ devname = strdup(udev->name);
if (!devname) {
dbg("out of memory");
return;
@@ -121,11 +121,11 @@ void dev_d_send(struct udevice *dev, const char *subsystem, const char *devpath)
}
strcpy(dirname, DEVD_DIR);
- strfieldcat(dirname, dev->name);
+ strfieldcat(dirname, udev->name);
call_foreach_file(run_program, dirname, DEVD_SUFFIX);
strcpy(dirname, DEVD_DIR);
- strfieldcat(dirname, subsystem);
+ strfieldcat(dirname, udev->subsystem);
call_foreach_file(run_program, dirname, DEVD_SUFFIX);
strcpy(dirname, DEVD_DIR "default");