Skip to contentSkip to conversation

pinctrl: core: use devres_release() instead of devres_destroy()

PATCH In review Jingoo Han 3 participants 4 messages Feb 26, 2013 – Mar 1, 2013 Pin control

lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

PATCH 1/1 pinctrl: core: use devres_release() instead of devres_destroy()

devres_release() can simplify the code, because devres_release() will call the destructor for the resource as well as freeing the devres data.

---
 drivers/pinctrl/core.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/pinctrl/core.c +1 -2
index b0de6e7..e2d214c 100644
@@ -979,9 +979,8 @@ static int devm_pinctrl_match(struct device *dev, void *res, void *data)
  */
 void devm_pinctrl_put(struct pinctrl *p)
 {
-	WARN_ON(devres_destroy(p->dev, devm_pinctrl_release,
+	WARN_ON(devres_release(p->dev, devm_pinctrl_release,
 			       devm_pinctrl_match, p));
-	pinctrl_put(p);
 }
 EXPORT_SYMBOL_GPL(devm_pinctrl_put);
 
Signature · 1 line
1.7.2.5
#1 lore raw
Quoted 5 lines · Jingoo Han

devres_release() can simplify the code, because devres_release() will call the destructor for the resource as well as freeing the devres data.

Hm, Stephen, you OK with this?

Yours,
Linus Walleij