pinctrl: core: use devres_release() instead of devres_destroy()
authorJingoo Han <jg1.han@samsung.com>
Tue, 26 Feb 2013 02:34:07 +0000 (11:34 +0900)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 7 Mar 2013 04:27:29 +0000 (05:27 +0100)
devres_release() can simplify the code, because devres_release()
will call the destructor for the resource as well as freeing
the devres data.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/core.c

index b0de6e7f1fdb8cb68566b24f04eee8722ab77862..e2d214c5c58fb1bf199b207d679c2d116ff053e3 100644 (file)
@@ -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);