display: Fix EOPNOTSUPP to ENOSYS 32/313332/1
authorYoungjae Cho <y0.cho@samsung.com>
Mon, 24 Jun 2024 06:04:42 +0000 (15:04 +0900)
committeryoungjae cho <y0.cho@samsung.com>
Mon, 24 Jun 2024 06:12:18 +0000 (06:12 +0000)
The error ENOTSUP and EOPNOTSUPP are both 95 so they cannot be
distinguished. Therefore, fixed the EOPNOTSUPP to ENOSYS.

 ENOSYS  38  Function not implemented

The deviced plugin-api has changed to return ENOSYS if there is
display plugin backend but it hasn't implemented an operation.

Change-Id: I838dd104fdc0cd7bb01f1567bfb51bfffe6c5139
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
src/display/display-backlight.c
src/display/display-config.c
src/display/display-dbus.c
src/display/display-panel.c
src/display/display-state-transition.c
src/display/display.c
src/display/setting.c

index 654e6c9961f16202d67d89811444b4c4be4f49a6..7051d121aba2ba81ed792dde6ec3a0aa3e52032a 100644 (file)
@@ -117,7 +117,7 @@ int display_backlight_set_brightness(int brightness)
        ret = syscommon_plugin_deviced_display_set_brightness(brightness);
        if (ret == -ENOTSUP) {
                _D("Take default operation as there is no found plugin backend");
-       } else if (ret == -EOPNOTSUPP) {
+       } else if (ret == -ENOSYS) {
                _D("Take default operation as there is no found plugin backend operation");
        } else if (ret < 0) {
                _E("Failed to plugin operation, ret=%d", ret);
@@ -162,7 +162,7 @@ int display_backlight_get_brightness(int *brightness)
        ret = syscommon_plugin_deviced_display_get_brightness(brightness);
        if (ret == -ENOTSUP) {
                _D("Take default operation as there is no found plugin backend");
-       } else if (ret == -EOPNOTSUPP) {
+       } else if (ret == -ENOSYS) {
                _D("Take default operation as there is no found plugin backend operation");
        } else if (ret < 0) {
                _E("Failed to plugin operation, ret=%d", ret);
@@ -204,7 +204,7 @@ void display_backlight_change_brightness(int start, int end, int step)
        ret = syscommon_plugin_deviced_display_set_brightness_smooth(start, end, step);
        if (ret == -ENOTSUP) {
                _D("Take default operation as there is no found plugin backend");
-       } else if (ret == -EOPNOTSUPP) {
+       } else if (ret == -ENOSYS) {
                _D("Take default operation as there is no found plugin backend operation");
        } else if (ret < 0) {
                _E("Failed to plugin operation, ret=%d", ret);
index 213b52c88109f18fdeb3bba40f7acea5dbc87861..18a98cab5d48b06b08129fa3ce4abab35e4da6f0 100644 (file)
@@ -111,7 +111,7 @@ int display_load_config(void)
        ret = syscommon_plugin_deviced_display_load_config(&g_display_config);
        if (ret == -ENOTSUP) {
                _D("Take default operation as there is no found plugin backend");
-       } else if (ret == -EOPNOTSUPP) {
+       } else if (ret == -ENOSYS) {
                _D("Take default operation as there is no found plugin backend operation");
        } else if (ret < 0) {
                _E("Failed to plugin operation, ret=%d", ret);
@@ -137,7 +137,7 @@ int display_config_get_timeout_enable(bool *timeout_enable)
                return 0;
        }
 
-       return -EOPNOTSUPP;
+       return -ENOSYS;
 }
 
 int display_config_get_lcdoff_timeout(int *lcdoff_timeout)
@@ -150,7 +150,7 @@ int display_config_get_lcdoff_timeout(int *lcdoff_timeout)
                return 0;
        }
 
-       return -EOPNOTSUPP;
+       return -ENOSYS;
 }
 
 int display_config_get_lcd_always_on(int *lcd_always_on)
@@ -163,7 +163,7 @@ int display_config_get_lcd_always_on(int *lcd_always_on)
                return 0;
        }
 
-       return -EOPNOTSUPP;
+       return -ENOSYS;
 }
 
 int display_config_get_dimming(int *dimming)
@@ -176,7 +176,7 @@ int display_config_get_dimming(int *dimming)
                return 0;
        }
 
