aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
authorWolfram Sang <wsa@the-dreams.de>2015-01-29 16:45:09 -0500
committerWolfram Sang <wsa@the-dreams.de>2015-02-05 16:29:21 -0500
commit26680ee279ca7e404275eab2c683b5324afb396a (patch)
tree177c951d9ee99e2d25c1c0a0d59bd5466b5b5c88 /drivers/i2c
parent3a33a85401ecdb0e2c01ea86d9e36a5711ce01d4 (diff)
i2c: clarify comments about the dev_released completion
There was quite some confusion why this completion is there and if it is still necessary. Sadly, it is. However, let's improve the comments and share what we rediscovered. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/i2c-core.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 72d53e40ebab..4764a1fa0b56 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -1666,11 +1666,15 @@ void i2c_del_adapter(struct i2c_adapter *adap)
1666 /* device name is gone after device_unregister */ 1666 /* device name is gone after device_unregister */
1667 dev_dbg(&adap->dev, "adapter [%s] unregistered\n", adap->name); 1667 dev_dbg(&adap->dev, "adapter [%s] unregistered\n", adap->name);
1668 1668
1669 /* clean up the sysfs representation */ 1669 /* wait until all references to the device are gone
1670 *
1671 * FIXME: This is old code and should ideally be replaced by an
1672 * alternative which results in decoupling the lifetime of the struct
1673 * device from the i2c_adapter, like spi or netdev do. Any solution
1674 * should be throughly tested with DEBUG_KOBJECT_RELEASE enabled!
1675 */
1670 init_completion(&adap->dev_released); 1676 init_completion(&adap->dev_released);
1671 device_unregister(&adap->dev); 1677 device_unregister(&adap->dev);
1672
1673 /* wait for sysfs to drop all references */
1674 wait_for_completion(&adap->dev_released); 1678 wait_for_completion(&adap->dev_released);
1675 1679
1676 /* free bus id */ 1680 /* free bus id */