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

Commit 609d8828 authored by Benoit Goby's avatar Benoit Goby
Browse files

init: Abort firmware transfer if firmware is missing



If firmware is not found, write -1 /sys/$DEVPATH/loading to cancel the
firmware load. Otherwise the driver has to wait for the 60s timeout.

Change-Id: Id2787cda9b2be45b9adea41f6f161cd54cda212e
Signed-off-by: default avatarBenoit Goby <benoit@android.com>
parent 16ae478a
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -589,9 +589,11 @@ static void process_firmware_event(struct uevent *uevent)
    fw_fd = open(file1, O_RDONLY);
    if(fw_fd < 0) {
        fw_fd = open(file2, O_RDONLY);
        if(fw_fd < 0)
        if (fw_fd < 0) {
            write(loading_fd, "-1", 2);
            goto data_close_out;
        }
    }

    if(!load_firmware(fw_fd, loading_fd, data_fd))
        log_event_print("firmware copy success { '%s', '%s' }\n", root, uevent->firmware);