summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjy910.yun <jy910.yun@samsung.com>2014-11-05 21:42:00 +0900
committerjy910.yun <jy910.yun@samsung.com>2014-11-06 21:55:21 +0900
commitdab55ee02cbae6318ff69494a4977adae8c6d245 (patch)
treec13e5a8593663e0394eeba6aa0e529a371b24096
parent25f730f660c4193863d2c7c3304e6b4ada048c36 (diff)
downloadlibdevice-node-dab55ee02cbae6318ff69494a4977adae8c6d245.tar.gz
libdevice-node-dab55ee02cbae6318ff69494a4977adae8c6d245.tar.bz2
libdevice-node-dab55ee02cbae6318ff69494a4977adae8c6d245.zip
device-node: Rename the logging macros
Change DEVERR/DEVLOG macros to _E/_D macros Signed-off-by: jy910.yun <jy910.yun@samsung.com> Change-Id: Idd4593e6b271addfb2f0ee8a091223b0267161cf
-rw-r--r--devices/display.c8
-rw-r--r--include/device-internal.h10
-rw-r--r--src/device-node.c26
3 files changed, 23 insertions, 21 deletions
diff --git a/devices/display.c b/devices/display.c
index 0be1cbe..2900699 100644
--- a/devices/display.c
+++ b/devices/display.c
@@ -36,13 +36,13 @@ static int display_get_prop(int __prop, int *val)
r = PLUGIN_GET(display_count)(&disp_cnt);
if (r < 0) {
- DEVERR("Get display count failed");
+ _E("Get display count failed");
return -1;
}
if (prop != PROP_DISPLAY_BRIGHTNESS_BY_LUX) {
if (index >= disp_cnt) {
- DEVERR("Invalid Argument: index(%d) > max(%d)", index, disp_cnt);
+ _E("Invalid Argument: index(%d) > max(%d)", index, disp_cnt);
return -1;
}
}
@@ -91,12 +91,12 @@ static int display_set_prop(int __prop, int val)
r = PLUGIN_GET(display_count)(&disp_cnt);
if (r < 0) {
- DEVERR("Get display count failed");
+ _E("Get display count failed");
return -1;
}
if (index >= disp_cnt) {
- DEVERR("Invalid Argument: index(%d) > max(%d)", index, disp_cnt);
+ _E("Invalid Argument: index(%d) > max(%d)", index, disp_cnt);
return -1;
}
diff --git a/include/device-internal.h b/include/device-internal.h
index 7e3dbb7..e4e84ff 100644
--- a/include/device-internal.h
+++ b/include/device-internal.h
@@ -33,11 +33,13 @@
#ifdef FEATURE_DEVICE_NODE_DLOG
#define LOG_TAG "DEVICE_NODE"
#include <dlog.h>
-#define DEVLOG(fmt, args...) SLOGD(fmt, ##args)
-#define DEVERR(fmt, args...) SLOGE(fmt, ##args)
+#define _I(fmt, args...) SLOGI(fmt, ##args)
+#define _D(fmt, args...) SLOGD(fmt, ##args)
+#define _E(fmt, args...) SLOGE(fmt, ##args)
#else
-#define DEVLOG(x, ...) do { } while (0)
-#define DEVERR(x, ...) do { } while (0)
+#define _I(x, ...) do { } while (0)
+#define _D(x, ...) do { } while (0)
+#define _E(x, ...) do { } while (0)
#endif
#define DEVMAN_PLUGIN_PATH "/usr/lib/libslp_devman_plugin.so"
diff --git a/src/device-node.c b/src/device-node.c
index 4612778..52c74fb 100644
--- a/src/device-node.c
+++ b/src/device-node.c
@@ -63,31 +63,31 @@ API int device_get_property(enum device_type devtype, int property, int *value)
type = find_device(devtype);
if (type == NULL) {
- DEVERR("devtype cannot find");
+ _E("devtype cannot find");
errno = EPERM;
return -1;
}
dev = container_of(type, struct device, type);
if (dev == NULL) {
- DEVERR("device cannot find");
+ _E("device cannot find");
errno = EPERM;
return -1;
}
if (dev->get_prop == NULL) {
- DEVERR("devtype doesn't have getter function");
+ _E("devtype doesn't have getter function");
errno = EPERM;
return -1;
}
r = dev->get_prop(property, value);
if (r == -ENODEV) {
- DEVERR("Not support driver");
+ _E("Not support driver");
errno = ENODEV;
return -1;
} else if (r == -1) {
- DEVERR("get_prop of %s(%d) return failes", dev->name, property);
+ _E("get_prop of %s(%d) return failes", dev->name, property);
errno = EPERM;
return -1;
}
@@ -104,31 +104,31 @@ API int device_set_property(enum device_type devtype, int property, int value)
type = find_device(devtype);
if (type == NULL) {
- DEVERR("devtype cannot find");
+ _E("devtype cannot find");
errno = EPERM;
return -1;
}
dev = container_of(type, struct device, type);
if (dev == NULL) {
- DEVERR("device cannot find");
+ _E("device cannot find");
errno = EPERM;
return -1;
}
if (dev->set_prop == NULL) {
- DEVERR("devtype doesn't have setter function");
+ _E("devtype doesn't have setter function");
errno = EPERM;
return -1;
}
r = dev->set_prop(property, value);
if (r == -ENODEV) {
- DEVERR("Not support driver");
+ _E("Not support driver");
errno = ENODEV;
return -1;
} else if (r == -1) {
- DEVERR("set_prop of %s(%d) return failes", dev->name, property);
+ _E("set_prop of %s(%d) return failes", dev->name, property);
errno = EPERM;
return -1;
}
@@ -144,19 +144,19 @@ static void __CONSTRUCTOR__ module_init(void)
dlopen_handle = dlopen(DEVMAN_PLUGIN_PATH, RTLD_NOW);
if (!dlopen_handle) {
- DEVERR("dlopen() failed");
+ _E("dlopen() failed");
goto ERROR;
}
OEM_sys_get_devman_plugin_interface = dlsym(dlopen_handle, "OEM_sys_get_devman_plugin_interface");
if ((error = dlerror()) != NULL) {
- DEVERR("dlsym() failed: %s", error);
+ _E("dlsym() failed: %s", error);
goto ERROR;
}
plugin_intf = OEM_sys_get_devman_plugin_interface();
if (!plugin_intf) {
- DEVERR("get_devman_plugin_interface() failed");
+ _E("get_devman_plugin_interface() failed");
goto ERROR;
}