public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Use add_hotplug_env_var() in firmware loader
@ 2004-11-04  5:59 Marcel Holtmann
  0 siblings, 0 replies; only message in thread
From: Marcel Holtmann @ 2004-11-04  5:59 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: Andrew Morton

[-- Attachment #1: Type: text/plain, Size: 145 bytes --]

The add_hotplug_env_var() function is available and so use it in the
firmware class code.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>


[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 812 bytes --]

===== drivers/base/firmware_class.c 1.23 vs edited =====
--- 1.23/drivers/base/firmware_class.c	2004-10-28 09:39:58 +02:00
+++ edited/drivers/base/firmware_class.c	2004-11-02 06:47:50 +01:00
@@ -94,19 +94,17 @@
 		       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;
 }
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-11-04  5:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-04  5:59 [PATCH] Use add_hotplug_env_var() in firmware loader Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox