pinctrl: core: get devname from pinctrl_dev
authorHaojian Zhuang <haojian.zhuang@linaro.org>
Fri, 18 Jan 2013 07:31:06 +0000 (15:31 +0800)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 21 Jan 2013 14:14:39 +0000 (15:14 +0100)
Add new function to get devname from pinctrl_dev. pinctrl_dev_get_name()
can only get pinctrl description name. If we want to use gpio driver to
find pinctrl device node, we need to fetch the pinctrl device name.

Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/core.c
include/linux/pinctrl/pinctrl.h

index 3611753725988fa3781b66ac340835bf8d224ed8..e6373f30aeeb26895283ab486893b6396c814371 100644 (file)
@@ -83,6 +83,12 @@ const char *pinctrl_dev_get_name(struct pinctrl_dev *pctldev)
 }
 EXPORT_SYMBOL_GPL(pinctrl_dev_get_name);
 
+const char *pinctrl_dev_get_devname(struct pinctrl_dev *pctldev)
+{
+       return dev_name(pctldev->dev);
+}
+EXPORT_SYMBOL_GPL(pinctrl_dev_get_devname);
+
 void *pinctrl_dev_get_drvdata(struct pinctrl_dev *pctldev)
 {
        return pctldev->driver_data;
index 04d6700d99afd610a9a002d8ddc70f0dd33b09ca..778804df293f675e505011d0b64b824c2962eae2 100644 (file)
@@ -154,6 +154,7 @@ struct pinctrl_dev *of_pinctrl_get(struct device_node *np)
 #endif /* CONFIG_OF */
 
 extern const char *pinctrl_dev_get_name(struct pinctrl_dev *pctldev);
+extern const char *pinctrl_dev_get_devname(struct pinctrl_dev *pctldev);
 extern void *pinctrl_dev_get_drvdata(struct pinctrl_dev *pctldev);
 #else