Commit bdc4960a authored by Cornelia Huck's avatar Cornelia Huck Committed by Greg Kroah-Hartman

Driver core: switch firmware_class to uevent_suppress.

Use uevent_suppress instead of returning an error code in
firmware_uevent(). Get rid of the now unneeded FW_STATUS_READY
and FW_STATUS_READY_NOHOTPLUG.
Signed-off-by: default avatarCornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 83b5fb4c
...@@ -31,8 +31,6 @@ enum { ...@@ -31,8 +31,6 @@ enum {
FW_STATUS_LOADING, FW_STATUS_LOADING,
FW_STATUS_DONE, FW_STATUS_DONE,
FW_STATUS_ABORT, FW_STATUS_ABORT,
FW_STATUS_READY,
FW_STATUS_READY_NOHOTPLUG,
}; };
static int loading_timeout = 60; /* In seconds */ static int loading_timeout = 60; /* In seconds */
...@@ -96,9 +94,6 @@ static int firmware_uevent(struct device *dev, char **envp, int num_envp, ...@@ -96,9 +94,6 @@ static int firmware_uevent(struct device *dev, char **envp, int num_envp,
struct firmware_priv *fw_priv = dev_get_drvdata(dev); struct firmware_priv *fw_priv = dev_get_drvdata(dev);
int i = 0, len = 0; int i = 0, len = 0;
if (!test_bit(FW_STATUS_READY, &fw_priv->status))
return -ENODEV;
if (add_uevent_var(envp, num_envp, &i, buffer, buffer_size, &len, if (add_uevent_var(envp, num_envp, &i, buffer, buffer_size, &len,
"FIRMWARE=%s", fw_priv->fw_id)) "FIRMWARE=%s", fw_priv->fw_id))
return -ENOMEM; return -ENOMEM;
...@@ -333,6 +328,7 @@ static int fw_register_device(struct device **dev_p, const char *fw_name, ...@@ -333,6 +328,7 @@ static int fw_register_device(struct device **dev_p, const char *fw_name,
f_dev->parent = device; f_dev->parent = device;
f_dev->class = &firmware_class; f_dev->class = &firmware_class;
dev_set_drvdata(f_dev, fw_priv); dev_set_drvdata(f_dev, fw_priv);
f_dev->uevent_suppress = 1;
retval = device_register(f_dev); retval = device_register(f_dev);
if (retval) { if (retval) {
printk(KERN_ERR "%s: device_register failed\n", printk(KERN_ERR "%s: device_register failed\n",
...@@ -382,9 +378,7 @@ static int fw_setup_device(struct firmware *fw, struct device **dev_p, ...@@ -382,9 +378,7 @@ static int fw_setup_device(struct firmware *fw, struct device **dev_p,
} }
if (uevent) if (uevent)
set_bit(FW_STATUS_READY, &fw_priv->status); f_dev->uevent_suppress = 0;
else
set_bit(FW_STATUS_READY_NOHOTPLUG, &fw_priv->status);
*dev_p = f_dev; *dev_p = f_dev;
goto out; goto out;
......
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