+ if (class_dev == NULL)
+ return -ENODEV;
+
+ memset(&dbdev, 0, sizeof(dbdev));
+ strncpy(dbdev.name, name, NAME_SIZE);
+ if (class_dev->sysdevice) {
+ strncpy(dbdev.sysfs_dev_path, class_dev->sysdevice->directory->path, PATH_SIZE);
+ strncpy(dbdev.bus_id, class_dev->sysdevice->bus_id, ID_SIZE);
+ }
+ strncpy(dbdev.class_dev_name, class_dev->name, NAME_SIZE);
+// if ((sysfs_get_name_from_path(subsystem, dbdev.class_name, NAME_SIZE)) != 0)
+// strcpy(dbdev.class_name, "unknown");
+ strcpy(dbdev.bus_name, "unknown");
+ if (class_dev->driver != NULL)
+ strncpy(dbdev.driver, class_dev->driver->name, NAME_SIZE);
+ else
+ strcpy(dbdev.driver, "unknown");
+ dbdev.type = type;
+ dbdev.major = major;
+ dbdev.minor = minor;
+ dbdev.mode = mode;
+
+ if ((busdb_store(&dbdev)) != 0)
+ return -1;
+ if ((classdb_store(&dbdev)) != 0)