diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2009-06-06 20:35:27 +0400 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2009-06-06 23:45:50 +0400 |
commit | e5110d011e03030926872457f05e49e3d5031737 (patch) | |
tree | 09037ffddcea6f5b8b18ab20035904408d2869ea /include/linux | |
parent | e71d31da062095d8b0b02a26fb5e8879e8d3d0de (diff) | |
download | linux-e5110d011e03030926872457f05e49e3d5031737.tar.xz |
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 'include/linux')
-rw-r--r-- | include/linux/firewire.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/firewire.h b/include/linux/firewire.h index e979f9b22cb6..a69aea0394e3 100644 --- a/include/linux/firewire.h +++ b/include/linux/firewire.h @@ -248,6 +248,11 @@ static inline void fw_unit_put(struct fw_unit *unit) put_device(&unit->device); } +static inline struct fw_device *fw_parent_device(struct fw_unit *unit) +{ + return fw_device(unit->device.parent); +} + struct ieee1394_device_id; struct fw_driver { |