- struct udevice udev;
- struct sysfs_class_device *class_dev;
- const char *devpath;
-
- devpath = &path[strlen(sysfs_path)];
- setenv("DEVPATH", devpath, 1);
- setenv("SUBSYSTEM", subsystem, 1);
- dbg("exec: '%s' (%s)\n", devpath, path);
-
- class_dev = sysfs_open_class_device_path(path);
- if (class_dev == NULL) {
- dbg("sysfs_open_class_device_path failed");
+ struct sysfs_device *dev;
+ struct udevice *udev;
+ int retval = 0;
+
+ /* clear and set environment for next event */
+ clearenv();
+ setenv("ACTION", "add", 1);
+ setenv("UDEV_START", "1", 1);
+ if (udev_log_str)
+ setenv("UDEV_LOG", udev_log_str, 1);
+ if (udev_run_str)
+ setenv("UDEV_RUN", udev_run_str, 1);
+
+ dev = sysfs_device_get(devpath);
+ if (dev == NULL)