-       return -EOPNOTSUPP;
+       return -ENOSYS;
 }
 
 int display_config_get_pm_default_brightness(int *pm_default_brightness)
@@ -185,7 +185,7 @@ int display_config_get_pm_default_brightness(int *pm_default_brightness)
                return -EINVAL;
 
        if (!g_display_config)
-               return -EOPNOTSUPP;
+               return -ENOSYS;
 
        *pm_default_brightness = g_display_config->pm_default_brightness;
 
index f93d91668a335715f15208b37c4ba5ce8bc6fa77..0bd9a7bc2630b77a05bd7bc3852f91c3aa9e9372 100644 (file)
@@ -505,7 +505,7 @@ static GVariant *dbus_setbrightness(GDBusConnection *conn,
        clear_pm_status_flag(DIM_MASK);
        if (state == DISPLAY_STATE_NORMAL) {
                ret = syscommon_plugin_deviced_display_control_auto_brightness(BR_SET_BRIGHTNESS, brt);
-               if (ret == -ENOTSUP || ret == -EOPNOTSUPP) {
+               if (ret == -ENOTSUP || ret == -ENOSYS) {
                        _D("Take default operation as there is no found plugin backend, ret=%d", ret);
                        display_backlight_set_default_brightness(brt);
                        ret = display_backlight_set_brightness(brt);
@@ -575,7 +575,7 @@ static GVariant *dbus_holdbrightness(GDBusConnection *conn,
                _E("Failed to set vconf value for custom brightness status: %d", vconf_get_ext_errno());
 
        ret = syscommon_plugin_deviced_display_control_auto_brightness(BR_HOLD_BRIGHTNESS, brt);
-       if (ret == -ENOTSUP || ret == -EOPNOTSUPP) {
+       if (ret == -ENOTSUP || ret == -ENOSYS) {
                _D("Take default operation as there is no found plugin backend, ret=%d", ret);
                ret = display_backlight_set_brightness(brt);
        }
@@ -661,7 +661,7 @@ static GVariant *dbus_releasebrightness(GDBusConnection *conn,
 
        if (autobrt == SETTING_BRIGHTNESS_AUTOMATIC_OFF) {
                ret = syscommon_plugin_deviced_display_control_auto_brightness(BR_RELEASE_BRIGHTNESS, BR_IMPLICIT);
-               if (ret == -ENOTSUP || ret == -EOPNOTSUPP) {
+               if (ret == -ENOTSUP || ret == -ENOSYS) {
                        if (brt != setting)
                                display_backlight_set_brightness(setting);
                }
index 603fc58ae7ce725704c9aebb1f16d5726494ae6a..194ed98998d82726468bcff109a403cbc56b2848 100644 (file)
@@ -240,7 +240,7 @@ void display_panel_lcd_on_procedure(int state, enum deviced_event reason)
        ret = syscommon_plugin_deviced_display_lcd_on_procedure(state, reason);
        if (ret == -ENOTSUP) {
                _D("Take default operation as there is no found plugin backend");
-       } else if (ret == -EOPNOTSUPP) {
+       } else if (ret == -ENOSYS) {
                _D("Take default operation as there is no found plugin backend operation");
        } else if (ret < 0) {
                _E("Failed to plugin operation, ret=%d", ret);
@@ -299,7 +299,7 @@ void display_panel_lcd_off_procedure(enum deviced_event reason)
        ret = syscommon_plugin_deviced_display_lcd_off_procedure(reason);
        if (ret == -ENOTSUP) {
                _D("Take default operation as there is no found plugin backend");
-       } else if (ret == -EOPNOTSUPP) {
+       } else if (ret == -ENOSYS) {
                _D("Take default operation as there is no found plugin backend operation");
        } else if (ret < 0) {
                _E("Failed to plugin operation, ret=%d", ret);
@@ -387,7 +387,7 @@ int display_panel_custom_lcd_on(int timeout)
        ret = syscommon_plugin_deviced_display_custom_lcd_on(timeout);
        if (ret == -ENOTSUP) {
                _D("Take default operation as there is no found plugin backend");
-       } else if (ret == -EOPNOTSUPP) {
+       } else if (ret == -ENOSYS) {
                _D("Take default operation as there is no found plugin backend operation");
        } else if (ret < 0) {
                _E("Failed to plugin operation, ret=%d", ret);
@@ -420,7 +420,7 @@ int display_panel_custom_lcd_off(enum deviced_event reason)
        ret = syscommon_plugin_deviced_display_custom_lcd_off(reason);
        if (ret == -ENOTSUP) {
                _D("Take default operation as there is no found plugin backend");
-       } else if (ret == -EOPNOTSUPP) {
+       } else if (ret == -ENOSYS) {
                _D("Take default operation as there is no found plugin backend operation");
        } else if (ret < 0) {
                _E("Failed to plugin operation, ret=%d", ret);
@@ -469,7 +469,7 @@ int display_panel_display_turn_on_by_reason(const char *reason, int timeout)
        ret = syscommon_plugin_deviced_display_on_by_reason(reason, timeout);
        if (ret == -ENOTSUP) {
                _D("Take default operation as there is no found plugin backend");
-       } else if (ret == -EOPNOTSUPP) {
+       } else if (ret == -ENOSYS) {
                _D("Take default operation as there is no found plugin backend operation");
        } else if (ret < 0) {
                _E("Failed to plugin operation, ret=%d", ret);
@@ -518,7 +518,7 @@ int display_panel_display_turn_off_by_reason(const char *reason)
        ret = syscommon_plugin_deviced_display_off_by_reason(reason);
        if (ret == -ENOTSUP) {
                _D("Take default operation as there is no found plugin backend");
-       } else if (ret == -EOPNOTSUPP) {
+       } else if (ret == -ENOSYS) {
                _D("Take default operation as there is no found plugin backend operation");
        } else if (ret < 0) {
                _E("Failed to plugin operation, ret=%d", ret);
index bd627f48ee4e615dd2ee688d09bf487005b72e4c..31443ec55058622c33199edcf919275bba8b0165 100644 (file)
@@ -888,7 +888,7 @@ int display_state_transition_do_proc_change_state(unsigned int cond, pid_t pid)
        ret = syscommon_plugin_deviced_display_proc_change_state(cond, pid);
        if (ret == -ENOTSUP) {
                _D("Take default operation as there is no found plugin backend");
-       } else if (ret == -EOPNOTSUPP) {
+       } else if (ret == -ENOSYS) {
                _D("Take default operation as there is no found plugin backend operation");
        } else if (ret < 0) {
                _E("Failed to plugin operation, ret=%d", ret);
@@ -976,7 +976,7 @@ int display_state_load_state_info(void)
        int ret;
 
        ret = syscommon_plugin_deviced_display_load_state_info(g_display_states);
-       if (ret == -ENOTSUP || ret == EOPNOTSUPP) {
+       if (ret == -ENOTSUP || ret == ENOSYS) {
                _D("Take default operation as there is no found plugin backend");
                for (int i = 0; i < SYSCOMMON_DEVICED_DISPLAY_STATE_END; ++i)
                        g_display_states[i] = default_states[i];
index 1cd4a682ece7aafd22cd8fcd722caceae11de8c2..7257472592df8ce701a3d11b98cc33b7e92269c0 100644 (file)
@@ -211,7 +211,7 @@ void display_set_power_save_mode_flag(int onoff)
        ret = syscommon_plugin_deviced_display_set_powersaving_mode(onoff);
        if (ret == -ENOTSUP) {
                _D("Take default operation as there is no found plugin backend");
-       } else if (ret == -EOPNOTSUPP) {
+       } else if (ret == -ENOSYS) {
                _D("Take default operation as there is no found plugin backend operation");
        } else if (ret < 0) {
                _E("Failed to plugin operation, ret=%d", ret);
index 2c4a9ff27c63e883d4db26229898fcb226aa2137..9c087ed83ff40a25f5ea045d6528613f572dde89 100644 (file)
@@ -289,7 +289,7 @@ int display_setting_update_pm_setting(int key_idx, int val)
        ret = syscommon_plugin_deviced_display_notify_setting_value_changed(key_idx, val);
        if (ret == -ENOTSUP) {
                _D("Take default operation as there is no found plugin backend");
-       } else if (ret == -EOPNOTSUPP) {
+       } else if (ret == -ENOSYS) {
                _D("Take default operation as there is no found plugin backend operation");
        } else if (ret < 0) {
                _E("Failed to plugin operation, ret=%d", ret);