Add initialize constructor for backlight init. 62/241062/1 accepted/tizen/unified/20200817.134623 submit/tizen/20200814.095001
authorYunmi Ha <yunmi.ha@samsung.com>
Fri, 14 Aug 2020 07:33:47 +0000 (16:33 +0900)
committerYunmi Ha <yunmi.ha@samsung.com>
Fri, 14 Aug 2020 07:33:47 +0000 (16:33 +0900)
Change-Id: I592367573b0550d6841b1440ba7e2ea47849471f
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
plugins/iot/display/core.c
src/display/auto-brightness.c

index 2ed514c..ba2fb8a 100644 (file)
@@ -2291,11 +2291,6 @@ static void display_init(void *data)
                        if (display_conf.timeout_enable)
                                get_lcd_timeout_from_settings();
                        ret = init_sysfs(flags);
-                       backlight_ops = get_backlight_ops();
-                       if (!backlight_ops) {
-                               _E("Failed to get backlight operator.");
-                               ret = -1;
-                       }
                        break;
                case INIT_POLL:
                        _I("input init");
index fe8fb16..1afc48d 100644 (file)
@@ -657,10 +657,6 @@ static void exit_lsensor(void)
 
 static void auto_brightness_init(void *data)
 {
-       backlight_ops = get_backlight_ops();
-       if (!backlight_ops)
-               _E("Failed to get backlight operator.");
-
        display_info.update_auto_brightness = update_auto_brightness;
        display_info.set_autobrightness_min = set_autobrightness_min;
        display_info.reset_autobrightness_min = reset_autobrightness_min;
@@ -685,3 +681,9 @@ static const struct display_ops display_autobrightness_ops = {
 
 DISPLAY_OPS_REGISTER(&display_autobrightness_ops)
 
+static void __CONSTRUCTOR__ initialize(void)
+{
+       backlight_ops = get_backlight_ops();
+       if (!backlight_ops)
+               _E("Failed to get backlight operator.");
+}