From patchwork Tue Mar 18 12:04:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanwoo Choi X-Patchwork-Id: 3853201 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B629A9F334 for ; Wed, 19 Mar 2014 17:43:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E629720035 for ; Wed, 19 Mar 2014 17:43:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 75A9B20131 for ; Wed, 19 Mar 2014 17:43:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754484AbaCRMEs (ORCPT ); Tue, 18 Mar 2014 08:04:48 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:37569 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754338AbaCRMEp (ORCPT ); Tue, 18 Mar 2014 08:04:45 -0400 Received: from epcpsbgr4.samsung.com (u144.gpu120.samsung.co.kr [203.254.230.144]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N2M00EIMS7WSB60@mailout1.samsung.com>; Tue, 18 Mar 2014 21:04:44 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.116]) by epcpsbgr4.samsung.com (EPCPMTA) with SMTP id E5.8C.10364.C5638235; Tue, 18 Mar 2014 21:04:44 +0900 (KST) X-AuditID: cbfee690-b7f266d00000287c-c5-5328365c605c Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 08.1A.28157.C5638235; Tue, 18 Mar 2014 21:04:44 +0900 (KST) Received: from chan.10.32.193.11 ([10.252.75.48]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N2M00F8LS7U3E10@mmp1.samsung.com>; Tue, 18 Mar 2014 21:04:43 +0900 (KST) From: Chanwoo Choi To: gregkh@linuxfoundation.org, balbi@ti.com, myungjoo.ham@samsung.com Cc: kishon@ti.com, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, linux-omap@vger.kernel.org, Chanwoo Choi Subject: [PATCH 1/2] extcon: of: Remove unnecessary function call by using the name of device_node Date: Tue, 18 Mar 2014 21:04:39 +0900 Message-id: <1395144280-23240-2-git-send-email-cw00.choi@samsung.com> X-Mailer: git-send-email 1.8.0 In-reply-to: <1395144280-23240-1-git-send-email-cw00.choi@samsung.com> References: <1395144280-23240-1-git-send-email-cw00.choi@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrOLMWRmVeSWpSXmKPExsWyRsSkRDfGTCPY4OcHAYuD9+strn95zmrR vHg9m8WFpz1sFpd3zWGzmL2kn8Vi0bJWZovbjSvYHDg89s9dw+7Rt2UVo8fxG9uZPD5vkgtg ieKySUnNySxLLdK3S+DKODbjAXvBF66Ke33TWRsYezi7GDk5JARMJO5s2skOYYtJXLi3nq2L kYtDSGApo8SKjWuZYIomLlrEDJFYxAjkdEJVNTJJdO96wQpSxSagJbH/xQ02EFtEwE1iT8Nx sA5mgT6gjsdrwEYJC6RIzFhyHKyBRUBVonP1TrA4r4CrxMoPk6HukJP4sOcRmM0JNOjA+kdg NUJANftut7CCDJUQmMwusaytnRFikIDEt8mHWLoYOYASshKbDjBDzJGUOLjiBssERuEFjAyr GEVTC5ILipPSi0z0ihNzi0vz0vWS83M3MQID/fS/ZxN2MN47YH2IMRlo3ERmKdHkfGCk5JXE GxqbGVmYmpgaG5lbmpEmrCTOq/YoKUhIID2xJDU7NbUgtSi+qDQntfgQ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MB/GnFr+cCAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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); }