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>
This commit is contained in:
parent
3cc731d97f
commit
ca48824117
@ -32,7 +32,6 @@ struct extcon_dev *of_extcon_get_extcon_dev(struct device *dev, int index)
|
|||||||
{
|
{
|
||||||
struct device_node *node;
|
struct device_node *node;
|
||||||
struct extcon_dev *edev;
|
struct extcon_dev *edev;
|
||||||
struct platform_device *extcon_parent_dev;
|
|
||||||
|
|
||||||
if (!dev->of_node) {
|
if (!dev->of_node) {
|
||||||
dev_dbg(dev, "device does not have a device node entry\n");
|
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);
|
return ERR_PTR(-ENODEV);
|
||||||
}
|
}
|
||||||
|
|
||||||
extcon_parent_dev = of_find_device_by_node(node);
|
edev = extcon_get_extcon_dev(node->name);
|
||||||
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));
|
|
||||||
if (!edev) {
|
if (!edev) {
|
||||||
dev_dbg(dev, "unable to get extcon device : %s\n",
|
dev_dbg(dev, "unable to get extcon device : %s\n", node->name);
|
||||||
dev_name(&extcon_parent_dev->dev));
|
|
||||||
return ERR_PTR(-ENODEV);
|
return ERR_PTR(-ENODEV);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user