From: Chanwoo Choi Date: Tue, 18 Mar 2014 10:09:41 +0000 (+0900) Subject: extcon: of: Remove unnecessary function call by using the name of device_node X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=ca48824117b3ceaa4e35a7c5d651b95c288308e6;p=linux-beck.git 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 --- 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) { 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); }