aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-i801.c
diff options
context:
space:
mode:
authorHeiner Kallweit <hkallweit1@gmail.com>2021-08-06 23:12:18 +0200
committerWolfram Sang <wsa@kernel.org>2021-08-10 22:36:15 +0200
commit4e60d5dd10cd82014b26a40519b94444547ec95c (patch)
treebec9fc65ca712817009dc8548921cf98cf3662b6 /drivers/i2c/busses/i2c-i801.c
parenti2c: highlander: add IRQ check (diff)
downloadlinux-dev-4e60d5dd10cd82014b26a40519b94444547ec95c.tar.xz
linux-dev-4e60d5dd10cd82014b26a40519b94444547ec95c.zip
i2c: i801: Improve disabling runtime pm
Setting the autosuspend delay to a negative value disables runtime pm in a little bit smarter way, because we need no cleanup when removing the driver. Note that this is safe when reloading the driver, because the call to pm_runtime_set_autosuspend_delay() in probe() will reverse the effect. See update_autosuspend() for details. Reviewed-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Wolfram Sang <wsa@kernel.org>
Diffstat (limited to 'drivers/i2c/busses/i2c-i801.c')
-rw-r--r--drivers/i2c/busses/i2c-i801.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index 92ec291c0648..ef6dbb531a9c 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -1628,7 +1628,7 @@ i801_acpi_io_handler(u32 function, acpi_physical_address address, u32 bits,
* BIOS is accessing the host controller so prevent it from
* suspending automatically from now on.
*/
- pm_runtime_get_sync(&pdev->dev);
+ pm_runtime_set_autosuspend_delay(&pdev->dev, -1);
}
if ((function & ACPI_IO_MASK) == ACPI_READ)
@@ -1668,11 +1668,6 @@ static void i801_acpi_remove(struct i801_priv *priv)
acpi_remove_address_space_handler(adev->handle,
ACPI_ADR_SPACE_SYSTEM_IO, i801_acpi_io_handler);
-
- mutex_lock(&priv->acpi_lock);
- if (priv->acpi_reserved)
- pm_runtime_put(&priv->pci_dev->dev);
- mutex_unlock(&priv->acpi_lock);
}
#else
static inline int i801_acpi_probe(struct i801_priv *priv) { return 0; }