- struct sysfs_class_device *class_dev;
- char *devpath;
- char path[PATH_SIZE];
- char temp[PATH_SIZE];
- struct udevice udev;
- char *subsystem = NULL;
-
- info("version %s", UDEV_VERSION);
-
- if (argc < 2 || argc > 3) {
- info("Usage: udevtest <devpath> [subsystem]");
- return 1;
+ int force = 0;
+ const char *action = "add";
+ const char *subsystem = NULL;
+ const char *devpath = NULL;
+ struct udevice *udev;
+ struct sysfs_device *dev;
+ struct udev_rules rules = {};
+ int retval;
+ int rc = 0;
+
+ static const struct option options[] = {
+ { "action", 1, NULL, 'a' },
+ { "subsystem", 1, NULL, 's' },
+ { "force", 0, NULL, 'f' },
+ { "help", 0, NULL, 'h' },
+ {}
+ };
+
+ info("version %s\n", UDEV_VERSION);
+ udev_config_init();
+ if (udev_log_priority < LOG_INFO) {
+ char priority[32];
+
+ udev_log_priority = LOG_INFO;
+ sprintf(priority, "%i", udev_log_priority);
+ setenv("UDEV_LOG", priority, 1);