backlight: Avoid error when state restore is disabled

When the state restore is disabled, we would print:
"Unknown verb: load" instead of simply skipping loading the
state.

(cherry picked from commit b76388e123)
This commit is contained in:
Michael Biebl
2014-09-11 00:57:55 +02:00
parent 4242ef948f
commit 1b0413ff4f
+4 -1
View File
@@ -372,9 +372,12 @@ int main(int argc, char *argv[]) {
* device probing should be complete), so that the validity
* check at boot time doesn't have to be reliable. */
if (streq(argv[1], "load") && shall_restore_state()) {
if (streq(argv[1], "load")) {
_cleanup_free_ char *value = NULL;
if (!shall_restore_state())
return EXIT_SUCCESS;
if (!validate_device(udev, device))
return EXIT_SUCCESS;