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, ...@@ -94,19 +94,17 @@ firmware_class_hotplug(struct class_device *class_dev, char **envp,
int num_envp, char *buffer, int buffer_size) int num_envp, char *buffer, int buffer_size)
{ {
struct firmware_priv *fw_priv = class_get_devdata(class_dev); struct firmware_priv *fw_priv = class_get_devdata(class_dev);
int i = 0; int i = 0, len = 0;
char *scratch = buffer;
if (!test_bit(FW_STATUS_READY, &fw_priv->status)) if (!test_bit(FW_STATUS_READY, &fw_priv->status))
return -ENODEV; return -ENODEV;
if (buffer_size < (FIRMWARE_NAME_MAX + 10)) if (add_hotplug_env_var(envp, num_envp, &i, buffer, buffer_size, &len,
return -ENOMEM; "FIRMWARE=%s", fw_priv->fw_id))
if (num_envp < 1)
return -ENOMEM; return -ENOMEM;
envp[i++] = scratch; envp[i++] = NULL;
scratch += sprintf(scratch, "FIRMWARE=%s", fw_priv->fw_id) + 1;
return 0; 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