Commit 5204f5e3 authored by Mark Brown's avatar Mark Brown

regmap: Remove bitrotted module_put()s

The conversion to per bus type registration functions means we don't need
to do module_get()s to hold the bus types in memory (their users will link
to them) so we removed all those calls. This left module_put() calls in
the cleanup paths which aren't needed and which cause unbalanced puts if
we ever try to unload anything.
Reported-by: default avatarJonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent b33f9cbd
...@@ -168,13 +168,11 @@ struct regmap *regmap_init(struct device *dev, ...@@ -168,13 +168,11 @@ struct regmap *regmap_init(struct device *dev,
map->work_buf = kmalloc(map->format.buf_size, GFP_KERNEL); map->work_buf = kmalloc(map->format.buf_size, GFP_KERNEL);
if (map->work_buf == NULL) { if (map->work_buf == NULL) {
ret = -ENOMEM; ret = -ENOMEM;
goto err_bus; goto err_map;
} }
return map; return map;
err_bus:
module_put(map->bus->owner);
err_map: err_map:
kfree(map); kfree(map);
err: err:
...@@ -188,7 +186,6 @@ EXPORT_SYMBOL_GPL(regmap_init); ...@@ -188,7 +186,6 @@ EXPORT_SYMBOL_GPL(regmap_init);
void regmap_exit(struct regmap *map) void regmap_exit(struct regmap *map)
{ {
kfree(map->work_buf); kfree(map->work_buf);
module_put(map->bus->owner);
kfree(map); kfree(map);
} }
EXPORT_SYMBOL_GPL(regmap_exit); EXPORT_SYMBOL_GPL(regmap_exit);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment