- memset(keystr, 0, sizeof(keystr));
- strcpy(keystr, path);
-
- key.dptr = (void *)keystr;
- key.dsize = strlen(keystr) + 1;
-
- strcpy(rec.name, dev->name);
-
- data.dptr = (void *) &rec;
- data.dsize = sizeof(rec);
-
- retval = tdb_store(udevdb, key, data, TDB_REPLACE);
- return retval;
-}
-
-/**
- * namedb_store
- */
-static int namedb_store(const struct udevice *dev)
-{
- TDB_DATA key, data;
- char keystr[NAME_SIZE];
- struct namedb_record rec;
- int retval = 0;
-
- if (dev == NULL)
- return -1;
-
- memset(keystr, 0, NAME_SIZE);
- strcpy(keystr, dev->name);
-
- key.dptr = (void *)keystr;
- key.dsize = strlen(keystr) + 1;
-
- strcpy(rec.sysfs_dev_path, dev->sysfs_dev_path);
- strcpy(rec.id, dev->bus_id);
- strcpy(rec.class_dev_name, dev->class_dev_name);
- strcpy(rec.class_name, dev->class_name);
- rec.type = dev->type;
- rec.major = dev->major;
- rec.minor = dev->minor;
- rec.mode = dev->mode;
-
- data.dptr = (void *) &rec;
- data.dsize = sizeof(rec);
-
- retval = tdb_store(udevdb, key, data, TDB_REPLACE);
- return retval;