diff options
author | Wolfram Sang <wsa@kernel.org> | 2022-09-16 22:42:18 +0300 |
---|---|---|
committer | Wolfram Sang <wsa@kernel.org> | 2022-09-16 22:42:18 +0300 |
commit | d819524d3144f4703f45f473fdc85ad7579ae94c (patch) | |
tree | 9bcb29b9b1a24ecf5a1a367c1af7d9be138ba041 /drivers/gpio/gpio-pca953x.c | |
parent | 859d64685d6c868db62b86064769b053db8bf834 (diff) | |
parent | 80e78fcce86de0288793a0ef0f6acf37656ee4cf (diff) | |
download | linux-d819524d3144f4703f45f473fdc85ad7579ae94c.tar.xz |
Merge tag 'v6.0-rc5' into i2c/for-mergewindow
Linux 6.0-rc5
Diffstat (limited to 'drivers/gpio/gpio-pca953x.c')
-rw-r--r-- | drivers/gpio/gpio-pca953x.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c index 091dd573c556..cf9bf3fcaee2 100644 --- a/drivers/gpio/gpio-pca953x.c +++ b/drivers/gpio/gpio-pca953x.c @@ -1168,7 +1168,9 @@ static int pca953x_suspend(struct device *dev) { struct pca953x_chip *chip = dev_get_drvdata(dev); + mutex_lock(&chip->i2c_lock); regcache_cache_only(chip->regmap, true); + mutex_unlock(&chip->i2c_lock); if (atomic_read(&chip->wakeup_path)) device_set_wakeup_path(dev); @@ -1191,13 +1193,17 @@ static int pca953x_resume(struct device *dev) } } + mutex_lock(&chip->i2c_lock); regcache_cache_only(chip->regmap, false); regcache_mark_dirty(chip->regmap); ret = pca953x_regcache_sync(dev); - if (ret) + if (ret) { + mutex_unlock(&chip->i2c_lock); return ret; + } ret = regcache_sync(chip->regmap); + mutex_unlock(&chip->i2c_lock); if (ret) { dev_err(dev, "Failed to restore register map: %d\n", ret); return ret; |