aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHaojian Zhuang <haojian.zhuang@linaro.org>2013-01-18 02:31:06 -0500
committerLinus Walleij <linus.walleij@linaro.org>2013-01-21 09:14:39 -0500
commitd6e99abb424a916ecbb127dba065a379b460a062 (patch)
tree278e646d123b34404e76e71a252aa8391dfd12fb
parent32e67eee670e1254ee5ab41e2f454680acb9c17c (diff)
pinctrl: core: get devname from pinctrl_dev
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>
-rw-r--r--drivers/pinctrl/core.c6
-rw-r--r--include/linux/pinctrl/pinctrl.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
index 361175372598..e6373f30aeeb 100644
--- a/drivers/pinctrl/core.c
+++ b/drivers/pinctrl/core.c
@@ -83,6 +83,12 @@ const char *pinctrl_dev_get_name(struct pinctrl_dev *pctldev)
83} 83}
84EXPORT_SYMBOL_GPL(pinctrl_dev_get_name); 84EXPORT_SYMBOL_GPL(pinctrl_dev_get_name);
85 85
86const char *pinctrl_dev_get_devname(struct pinctrl_dev *pctldev)
87{
88 return dev_name(pctldev->dev);
89}
90EXPORT_SYMBOL_GPL(pinctrl_dev_get_devname);
91
86void *pinctrl_dev_get_drvdata(struct pinctrl_dev *pctldev) 92void *pinctrl_dev_get_drvdata(struct pinctrl_dev *pctldev)
87{ 93{
88 return pctldev->driver_data; 94 return pctldev->driver_data;
diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h
index 04d6700d99af..778804df293f 100644
--- a/include/linux/pinctrl/pinctrl.h
+++ b/include/linux/pinctrl/pinctrl.h
@@ -154,6 +154,7 @@ struct pinctrl_dev *of_pinctrl_get(struct device_node *np)
154#endif /* CONFIG_OF */ 154#endif /* CONFIG_OF */
155 155
156extern const char *pinctrl_dev_get_name(struct pinctrl_dev *pctldev); 156extern const char *pinctrl_dev_get_name(struct pinctrl_dev *pctldev);
157extern const char *pinctrl_dev_get_devname(struct pinctrl_dev *pctldev);
157extern void *pinctrl_dev_get_drvdata(struct pinctrl_dev *pctldev); 158extern void *pinctrl_dev_get_drvdata(struct pinctrl_dev *pctldev);
158#else 159#else
159 160