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>
This commit is contained in:
Stefan Richter 2009-06-06 18:35:27 +02:00
parent e71d31da06
commit e5110d011e
3 changed files with 28 additions and 18 deletions

View file

@ -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 {