summaryrefslogtreecommitdiffstats
path: root/kernel/drivers/base/firmware_class.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/drivers/base/firmware_class.c')
-rw-r--r--kernel/drivers/base/firmware_class.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/kernel/drivers/base/firmware_class.c b/kernel/drivers/base/firmware_class.c
index 171841ad1..4d1d9de4f 100644
--- a/kernel/drivers/base/firmware_class.c
+++ b/kernel/drivers/base/firmware_class.c
@@ -544,10 +544,8 @@ static void fw_dev_release(struct device *dev)
kfree(fw_priv);
}
-static int firmware_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int do_firmware_uevent(struct firmware_priv *fw_priv, struct kobj_uevent_env *env)
{
- struct firmware_priv *fw_priv = to_firmware_priv(dev);
-
if (add_uevent_var(env, "FIRMWARE=%s", fw_priv->buf->fw_id))
return -ENOMEM;
if (add_uevent_var(env, "TIMEOUT=%i", loading_timeout))
@@ -558,6 +556,18 @@ static int firmware_uevent(struct device *dev, struct kobj_uevent_env *env)
return 0;
}
+static int firmware_uevent(struct device *dev, struct kobj_uevent_env *env)
+{
+ struct firmware_priv *fw_priv = to_firmware_priv(dev);
+ int err = 0;
+
+ mutex_lock(&fw_lock);
+ if (fw_priv->buf)
+ err = do_firmware_uevent(fw_priv, env);
+ mutex_unlock(&fw_lock);
+ return err;
+}
+
static struct class firmware_class = {
.name = "firmware",
.class_attrs = firmware_class_attrs,