+#define PATH_TO_NAME_CHAR '@'
+
+static int get_db_filename(struct udevice *udev, char *filename, int len)
+{
+ char devpath[SYSFS_PATH_MAX];
+ char *pos;
+
+ /* replace '/' to transform path into a filename */
+ strfieldcpy(devpath, udev->devpath);
+ pos = strchr(&devpath[1], '/');
+ while (pos) {
+ pos[0] = PATH_TO_NAME_CHAR;
+ pos = strchr(&pos[1], '/');
+ }
+ snprintf(filename, len-1, "%s%s", udev_db_path, devpath);
+ filename[len-1] = '\0';
+
+ return 0;
+}