Re: [PATCH] regmap: detach regmap from dev on regmap_exit

From: Cosmin Tanislav
Date: Mon Nov 25 2024 - 15:44:13 EST




On 11/25/24 2:22 PM, Mark Brown wrote:
On Fri, Nov 22, 2024 at 05:16:30PM +0200, Cosmin Tanislav wrote:

+int regmap_detach_dev(struct device *dev, struct regmap *map)
+{
+ if (!dev)
+ return 0;
+
+ return devres_release(dev, dev_get_regmap_release,
+ dev_get_regmap_match, (void *)map->name);
+}
+EXPORT_SYMBOL_GPL(regmap_detach_dev);

Why is this exported?


I only did it because regmap_attach_dev() was also exported.
I can make it static for V2.

@@ -1445,6 +1457,7 @@ void regmap_exit(struct regmap *map)
{
struct regmap_async *async;
+ regmap_detach_dev(map->dev, map);
regcache_exit(map);
regmap_debugfs_exit(map);

The one caller is in the same file so it can be static.