Skip to content

Commit

Permalink
i2c: always enable RuntimePM for the adapter device
Browse files Browse the repository at this point in the history
The adapter device is a logical device. Because of that, it already uses
pm_runtime_no_callbacks() in the core. To ensure proper propagation from
the children (i2c devices) to the parent of the adapter (the HW device),
make sure RuntimePM is enabled in any case.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
  • Loading branch information
Wolfram Sang authored and Wolfram Sang committed Jan 10, 2016
1 parent 8d22f30 commit 9f92416
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/i2c/i2c-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1564,6 +1564,7 @@ static int i2c_register_adapter(struct i2c_adapter *adap)
dev_dbg(&adap->dev, "adapter [%s] registered\n", adap->name);

pm_runtime_no_callbacks(&adap->dev);
pm_runtime_enable(&adap->dev);

#ifdef CONFIG_I2C_COMPAT
res = class_compat_create_link(i2c_adapter_compat_class, &adap->dev,
Expand Down Expand Up @@ -1818,6 +1819,8 @@ void i2c_del_adapter(struct i2c_adapter *adap)
/* device name is gone after device_unregister */
dev_dbg(&adap->dev, "adapter [%s] unregistered\n", adap->name);

pm_runtime_disable(&adap->dev);

/* wait until all references to the device are gone
*
* FIXME: This is old code and should ideally be replaced by an
Expand Down

0 comments on commit 9f92416

Please sign in to comment.