firmware: Rename FW_OPT_NOFALLBACK to FW_OPT_NOFALLBACK_SYSFS
authorHans de Goede <hdegoede@redhat.com>
Wed, 15 Jan 2020 16:35:47 +0000 (17:35 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 24 Jan 2020 08:56:58 +0000 (09:56 +0100)
This is a preparation patch for adding a new platform fallback mechanism,
which will have its own enable/disable FW_OPT_xxx option.

Note this also fixes a typo in one of the re-wordwrapped comments:
enfoce -> enforce.

Acked-by: Luis Chamberlain <mcgrof@kernel.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20200115163554.101315-4-hdegoede@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/firmware_loader/fallback.c
drivers/base/firmware_loader/firmware.h
drivers/base/firmware_loader/main.c

index 62ee90b..8704e1b 100644 (file)
@@ -606,7 +606,7 @@ static bool fw_run_sysfs_fallback(enum fw_opt opt_flags)
                return false;
        }
 
-       if ((opt_flags & FW_OPT_NOFALLBACK))
+       if ((opt_flags & FW_OPT_NOFALLBACK_SYSFS))
                return false;
 
        /* Also permit LSMs and IMA to fail firmware sysfs fallback */
@@ -630,10 +630,11 @@ static bool fw_run_sysfs_fallback(enum fw_opt opt_flags)
  * interface. Userspace is in charge of loading the firmware through the sysfs
  * loading interface. This sysfs fallback mechanism may be disabled completely
  * on a system by setting the proc sysctl value ignore_sysfs_fallback to true.
- * If this false we check if the internal API caller set the @FW_OPT_NOFALLBACK
- * flag, if so it would also disable the fallback mechanism. A system may want
- * to enfoce the sysfs fallback mechanism at all times, it can do this by
- * setting ignore_sysfs_fallback to false and force_sysfs_fallback to true.
+ * If this is false we check if the internal API caller set the
+ * @FW_OPT_NOFALLBACK_SYSFS flag, if so it would also disable the fallback
+ * mechanism. A system may want to enforce the sysfs fallback mechanism at all
+ * times, it can do this by setting ignore_sysfs_fallback to false and
+ * force_sysfs_fallback to true.
  * Enabling force_sysfs_fallback is functionally equivalent to build a kernel
  * with CONFIG_FW_LOADER_USER_HELPER_FALLBACK.
  **/
index 7ecd590..8656e52 100644 (file)
  *     firmware file lookup on storage is avoided. Used for calls where the
  *     file may be too big, or where the driver takes charge of its own
  *     firmware caching mechanism.
- * @FW_OPT_NOFALLBACK: Disable the fallback mechanism. Takes precedence over
- *     &FW_OPT_UEVENT and &FW_OPT_USERHELPER.
+ * @FW_OPT_NOFALLBACK_SYSFS: Disable the sysfs fallback mechanism. Takes
+ *     precedence over &FW_OPT_UEVENT and &FW_OPT_USERHELPER.
  */
 enum fw_opt {
-       FW_OPT_UEVENT =         BIT(0),
-       FW_OPT_NOWAIT =         BIT(1),
-       FW_OPT_USERHELPER =     BIT(2),
-       FW_OPT_NO_WARN =        BIT(3),
-       FW_OPT_NOCACHE =        BIT(4),
-       FW_OPT_NOFALLBACK =     BIT(5),
+       FW_OPT_UEVENT                   = BIT(0),
+       FW_OPT_NOWAIT                   = BIT(1),
+       FW_OPT_USERHELPER               = BIT(2),
+       FW_OPT_NO_WARN                  = BIT(3),
+       FW_OPT_NOCACHE                  = BIT(4),
+       FW_OPT_NOFALLBACK_SYSFS         = BIT(5),
 };
 
 enum fw_status {
index 249add8..57133a9 100644 (file)
@@ -877,7 +877,7 @@ int request_firmware_direct(const struct firmware **firmware_p,
        __module_get(THIS_MODULE);
        ret = _request_firmware(firmware_p, name, device, NULL, 0,
                                FW_OPT_UEVENT | FW_OPT_NO_WARN |
-                               FW_OPT_NOFALLBACK);
+                               FW_OPT_NOFALLBACK_SYSFS);
        module_put(THIS_MODULE);
        return ret;
 }