Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+2 -10
+2 -10
drivers/extcon/of_extcon.c
··· 32 32 { 33 33 struct device_node *node; 34 34 struct extcon_dev *edev; 35 - struct platform_device *extcon_parent_dev; 36 35 37 36 if (!dev->of_node) { 38 37 dev_dbg(dev, "device does not have a device node entry\n"); ··· 45 46 return ERR_PTR(-ENODEV); 46 47 } 47 48 48 - extcon_parent_dev = of_find_device_by_node(node); 49 - if (!extcon_parent_dev) { 50 - dev_dbg(dev, "unable to find device by node\n"); 51 - return ERR_PTR(-EPROBE_DEFER); 52 - } 53 - 54 - edev = extcon_get_extcon_dev(dev_name(&extcon_parent_dev->dev)); 49 + edev = extcon_get_extcon_dev(node->name); 55 50 if (!edev) { 56 - dev_dbg(dev, "unable to get extcon device : %s\n", 57 - dev_name(&extcon_parent_dev->dev)); 51 + dev_dbg(dev, "unable to get extcon device : %s\n", node->name); 58 52 return ERR_PTR(-ENODEV); 59 53 } 60 54