Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

firmware: hardcode the debug message for -ENOENT

When no file /path was found, the error code of -ENOENT
enumerated in errno-base.h, is returned. Stating clearly that
the file was not found is much more useful for debugging, So
let's be explicit about that.

Signed-off-by: John Zhao <yuankuiz@codeaurora.org>
Acked-by: Luis Chamberlain <mcgrof@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

John Zhao and committed by
Greg Kroah-Hartman
eac473bc a7013ba5

+4 -4
+4 -4
drivers/base/firmware_loader/main.c
··· 328 328 rc = kernel_read_file_from_path(path, &fw_priv->data, &size, 329 329 msize, id); 330 330 if (rc) { 331 - if (rc == -ENOENT) 332 - dev_dbg(device, "loading %s failed with error %d\n", 333 - path, rc); 334 - else 331 + if (rc != -ENOENT) 335 332 dev_warn(device, "loading %s failed with error %d\n", 336 333 path, rc); 334 + else 335 + dev_dbg(device, "loading %s failed for no such file or directory.\n", 336 + path); 337 337 continue; 338 338 } 339 339 dev_dbg(device, "direct-loading %s\n", fw_priv->fw_name);