diff options
| -rw-r--r-- | drivers/base/firmware_class.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c index 9c4288362a8e..894bda114224 100644 --- a/drivers/base/firmware_class.c +++ b/drivers/base/firmware_class.c | |||
| @@ -563,10 +563,8 @@ static void fw_dev_release(struct device *dev) | |||
| 563 | kfree(fw_priv); | 563 | kfree(fw_priv); |
| 564 | } | 564 | } |
| 565 | 565 | ||
| 566 | static int firmware_uevent(struct device *dev, struct kobj_uevent_env *env) | 566 | static int do_firmware_uevent(struct firmware_priv *fw_priv, struct kobj_uevent_env *env) |
| 567 | { | 567 | { |
| 568 | struct firmware_priv *fw_priv = to_firmware_priv(dev); | ||
| 569 | |||
| 570 | if (add_uevent_var(env, "FIRMWARE=%s", fw_priv->buf->fw_id)) | 568 | if (add_uevent_var(env, "FIRMWARE=%s", fw_priv->buf->fw_id)) |
| 571 | return -ENOMEM; | 569 | return -ENOMEM; |
| 572 | if (add_uevent_var(env, "TIMEOUT=%i", loading_timeout)) | 570 | if (add_uevent_var(env, "TIMEOUT=%i", loading_timeout)) |
| @@ -577,6 +575,18 @@ static int firmware_uevent(struct device *dev, struct kobj_uevent_env *env) | |||
| 577 | return 0; | 575 | return 0; |
| 578 | } | 576 | } |
| 579 | 577 | ||
| 578 | static int firmware_uevent(struct device *dev, struct kobj_uevent_env *env) | ||
| 579 | { | ||
| 580 | struct firmware_priv *fw_priv = to_firmware_priv(dev); | ||
| 581 | int err = 0; | ||
| 582 | |||
| 583 | mutex_lock(&fw_lock); | ||
| 584 | if (fw_priv->buf) | ||
| 585 | err = do_firmware_uevent(fw_priv, env); | ||
| 586 | mutex_unlock(&fw_lock); | ||
| 587 | return err; | ||
| 588 | } | ||
| 589 | |||
| 580 | static struct class firmware_class = { | 590 | static struct class firmware_class = { |
| 581 | .name = "firmware", | 591 | .name = "firmware", |
| 582 | .class_attrs = firmware_class_attrs, | 592 | .class_attrs = firmware_class_attrs, |
