Jelajahi Sumber

regmap: Clean up hwspinlock on regmap exit

We should free any hwspinlocks when we destroy the regmap, do so.

Signed-off-by: Mark Brown <broonie@kernel.org>
Mark Brown 7 tahun lalu
induk
melakukan
e8419c40a5
1 mengubah file dengan 2 tambahan dan 0 penghapusan
  1. 2 0
      drivers/base/regmap/regmap.c

+ 2 - 0
drivers/base/regmap/regmap.c

@@ -1305,6 +1305,8 @@ void regmap_exit(struct regmap *map)
 		kfree(async->work_buf);
 		kfree(async);
 	}
+	if (IS_ENABLED(REGMAP_HWSPINLOCK) && map->hwlock)
+		hwspin_lock_free(map->hwlock);
 	kfree(map);
 }
 EXPORT_SYMBOL_GPL(regmap_exit);