summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2008-09-30 16:16:29 +0200
committerKay Sievers <kay.sievers@vrfy.org>2008-09-30 16:16:29 +0200
commite0083e8e69856f1b4e1e643cebb08906775cca8a (patch)
treede8d63b3a1e8a84a03e57f92e6cb6a7f20a0af0a
parentd98bffa802b214452d34109967423f1d60df89af (diff)
libudev: device_init() -> device_new()
-rw-r--r--udev/lib/libudev-device.c4
-rw-r--r--udev/lib/libudev-monitor.c2
-rw-r--r--udev/lib/libudev-private.h31
3 files changed, 15 insertions, 22 deletions
diff --git a/udev/lib/libudev-device.c b/udev/lib/libudev-device.c
index f5465e9892..893ec080a6 100644
--- a/udev/lib/libudev-device.c
+++ b/udev/lib/libudev-device.c
@@ -193,7 +193,7 @@ void device_set_info_loaded(struct udev_device *device)
device->info_loaded = 1;
}
-struct udev_device *device_init(struct udev *udev)
+struct udev_device *device_new(struct udev *udev)
{
struct udev_device *udev_device;
@@ -281,7 +281,7 @@ struct udev_device *udev_device_new_from_syspath(struct udev *udev, const char *
}
}
- udev_device = device_init(udev);
+ udev_device = device_new(udev);
if (udev_device == NULL)
return NULL;
diff --git a/udev/lib/libudev-monitor.c b/udev/lib/libudev-monitor.c
index e72b206623..751f19ae92 100644
--- a/udev/lib/libudev-monitor.c
+++ b/udev/lib/libudev-monitor.c
@@ -284,7 +284,7 @@ struct udev_device *udev_monitor_receive_device(struct udev_monitor *udev_monito
return NULL;
}
- udev_device = device_init(udev_monitor->udev);
+ udev_device = device_new(udev_monitor->udev);
if (udev_device == NULL) {
return NULL;
}
diff --git a/udev/lib/libudev-private.h b/udev/lib/libudev-private.h
index 8f847158b2..fd7f4551e7 100644
--- a/udev/lib/libudev-private.h
+++ b/udev/lib/libudev-private.h
@@ -24,27 +24,20 @@
#include "libudev.h"
static inline void __attribute__ ((format(printf, 2, 3)))
-log_null(struct udev *udev, const char *format, ...)
-{
-}
+log_null(struct udev *udev, const char *format, ...) {}
#ifdef USE_LOG
-#ifdef USE_DEBUG
-#define dbg(udev, arg...) \
- udev_log(udev, LOG_DEBUG, __FILE__, __LINE__, __FUNCTION__, ## arg)
+# ifdef USE_DEBUG
+# define dbg(udev, arg...) udev_log(udev, LOG_DEBUG, __FILE__, __LINE__, __FUNCTION__, ## arg)
+# else
+# define dbg log_null
+# endif
+# define info(udev, arg...) udev_log(udev, LOG_INFO, __FILE__, __LINE__, __FUNCTION__, ## arg)
+# define err(udev, arg...) udev_log(udev, LOG_ERR, __FILE__, __LINE__, __FUNCTION__, ## arg)
#else
-#define dbg log_null
-#endif /* USE_DEBUG */
-
-#define info(udev, arg...) \
- udev_log(udev, LOG_INFO, __FILE__, __LINE__, __FUNCTION__, ## arg)
-
-#define err(udev, arg...) \
- udev_log(udev, LOG_ERR, __FILE__, __LINE__, __FUNCTION__, ## arg)
-#else
-#define dbg log_null
-#define info log_null
-#define err log_null
+# define dbg log_null
+# define info log_null
+# define err log_null
#endif
/* libudev */
@@ -52,7 +45,7 @@ void udev_log(struct udev *udev,
int priority, const char *file, int line, const char *fn,
const char *format, ...)
__attribute__ ((format(printf, 6, 7)));
-extern struct udev_device *device_init(struct udev *udev);
+extern struct udev_device *device_new(struct udev *udev);
extern const char *udev_get_rules_path(struct udev *udev);
extern int udev_get_run(struct udev *udev);