[PATCH v6 3/6] firmware: rename fw_load_from_user_helper() and _request_firmware_load()

From: Daniel Wagner
Date: Thu Oct 20 2016 - 05:54:18 EST


From: Daniel Wagner <daniel.wagner@xxxxxxxxxxxx>

fw_load_from_user_helper() and _request_firmware_load() are used when
CONFIG_FW_LOADER_USER_HELPER is enabled. In order to clearly mark which
part of the code is depending on UMH we stream line these functions to
match with the rest of the code.

Suggested by Luis.

Signed-off-by: Daniel Wagner <daniel.wagner@xxxxxxxxxxxx>
Acked-by: Luis R. Rodriguez <mcgrof@xxxxxxxxxx>
Cc: Ming Lei <ming.lei@xxxxxxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
drivers/base/firmware_class.c | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index b7a9fa1c5197..a6916a7aaeb2 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -986,9 +986,8 @@ fw_create_instance(struct firmware *firmware, const char *fw_name,
return fw_priv;
}

-/* load a firmware via user helper */
-static int _request_firmware_load(struct firmware_priv *fw_priv,
- unsigned int opt_flags, long timeout)
+static int _request_firmware_umh(struct firmware_priv *fw_priv,
+ unsigned int opt_flags, long timeout)
{
int retval = 0;
struct device *f_dev = &fw_priv->dev;
@@ -1039,9 +1038,9 @@ static int _request_firmware_load(struct firmware_priv *fw_priv,
return retval;
}

-static int fw_load_from_user_helper(struct firmware *firmware,
- const char *name, struct device *device,
- unsigned int opt_flags, long timeout)
+static int fw_get_umh_firmware(struct firmware *firmware, const char *name,
+ struct device *device, unsigned int opt_flags,
+ long timeout)
{
struct firmware_priv *fw_priv;
int ret;
@@ -1070,7 +1069,7 @@ static int fw_load_from_user_helper(struct firmware *firmware,
}

fw_priv->buf = firmware->priv;
- ret = _request_firmware_load(fw_priv, opt_flags, timeout);
+ ret = _request_firmware_umh(fw_priv, opt_flags, timeout);

release_lock:
usermodehelper_read_unlock();
@@ -1096,9 +1095,9 @@ static void kill_requests_without_uevent(void)

#else /* CONFIG_FW_LOADER_USER_HELPER */
static inline int
-fw_load_from_user_helper(struct firmware *firmware, const char *name,
- struct device *device, unsigned int opt_flags,
- long timeout)
+fw_get_umh_firmware(struct firmware *firmware, const char *name,
+ struct device *device, unsigned int opt_flags,
+ long timeout)
{
return -ENOENT;
}
@@ -1242,8 +1241,8 @@ _request_firmware(const struct firmware **firmware_p, const char *name,
name, ret);
if (opt_flags & FW_OPT_USERHELPER) {
dev_warn(device, "Falling back to user helper\n");
- ret = fw_load_from_user_helper(fw, name, device,
- opt_flags, timeout);
+ ret = fw_get_umh_firmware(fw, name, device,
+ opt_flags, timeout);
}
}

--
2.7.4