summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChanwoo Choi <cw00.choi@samsung.com>2014-03-18 19:09:41 +0900
committerMyungJoo Ham <myungjoo.ham@samsung.com>2014-04-27 20:48:24 -0700
commit8c822bad75b3441addbbd9622ec4cd261b25b2fa (patch)
treeaec2941ee35a133c13bd6a0be92fb9a79c47b2f3
parent9282fc0473a1e7c6087c0156bfe80093fa7449ca (diff)
downloadlinux-3.10-8c822bad75b3441addbbd9622ec4cd261b25b2fa.tar.gz
linux-3.10-8c822bad75b3441addbbd9622ec4cd261b25b2fa.tar.bz2
linux-3.10-8c822bad75b3441addbbd9622ec4cd261b25b2fa.zip
extcon: of: Remove unnecessary function call by using the name of device_node
This patch remove unnecessary function call in of_extcon_get_extcon_dev() by using the name of device_node structure. Change-Id: Ifae59614f355d1ad1beef9aab1c497840f22a727 Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
-rw-r--r--drivers/extcon/of_extcon.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/drivers/extcon/of_extcon.c b/drivers/extcon/of_extcon.c
index 72173ecbb31..e8ea4e0eb04 100644
--- a/drivers/extcon/of_extcon.c
+++ b/drivers/extcon/of_extcon.c
@@ -22,7 +22,7 @@
#include <linux/extcon/of_extcon.h>
/*
- * of_extcon_get_extcon_dev - Get the name of extcon device from devicetree
+ * of_extcon_get_extcon_dev - Get the extcon device from devicetree
* @dev - instance to the given device
* @index - index into list of extcon_dev
*
@@ -32,7 +32,6 @@ struct extcon_dev *of_extcon_get_extcon_dev(struct device *dev, int index)
{
struct device_node *node;
struct extcon_dev *edev;
- struct platform_device *extcon_parent_dev;
if (!dev->of_node) {
dev_dbg(dev, "device does not have a device node entry\n");
@@ -46,16 +45,9 @@ struct extcon_dev *of_extcon_get_extcon_dev(struct device *dev, int index)
return ERR_PTR(-ENODEV);
}
- extcon_parent_dev = of_find_device_by_node(node);
- if (!extcon_parent_dev) {
- dev_dbg(dev, "unable to find device by node\n");
- return ERR_PTR(-EPROBE_DEFER);
- }
-
- edev = extcon_get_extcon_dev(dev_name(&extcon_parent_dev->dev));
+ edev = extcon_get_extcon_dev(node->name);
if (!edev) {
- dev_dbg(dev, "unable to get extcon device : %s\n",
- dev_name(&extcon_parent_dev->dev));
+ dev_dbg(dev, "unable to get extcon device : %s\n", node->name);
return ERR_PTR(-ENODEV);
}