summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile6
-rw-r--r--dev_d.c1
-rw-r--r--namedev.c4
-rw-r--r--udev.c3
-rw-r--r--udev_add.c6
-rw-r--r--udev_db.c (renamed from udevdb.c)12
-rw-r--r--udev_db.h (renamed from udevdb.h)16
-rw-r--r--udev_remove.c8
-rw-r--r--udevinfo.c6
-rw-r--r--udevtest.c2
10 files changed, 31 insertions, 33 deletions
diff --git a/Makefile b/Makefile
index 50c72279f8..09b74fcde7 100644
--- a/Makefile
+++ b/Makefile
@@ -210,7 +210,7 @@ OBJS = udev_lib.o \
udev_add.o \
udev_remove.o \
udev_sysfs.o \
- udevdb.o \
+ udev_db.o \
namedev.o \
namedev_parse.o \
dev_d.o \
@@ -220,7 +220,7 @@ HEADERS = udev.h \
udev_lib.h \
namedev.h \
udev_version.h \
- udevdb.h \
+ udev_db.h \
udev_sysfs.h \
logging.h \
selinux.h \
@@ -292,7 +292,7 @@ $(TESTER): $(LIBC) $(TESTER).o $(OBJS) $(HEADERS)
$(QUIET) $(STRIPCMD) $@
$(INFO): $(LIBC) $(INFO).o $(OBJS) $(HEADERS)
- $(QUIET) $(LD) $(LDFLAGS) -o $@ $(CRT0) udevinfo.o udev_lib.o udev_config.o udevdb.o $(SYSFS) $(LIB_OBJS) $(ARCH_LIB_OBJS)
+ $(QUIET) $(LD) $(LDFLAGS) -o $@ $(CRT0) udevinfo.o udev_lib.o udev_config.o udev_db.o $(SYSFS) $(LIB_OBJS) $(ARCH_LIB_OBJS)
$(QUIET) $(STRIPCMD) $@
$(DAEMON): $(LIBC) $(DAEMON).o $(OBJS) udevd.h
diff --git a/dev_d.c b/dev_d.c
index b3d05d9220..d14c70c256 100644
--- a/dev_d.c
+++ b/dev_d.c
@@ -29,7 +29,6 @@
#include "udev.h"
#include "udev_lib.h"
-#include "udevdb.h"
#include "logging.h"
static int run_program(const char *filename, void *data)
diff --git a/namedev.c b/namedev.c
index 9c94e69082..3ab45d4ec6 100644
--- a/namedev.c
+++ b/namedev.c
@@ -40,7 +40,7 @@
#include "udev_version.h"
#include "logging.h"
#include "namedev.h"
-#include "udevdb.h"
+#include "udev_db.h"
static struct sysfs_attribute *find_sysfs_attribute(struct sysfs_class_device *class_dev, struct sysfs_device *sysfs_device, char *attr);
@@ -194,7 +194,7 @@ static int find_free_number(struct udevice *udev, const char *name)
while (1) {
dbg("look for existing node '%s'", filename);
memset(&db_udev, 0x00, sizeof(struct udevice));
- if (udevdb_get_dev_byname(&db_udev, filename) != 0) {
+ if (udev_db_get_device_byname(&db_udev, filename) != 0) {
dbg("free num=%d", num);
return num;
}
diff --git a/udev.c b/udev.c
index bb3385e67d..a41f222778 100644
--- a/udev.c
+++ b/udev.c
@@ -34,9 +34,8 @@
#include "udev_lib.h"
#include "udev_sysfs.h"
#include "udev_version.h"
-#include "logging.h"
#include "namedev.h"
-#include "udevdb.h"
+#include "logging.h"
#ifdef LOG
diff --git a/udev_add.c b/udev_add.c
index c139bd38bf..4fb5ef18c0 100644
--- a/udev_add.c
+++ b/udev_add.c
@@ -42,7 +42,7 @@
#include "udev_version.h"
#include "logging.h"
#include "namedev.h"
-#include "udevdb.h"
+#include "udev_db.h"
#include "selinux.h"
@@ -303,8 +303,8 @@ int udev_add_device(struct udevice *udev, struct sysfs_class_device *class_dev)
if (retval != 0)
goto exit;
- if (udevdb_add_dev(udev) != 0)
- dbg("udevdb_add_dev failed, but we create the node anyway, "
+ if (udev_db_add_device(udev) != 0)
+ dbg("udev_db_add_dev failed, but we create the node anyway, "
"remove might not work for custom names");
/* use full path to the environment */
diff --git a/udevdb.c b/udev_db.c
index 38830b098e..f2a890ea42 100644
--- a/udevdb.c
+++ b/udev_db.c
@@ -1,5 +1,5 @@
/*
- * udevdb.c
+ * udev_db.c
*
* Userspace devfs
*
@@ -35,7 +35,7 @@
#include "udev.h"
#include "udev_lib.h"
#include "logging.h"
-#include "udevdb.h"
+#include "udev_db.h"
#define PATH_TO_NAME_CHAR '@'
@@ -57,7 +57,7 @@ static int get_db_filename(struct udevice *udev, char *filename, int len)
return 0;
}
-int udevdb_add_dev(struct udevice *udev)
+int udev_db_add_device(struct udevice *udev)
{
char filename[SYSFS_PATH_MAX];
FILE *f;
@@ -135,7 +135,7 @@ static int parse_db_file(struct udevice *udev, const char *filename)
return 0;
}
-int udevdb_get_dev(struct udevice *udev)
+int udev_db_get_device(struct udevice *udev)
{
char filename[SYSFS_PATH_MAX];
@@ -144,7 +144,7 @@ int udevdb_get_dev(struct udevice *udev)
return parse_db_file(udev, filename);
}
-int udevdb_delete_dev(struct udevice *udev)
+int udev_db_delete_device(struct udevice *udev)
{
char filename[SYSFS_PATH_MAX];
@@ -154,7 +154,7 @@ int udevdb_delete_dev(struct udevice *udev)
return 0;
}
-int udevdb_get_dev_byname(struct udevice *udev, const char *name)
+int udev_db_get_device_byname(struct udevice *udev, const char *name)
{
struct dirent *ent;
DIR *dir;
diff --git a/udevdb.h b/udev_db.h
index 4f6b5de90c..141c586f24 100644
--- a/udevdb.h
+++ b/udev_db.h
@@ -1,5 +1,5 @@
/*
- * udevdb.h
+ * udev_db.h
*
* Userspace devfs
*
@@ -21,14 +21,14 @@
*
*/
-#ifndef _UDEVDB_H_
-#define _UDEVDB_H_
+#ifndef _UDEV_DB_H_
+#define _UDEV_DB_H_
-extern int udevdb_add_dev(struct udevice *dev);
-extern int udevdb_get_dev(struct udevice *dev);
-extern int udevdb_delete_dev(struct udevice *dev);
+extern int udev_db_add_device(struct udevice *dev);
+extern int udev_db_get_device(struct udevice *dev);
+extern int udev_db_delete_device(struct udevice *dev);
-extern int udevdb_get_dev_byname(struct udevice *udev, const char *name);
+extern int udev_db_get_device_byname(struct udevice *udev, const char *name);
-#endif /* _UDEVDB_H_ */
+#endif /* _UDEV_DB_H_ */
diff --git a/udev_remove.c b/udev_remove.c
index 56834a45b9..32cd785984 100644
--- a/udev_remove.c
+++ b/udev_remove.c
@@ -33,9 +33,9 @@
#include "udev.h"
#include "udev_lib.h"
#include "udev_version.h"
-#include "logging.h"
#include "namedev.h"
-#include "udevdb.h"
+#include "udev_db.h"
+#include "logging.h"
static int delete_path(const char *path)
{
@@ -175,7 +175,7 @@ int udev_remove_device(struct udevice *udev)
if (udev->type != 'b' && udev->type != 'c')
return 0;
- retval = udevdb_get_dev(udev);
+ retval = udev_db_get_device(udev);
if (retval) {
/* fall back to kernel name */
temp = strrchr(udev->devpath, '/');
@@ -186,7 +186,7 @@ int udev_remove_device(struct udevice *udev)
}
dbg("remove name='%s'", udev->name);
- udevdb_delete_dev(udev);
+ udev_db_delete_device(udev);
/* use full path to the environment */
snprintf(udev->devname, NAME_SIZE, "%s/%s", udev_root, udev->name);
diff --git a/udevinfo.c b/udevinfo.c
index 1148272743..08c25d3a04 100644
--- a/udevinfo.c
+++ b/udevinfo.c
@@ -32,8 +32,8 @@
#include "udev.h"
#include "udev_lib.h"
#include "udev_version.h"
+#include "udev_db.h"
#include "logging.h"
-#include "udevdb.h"
#define SYSFS_VALUE_SIZE 256
@@ -355,7 +355,7 @@ static int process_options(int argc, char *argv[])
}
memset(&udev, 0x00, sizeof(struct udevice));
strfieldcpy(udev.devpath, pos);
- retval = udevdb_get_dev(&udev);
+ retval = udev_db_get_device(&udev);
if (retval != 0) {
printf("device not found in database\n");
goto exit;
@@ -374,7 +374,7 @@ static int process_options(int argc, char *argv[])
memset(&udev, 0x00, sizeof(struct udevice));
strfieldcpy(udev.name, pos);
- retval = udevdb_get_dev_byname(&udev, pos);
+ retval = udev_db_get_device_byname(&udev, pos);
if (retval != 0) {
printf("device not found in database\n");
goto exit;
diff --git a/udevtest.c b/udevtest.c
index 14c511584b..b9a5fea489 100644
--- a/udevtest.c
+++ b/udevtest.c
@@ -31,8 +31,8 @@
#include "udev.h"
#include "udev_lib.h"
#include "udev_version.h"
-#include "logging.h"
#include "namedev.h"
+#include "logging.h"
#ifdef LOG