From: Marcel Holtmann <marcel@holtmann.org>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: Andrew Morton <akpm@osdl.org>
Subject: [PATCH] Use add_hotplug_env_var() in firmware loader
Date: Thu, 04 Nov 2004 06:59:07 +0100 [thread overview]
Message-ID: <1099547947.7022.3.camel@pegasus> (raw)
[-- 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;
}
reply other threads:[~2004-11-04 5:59 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1099547947.7022.3.camel@pegasus \
--to=marcel@holtmann.org \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox