diff options
author | Kristian Høgsberg <krh@redhat.com> | 2007-03-19 11:37:16 -0400 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2007-03-20 18:27:19 -0400 |
commit | 015b066f4e5dbd301144c2de1c53329178f67a01 (patch) | |
tree | 60a6d5125eb9601df50f358e518f6ac92decf0b3 /drivers/firewire/fw-device.c | |
parent | 11f494ee25dd81af90255b1d61abc6f5508db4d0 (diff) |
firewire: Grab dev->sem when doing the update callback.
This serializes the update callback with the probe and remove callback from
the driver core and prevents remove from being called while update is
running for the same device.
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.c')
-rw-r--r-- | drivers/firewire/fw-device.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/firewire/fw-device.c b/drivers/firewire/fw-device.c index 4877cdbc58cc..15721a776cd4 100644 --- a/drivers/firewire/fw-device.c +++ b/drivers/firewire/fw-device.c | |||
@@ -562,8 +562,11 @@ static int update_unit(struct device *dev, void *data) | |||
562 | struct fw_unit *unit = fw_unit(dev); | 562 | struct fw_unit *unit = fw_unit(dev); |
563 | struct fw_driver *driver = (struct fw_driver *)dev->driver; | 563 | struct fw_driver *driver = (struct fw_driver *)dev->driver; |
564 | 564 | ||
565 | if (is_fw_unit(dev) && driver != NULL && driver->update != NULL) | 565 | if (is_fw_unit(dev) && driver != NULL && driver->update != NULL) { |
566 | down(&dev->sem); | ||
566 | driver->update(unit); | 567 | driver->update(unit); |
568 | up(&dev->sem); | ||
569 | } | ||
567 | 570 | ||
568 | return 0; | 571 | return 0; |
569 | } | 572 | } |