Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 74b61ddd authored by MarcKe's avatar MarcKe
Browse files

healthd: remove useless gotos in set_backlight_on

Change-Id: Id2a254eade02a10da699a8293ae988e9ee53be80
parent e978018e
Loading
Loading
Loading
Loading
+3 −7
Original line number Diff line number Diff line
@@ -238,7 +238,6 @@ static int set_tricolor_led(int on, int color)

            if (write(fd, buffer, strlen(buffer)) < 0)
                LOGE("Could not write to led node\n");
            if (fd >= 0)
            close(fd);
        }
    }
@@ -282,16 +281,13 @@ static int set_backlight_on(void)
    fd = open(BACKLIGHT_PATH, O_RDWR);
    if (fd < 0) {
        LOGE("Could not open backlight node : %s\n", strerror(errno));
        goto cleanup;
        return 0;
    }
    LOGV("Enabling backlight\n");
    snprintf(buffer, sizeof(buffer), "%d\n", BACKLIGHT_ON_LEVEL);
    if (write(fd, buffer,strlen(buffer)) < 0) {
        LOGE("Could not write to backlight node : %s\n", strerror(errno));
        goto cleanup;
    }
cleanup:
    if (fd >= 0)
    close(fd);

    return 0;