lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <1395144280-23240-2-git-send-email-cw00.choi@samsung.com>
Date:	Tue, 18 Mar 2014 21:04:39 +0900
From:	Chanwoo Choi <cw00.choi@...sung.com>
To:	gregkh@...uxfoundation.org, balbi@...com, myungjoo.ham@...sung.com
Cc:	kishon@...com, linux-kernel@...r.kernel.org,
	linux-usb@...r.kernel.org, linux-omap@...r.kernel.org,
	Chanwoo Choi <cw00.choi@...sung.com>
Subject: [PATCH 1/2] 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@...sung.com>
---
 drivers/extcon/of_extcon.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/extcon/of_extcon.c b/drivers/extcon/of_extcon.c
index 72173ec..0a29f82 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);
 	}
 
-- 
1.8.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