From 015b066f4e5dbd301144c2de1c53329178f67a01 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg?= Date: Mon, 19 Mar 2007 11:37:16 -0400 Subject: [PATCH] firewire: Grab dev->sem when doing the update callback. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Stefan Richter --- drivers/firewire/fw-device.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) struct fw_unit *unit = fw_unit(dev); struct fw_driver *driver = (struct fw_driver *)dev->driver; - if (is_fw_unit(dev) && driver != NULL && driver->update != NULL) + if (is_fw_unit(dev) && driver != NULL && driver->update != NULL) { + down(&dev->sem); driver->update(unit); + up(&dev->sem); + } return 0; } -- 2.39.5