diff options
author | Kristian Høgsberg <krh@redhat.com> | 2007-03-27 19:35:13 -0400 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2007-03-28 15:30:13 -0400 |
commit | 6f2e53d5135a861d3ee8afdacac5cde13c49a05d (patch) | |
tree | d36dcf30cc2bc1909d4f12c1a6ff77c960a92027 /drivers/firewire/fw-device.h | |
parent | ecab413359541b1dbe8e8c91cb5fa8eafa662c05 (diff) |
firewire: Use device->groups for adding device attributes.
We dynamically create an attribute group for the key present on the
device in hand and point device->group to it. This way the device
core adds the sysfs attributes for us as the device is added.
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/firewire/fw-device.h')
-rw-r--r-- | drivers/firewire/fw-device.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/firewire/fw-device.h b/drivers/firewire/fw-device.h index ce47ab95884..c167d59da68 100644 --- a/drivers/firewire/fw-device.h +++ b/drivers/firewire/fw-device.h | |||
@@ -32,6 +32,12 @@ enum fw_device_state { | |||
32 | FW_DEVICE_SHUTDOWN, | 32 | FW_DEVICE_SHUTDOWN, |
33 | }; | 33 | }; |
34 | 34 | ||
35 | struct fw_attribute_group { | ||
36 | struct attribute_group *groups[2]; | ||
37 | struct attribute_group group; | ||
38 | struct attribute *attrs[11]; | ||
39 | }; | ||
40 | |||
35 | struct fw_device { | 41 | struct fw_device { |
36 | atomic_t state; | 42 | atomic_t state; |
37 | struct fw_node *node; | 43 | struct fw_node *node; |
@@ -45,6 +51,7 @@ struct fw_device { | |||
45 | size_t config_rom_length; | 51 | size_t config_rom_length; |
46 | int config_rom_retries; | 52 | int config_rom_retries; |
47 | struct delayed_work work; | 53 | struct delayed_work work; |
54 | struct fw_attribute_group attribute_group; | ||
48 | }; | 55 | }; |
49 | 56 | ||
50 | static inline struct fw_device * | 57 | static inline struct fw_device * |
@@ -72,6 +79,7 @@ extern int fw_cdev_major; | |||
72 | struct fw_unit { | 79 | struct fw_unit { |
73 | struct device device; | 80 | struct device device; |
74 | u32 *directory; | 81 | u32 *directory; |
82 | struct fw_attribute_group attribute_group; | ||
75 | }; | 83 | }; |
76 | 84 | ||
77 | static inline struct fw_unit * | 85 | static inline struct fw_unit * |