diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2010-06-04 03:54:37 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-08-05 16:53:34 -0400 |
commit | 0983ca2d0f0ff645bc86899aefb936cffb314839 (patch) | |
tree | 5eb2fbb53da9b869b809893c0834e8c07addb40e /drivers/base | |
parent | cc7447a5fa92759b0856d6a83ba2539c6a94e67e (diff) |
firmware loader: use statically initialized data attribute
There is no reason why we are using a template for binary attribute
and copying it into per-firmware data before registering. Using the
original works as well.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/firmware_class.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c index 3f093b0dd217..fb29c64ebecc 100644 --- a/drivers/base/firmware_class.c +++ b/drivers/base/firmware_class.c | |||
@@ -87,7 +87,6 @@ static DEFINE_MUTEX(fw_lock); | |||
87 | 87 | ||
88 | struct firmware_priv { | 88 | struct firmware_priv { |
89 | struct completion completion; | 89 | struct completion completion; |
90 | struct bin_attribute attr_data; | ||
91 | struct firmware *fw; | 90 | struct firmware *fw; |
92 | unsigned long status; | 91 | unsigned long status; |
93 | struct page **pages; | 92 | struct page **pages; |
@@ -420,8 +419,8 @@ out: | |||
420 | return retval; | 419 | return retval; |
421 | } | 420 | } |
422 | 421 | ||
423 | static struct bin_attribute firmware_attr_data_tmpl = { | 422 | static struct bin_attribute firmware_attr_data = { |
424 | .attr = {.name = "data", .mode = 0644}, | 423 | .attr = { .name = "data", .mode = 0644 }, |
425 | .size = 0, | 424 | .size = 0, |
426 | .read = firmware_data_read, | 425 | .read = firmware_data_read, |
427 | .write = firmware_data_write, | 426 | .write = firmware_data_write, |
@@ -452,7 +451,6 @@ static int fw_register_device(struct device **dev_p, const char *fw_name, | |||
452 | 451 | ||
453 | strcpy(fw_priv->fw_id, fw_name); | 452 | strcpy(fw_priv->fw_id, fw_name); |
454 | init_completion(&fw_priv->completion); | 453 | init_completion(&fw_priv->completion); |
455 | fw_priv->attr_data = firmware_attr_data_tmpl; | ||
456 | fw_priv->timeout.function = firmware_class_timeout; | 454 | fw_priv->timeout.function = firmware_class_timeout; |
457 | fw_priv->timeout.data = (u_long) fw_priv; | 455 | fw_priv->timeout.data = (u_long) fw_priv; |
458 | init_timer(&fw_priv->timeout); | 456 | init_timer(&fw_priv->timeout); |
@@ -498,8 +496,7 @@ static int fw_setup_device(struct firmware *fw, struct device **dev_p, | |||
498 | fw_priv->nowait = nowait; | 496 | fw_priv->nowait = nowait; |
499 | 497 | ||
500 | fw_priv->fw = fw; | 498 | fw_priv->fw = fw; |
501 | sysfs_bin_attr_init(&fw_priv->attr_data); | 499 | retval = sysfs_create_bin_file(&f_dev->kobj, &firmware_attr_data); |
502 | retval = sysfs_create_bin_file(&f_dev->kobj, &fw_priv->attr_data); | ||
503 | if (retval) { | 500 | if (retval) { |
504 | dev_err(device, "%s: sysfs_create_bin_file failed\n", __func__); | 501 | dev_err(device, "%s: sysfs_create_bin_file failed\n", __func__); |
505 | goto error_unreg; | 502 | goto error_unreg; |