regmap: Clean up hwspinlock on regmap exit
authorMark Brown <broonie@kernel.org>
Fri, 3 Nov 2017 19:53:56 +0000 (19:53 +0000)
committerMark Brown <broonie@kernel.org>
Fri, 3 Nov 2017 19:53:56 +0000 (19:53 +0000)
We should free any hwspinlocks when we destroy the regmap, do so.

Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/base/regmap/regmap.c

index 5ff549fa880becc39a8aa53b324a70744711bfa2..bfe2f250d011eceb5017878af79336a194ceb5dd 100644 (file)
@@ -1305,6 +1305,8 @@ void regmap_exit(struct regmap *map)
                kfree(async->work_buf);
                kfree(async);
        }
                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);
        kfree(map);
 }
 EXPORT_SYMBOL_GPL(regmap_exit);