core: device-notifier: Remove wrong error handling code
authorChanwoo Choi <cw00.choi@samsung.com>
Thu, 2 Feb 2017 04:56:55 +0000 (13:56 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Thu, 2 Feb 2017 23:43:19 +0000 (08:43 +0900)
The previous register_notifier() checks whether the function pointer
of callback is already registered or not. But it is wrong because
the different receivers are able to use the same callback function
with the different own user_data.

Change-Id: If9f4a80e91c48f7964f05009dc6ee7098d72f9cb
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
src/core/device-notifier.c

index 79938dbcb1c6631c412f33aff9cf1ac65a4f4606..dd88ffe1d9cb706504b0b3961409e66c7686c6be 100644 (file)
@@ -39,7 +39,6 @@ static Ecore_Idler *idl;
 int register_notifier(enum device_notifier_type status,
                int (*func)(void *data, void *user_data), void *user_data)
 {
-       dd_list *n;
        struct device_notifier *notifier;
 
        if (!func) {
@@ -47,12 +46,6 @@ int register_notifier(enum device_notifier_type status,
                return -EINVAL;
        }
 
-       FIND_NOTIFIER(device_notifier_list, n, notifier, status, func) {
-               _E("function is already registered! [%d, %x]",
-                   status, func);
-               return -EINVAL;
-       }
-
        notifier = calloc(1, sizeof(struct device_notifier));
        if (!notifier) {
                _E("Fail to malloc for notifier!");