aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/extcon
diff options
context:
space:
mode:
authorChanwoo Choi <cw00.choi@samsung.com>2014-03-18 06:09:41 -0400
committerChanwoo Choi <cw00.choi@samsung.com>2014-03-19 00:45:43 -0400
commitca48824117b3ceaa4e35a7c5d651b95c288308e6 (patch)
treede9ea73b784316b07bb5210736f07ee33563712c /drivers/extcon
parent3cc731d97fb608a09336fbcea1b2bcea9574d1f7 (diff)
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. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Diffstat (limited to 'drivers/extcon')
-rw-r--r--drivers/extcon/of_extcon.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/extcon/of_extcon.c b/drivers/extcon/of_extcon.c
index 72173ecbb311..0a29f822cf77 100644
--- a/drivers/extcon/of_extcon.c
+++ b/drivers/extcon/of_extcon.c
@@ -32,7 +32,6 @@ struct extcon_dev *of_extcon_get_extcon_dev(struct device *dev, int index)
32{ 32{
33 struct device_node *node; 33 struct device_node *node;
34 struct extcon_dev *edev; 34 struct extcon_dev *edev;
35 struct platform_device *extcon_parent_dev;
36 35
37 if (!dev->of_node) { 36 if (!dev->of_node) {
38 dev_dbg(dev, "device does not have a device node entry\n"); 37 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)
46 return ERR_PTR(-ENODEV); 45 return ERR_PTR(-ENODEV);
47 } 46 }
48 47
49 extcon_parent_dev = of_find_device_by_node(node); 48 edev = extcon_get_extcon_dev(node->name);
50 if (!extcon_parent_dev) {
51 dev_dbg(dev, "unable to find device by node\n");
52 return ERR_PTR(-EPROBE_DEFER);
53 }
54
55 edev = extcon_get_extcon_dev(dev_name(&extcon_parent_dev->dev));
56 if (!edev) { 49 if (!edev) {
57 dev_dbg(dev, "unable to get extcon device : %s\n", 50 dev_dbg(dev, "unable to get extcon device : %s\n", node->name);
58 dev_name(&extcon_parent_dev->dev));
59 return ERR_PTR(-ENODEV); 51 return ERR_PTR(-ENODEV);
60 } 52 }
61 53