diff options
author | Luis R. Rodriguez <mcgrof@kernel.org> | 2018-05-10 16:08:44 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-05-14 10:43:10 -0400 |
commit | 27d5d7dc9aafd6db3d7aeb49cdbfe578fc1b8663 (patch) | |
tree | d2d8eb38d5528decf4301a7c97f125198deb6829 /drivers/base/firmware_loader/fallback.c | |
parent | 06bfd3c8ab1dbf0031022d056a90ace682f6a94c (diff) |
firmware_loader: make firmware_fallback_sysfs() print more useful
If we resort to using the sysfs fallback mechanism we don't print
the filename. This can be deceiving given we could have a series of
callers intertwined and it'd be unclear exactly for what firmware
this was meant for.
Additionally, although we don't currently use FW_OPT_NO_WARN when
dealing with the fallback mechanism, we will soon, so just respect
its use consistently.
And even if you *don't* want to print always on failure, you may
want to print when debugging so enable dynamic debug print when
FW_OPT_NO_WARN is used.
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/firmware_loader/fallback.c')
-rw-r--r-- | drivers/base/firmware_loader/fallback.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/base/firmware_loader/fallback.c b/drivers/base/firmware_loader/fallback.c index 9169e7b9800c..b676a99c469c 100644 --- a/drivers/base/firmware_loader/fallback.c +++ b/drivers/base/firmware_loader/fallback.c | |||
@@ -690,6 +690,11 @@ int firmware_fallback_sysfs(struct firmware *fw, const char *name, | |||
690 | if (!fw_run_sysfs_fallback(opt_flags)) | 690 | if (!fw_run_sysfs_fallback(opt_flags)) |
691 | return ret; | 691 | return ret; |
692 | 692 | ||
693 | dev_warn(device, "Falling back to user helper\n"); | 693 | if (!(opt_flags & FW_OPT_NO_WARN)) |
694 | dev_warn(device, "Falling back to syfs fallback for: %s\n", | ||
695 | name); | ||
696 | else | ||
697 | dev_dbg(device, "Falling back to sysfs fallback for: %s\n", | ||
698 | name); | ||
694 | return fw_load_from_user_helper(fw, name, device, opt_flags); | 699 | return fw_load_from_user_helper(fw, name, device, opt_flags); |
695 | } | 700 | } |