diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2009-06-06 12:35:27 -0400 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2009-06-06 15:45:50 -0400 |
commit | e5110d011e03030926872457f05e49e3d5031737 (patch) | |
tree | 09037ffddcea6f5b8b18ab20035904408d2869ea /drivers/firewire/core-device.c | |
parent | e71d31da062095d8b0b02a26fb5e8879e8d3d0de (diff) |
firewire: add parent-of-unit accessor
Retrieval of an fw_unit's parent is a common pattern in high-level code.
Wrap it up as device = fw_parent_device(unit).
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/firewire/core-device.c')
-rw-r--r-- | drivers/firewire/core-device.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/firewire/core-device.c b/drivers/firewire/core-device.c index 65d84dd6c1de..3f4e646367b7 100644 --- a/drivers/firewire/core-device.c +++ b/drivers/firewire/core-device.c | |||
@@ -93,7 +93,7 @@ static int fw_unit_match(struct device *dev, struct device_driver *drv) | |||
93 | if (!is_fw_unit(dev)) | 93 | if (!is_fw_unit(dev)) |
94 | return 0; | 94 | return 0; |
95 | 95 | ||
96 | device = fw_device(unit->device.parent); | 96 | device = fw_parent_device(unit); |
97 | id = container_of(drv, struct fw_driver, driver)->id_table; | 97 | id = container_of(drv, struct fw_driver, driver)->id_table; |
98 | 98 | ||
99 | for (; id->match_flags != 0; id++) { | 99 | for (; id->match_flags != 0; id++) { |
@@ -114,7 +114,7 @@ static int fw_unit_match(struct device *dev, struct device_driver *drv) | |||
114 | 114 | ||
115 | static int get_modalias(struct fw_unit *unit, char *buffer, size_t buffer_size) | 115 | static int get_modalias(struct fw_unit *unit, char *buffer, size_t buffer_size) |
116 | { | 116 | { |
117 | struct fw_device *device = fw_device(unit->device.parent); | 117 | struct fw_device *device = fw_parent_device(unit); |
118 | struct fw_csr_iterator ci; | 118 | struct fw_csr_iterator ci; |
119 | 119 | ||
120 | int key, value; | 120 | int key, value; |