- return NULL;
-
- nrec = (struct namedb_record *)malloc(sizeof(struct namedb_record));
- if (nrec == NULL) {
- free(data.dptr);
- return NULL;
- }
-
- memcpy(nrec, data.dptr, sizeof(struct namedb_record));
- free(data.dptr);
-
- return nrec;
-}
-
-/**
- * busdb_store
- */
-static int busdb_store(const struct udevice *dev)
-{
- TDB_DATA key, data;
- char keystr[BUS_SIZE+ID_SIZE+2];
- struct busdb_record rec;
- int retval = 0;
-
- if (dev == NULL)
- return -1;
-
- memset(keystr, 0, (BUS_SIZE+ID_SIZE+2));
- strcpy(keystr, dev->bus_name);
- strcat(keystr, UDEVDB_DEL);
- strcat(keystr, dev->bus_id);
-
- 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;
-}
-
-/**
- * classdb_store
- */
-static int classdb_store(const struct udevice *dev)
-{
- TDB_DATA key, data;
- char keystr[NAME_SIZE+NAME_SIZE+2];
- struct classdb_record rec;
- int retval = 0;
-
- if (dev == NULL)
- return -1;
-
- memset(keystr, 0, (NAME_SIZE+NAME_SIZE+2));
- strcpy(keystr, dev->class_name);
- strcat(keystr, UDEVDB_DEL);
- strcat(keystr, dev->class_dev_name);
-
- 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;