]> Git Repo - linux.git/commitdiff
firmware: hardcode the debug message for -ENOENT
authorJohn Zhao <[email protected]>
Wed, 20 Feb 2019 02:39:04 +0000 (10:39 +0800)
committerGreg Kroah-Hartman <[email protected]>
Tue, 26 Feb 2019 10:59:43 +0000 (11:59 +0100)
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 <[email protected]>
Acked-by: Luis Chamberlain <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
drivers/base/firmware_loader/main.c

index 8e9213b36e31371aed574de0252366f171e6104f..7eaaf5ee5ba6ba618ab4114aec1a0be296722f1f 100644 (file)
@@ -328,12 +328,12 @@ fw_get_filesystem_firmware(struct device *device, struct fw_priv *fw_priv)
                rc = kernel_read_file_from_path(path, &fw_priv->data, &size,
                                                msize, id);
                if (rc) {
-                       if (rc == -ENOENT)
-                               dev_dbg(device, "loading %s failed with error %d\n",
-                                        path, rc);
-                       else
+                       if (rc != -ENOENT)
                                dev_warn(device, "loading %s failed with error %d\n",
                                         path, rc);
+                       else
+                               dev_dbg(device, "loading %s failed for no such file or directory.\n",
+                                        path);
                        continue;
                }
                dev_dbg(device, "direct-loading %s\n", fw_priv->fw_name);
This page took 0.054051 seconds and 4 git commands to generate.