Commit 27ec38fd authored by Marcel Holtmann's avatar Marcel Holtmann Committed by Linus Torvalds

[PATCH] Use add_hotplug_env_var() in firmware loader

The add_hotplug_env_var() function is available and so use it in the
firmware class code.
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 5b62f404
......@@ -94,19 +94,17 @@ firmware_class_hotplug(struct class_device *class_dev, char **envp,
int num_envp, char *buffer, int buffer_size)
{
struct firmware_priv *fw_priv = class_get_devdata(class_dev);
int i = 0;
char *scratch = buffer;
int i = 0, len = 0;
if (!test_bit(FW_STATUS_READY, &fw_priv->status))
return -ENODEV;
if (buffer_size < (FIRMWARE_NAME_MAX + 10))
return -ENOMEM;
if (num_envp < 1)
if (add_hotplug_env_var(envp, num_envp, &i, buffer, buffer_size, &len,
"FIRMWARE=%s", fw_priv->fw_id))
return -ENOMEM;
envp[i++] = scratch;
scratch += sprintf(scratch, "FIRMWARE=%s", fw_priv->fw_id) + 1;
envp[i++] = NULL;
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment