From patchwork Fri Dec 30 04:08:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanwoo Choi X-Patchwork-Id: 9491731 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8E3F960838 for ; Fri, 30 Dec 2016 04:10:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B0CC1FFD6 for ; Fri, 30 Dec 2016 04:10:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6B586252D5; Fri, 30 Dec 2016 04:10:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DC54B1FFD6 for ; Fri, 30 Dec 2016 04:10:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753642AbcL3EJk (ORCPT ); Thu, 29 Dec 2016 23:09:40 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:56998 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753389AbcL3EIW (ORCPT ); Thu, 29 Dec 2016 23:08:22 -0500 Received: from epcas1p1.samsung.com (unknown [182.195.41.45]) by mailout2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OIZ00RGXCTTIZ10@mailout2.samsung.com>; Fri, 30 Dec 2016 13:08:17 +0900 (KST) Received: from epsmges5p4.samsung.com (unknown [182.195.40.64]) by epcas1p2.samsung.com (KnoxPortal) with ESMTP id 20161230040816epcas1p2190cef04a519f944e4ad55427395048b~U7R_HHcch2555425554epcas1p2_; Fri, 30 Dec 2016 04:08:16 +0000 (GMT) Received: from epcas5p4.samsung.com ( [182.195.41.42]) by epsmges5p4.samsung.com (EPCPMTA) with SMTP id 76.A0.06849.0BDD5685; Fri, 30 Dec 2016 13:08:16 +0900 (KST) Received: from epcpsbgm2new.samsung.com (u27.gpu120.samsung.co.kr [203.254.230.27]) by epcas5p4.samsung.com (KnoxPortal) with ESMTP id 20161230040816epcas5p4c76ef8f364678a34e2a0ff67b0119ef9~U7R93pdxY0078200782epcas5p4N; Fri, 30 Dec 2016 04:08:16 +0000 (GMT) X-AuditID: b6c32a58-f79726d000001ac1-60-5865ddb04737 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id 56.A1.28332.0BDD5685; Fri, 30 Dec 2016 13:08:16 +0900 (KST) Received: from localhost.localdomain ([10.113.62.212]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OIZ0030ECTSVT80@mmp2.samsung.com>; Fri, 30 Dec 2016 13:08:16 +0900 (KST) From: Chanwoo Choi To: balbi@kernel.org, gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, linux-omap@vger.kernel.org, linux-renesas-soc@vger.kernel.org, chanwoo@kernel.org, Chanwoo Choi Subject: [PATCH v2 1/6] usb: dwc3: omap: Replace the extcon API Date: Fri, 30 Dec 2016 13:08:10 +0900 Message-id: <1483070895-8213-2-git-send-email-cw00.choi@samsung.com> X-Mailer: git-send-email 1.8.0 In-reply-to: <1483070895-8213-1-git-send-email-cw00.choi@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrDKsWRmVeSWpSXmKPExsWy7bCmlu6Gu6kRBv3bLC2OtT1ht5h44wqL xf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azl/SzWGx9+Y7JYtGyVmYHDo9NqzrZPPbPXcPu0bdlFaPH501y ASxRbjYZqYkpqUUKqXnJ+SmZeem2SqEhbroWSgp5ibmptkoRur4hQUoKZYk5pUCekQEacHAO cA9W0rdLcMs4uPoTU8FBkYq2j4YNjMsEuxg5OSQETCS+bL7DDGGLSVy4t56ti5GLQ0hgFqPE kkMHWCGcH4wS3be+sIFUsQloSex/cQPI5uAQETCQaLshBlLDLLCDUWLe0tNgcWEBe4md7RUg 5SwCqhIfOiewgNi8Ai4S91esg1omJ/FhzyN2EJtTwFXi3bZzrCC2EFDN8jNn2Ccw8i5gZFjF KJFakFxQnJSea5SXWq5XnJhbXJqXrpecn7uJERzQz6R3MB7e5X6IUYCDUYmH90dZaoQQa2JZ cWXuIUYJDmYlEd7C20Ah3pTEyqrUovz4otKc1OJDjKZAh01klhJNzgdGW15JvKGJuYm5sYGF uaWliZGSOG/j7GfhQgLpiSWp2ampBalFMH1MHJxSDYy9j3etunz736fsV+d3pW+fqrj6oPzr xfNXLjsY5G7PoHRbJTn8pel/C9t0fi6JIueUTaFzz16bG1u81X/iiu0cXwIXtp7atJl596+K xkNaz+rU5k96ePJIzooTKyKC8qOPBgklbsu7F1ys+n2J5oHNwbfb05dsnmW80/PWkU2z5rK9 S9ipu124WomlOCPRUIu5qDgRAL6WO6x+AgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20161230040816epcas5p4c76ef8f364678a34e2a0ff67b0119ef9 X-Msg-Generator: CA X-Sender-IP: 203.254.230.27 X-Local-Sender: =?UTF-8?B?7LWc7LCs7JqwG1RpemVuIFBsYXRmb3JtIExhYihTL1fshLw=?= =?UTF-8?B?7YSwKRvsgrzshLHsoITsnpAbUzUo7LGF7J6EKS9DaGFuZ2UgQWdlbnQ=?= X-Global-Sender: =?UTF-8?B?Q2hhbndvbyBDaG9pG1RpemVuIFBsYXRmb3JtIExhYi4bU2Ft?= =?UTF-8?B?c3VuZyBFbGVjdHJvbmljcxtTNS9TZW5pb3IgRW5naW5lZXI=?= X-Sender-Code: =?UTF-8?B?QzEwG1NUQUYbQzEwVjgxMTE=?= CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-HopCount: 7 X-CMS-RootMailID: 20161230040816epcas5p4c76ef8f364678a34e2a0ff67b0119ef9 X-RootMTR: 20161230040816epcas5p4c76ef8f364678a34e2a0ff67b0119ef9 References: <1483070895-8213-1-git-send-email-cw00.choi@samsung.com> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch uses the resource-managed extcon API for extcon_register_notifier() and replaces the deprecated extcon API as following: - extcon_get_cable_state_() -> extcon_get_state() Signed-off-by: Chanwoo Choi Acked-by: Felipe Balbi --- drivers/usb/dwc3/dwc3-omap.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c index 29e80cc9b634..2d2e9aa1db08 100644 --- a/drivers/usb/dwc3/dwc3-omap.c +++ b/drivers/usb/dwc3/dwc3-omap.c @@ -425,20 +425,20 @@ static int dwc3_omap_extcon_register(struct dwc3_omap *omap) } omap->vbus_nb.notifier_call = dwc3_omap_vbus_notifier; - ret = extcon_register_notifier(edev, EXTCON_USB, - &omap->vbus_nb); + ret = devm_extcon_register_notifier(omap->dev, edev, + EXTCON_USB, &omap->vbus_nb); if (ret < 0) dev_vdbg(omap->dev, "failed to register notifier for USB\n"); omap->id_nb.notifier_call = dwc3_omap_id_notifier; - ret = extcon_register_notifier(edev, EXTCON_USB_HOST, - &omap->id_nb); + ret = devm_extcon_register_notifier(omap->dev, edev, + EXTCON_USB_HOST, &omap->id_nb); if (ret < 0) dev_vdbg(omap->dev, "failed to register notifier for USB-HOST\n"); - if (extcon_get_cable_state_(edev, EXTCON_USB) == true) + if (extcon_get_state(edev, EXTCON_USB) == true) dwc3_omap_set_mailbox(omap, OMAP_DWC3_VBUS_VALID); - if (extcon_get_cable_state_(edev, EXTCON_USB_HOST) == true) + if (extcon_get_state(edev, EXTCON_USB_HOST) == true) dwc3_omap_set_mailbox(omap, OMAP_DWC3_ID_GROUND); omap->edev = edev; @@ -527,17 +527,13 @@ static int dwc3_omap_probe(struct platform_device *pdev) ret = of_platform_populate(node, NULL, NULL, dev); if (ret) { dev_err(&pdev->dev, "failed to create dwc3 core\n"); - goto err2; + goto err1; } dwc3_omap_enable_irqs(omap); return 0; -err2: - extcon_unregister_notifier(omap->edev, EXTCON_USB, &omap->vbus_nb); - extcon_unregister_notifier(omap->edev, EXTCON_USB_HOST, &omap->id_nb); - err1: pm_runtime_put_sync(dev); pm_runtime_disable(dev); @@ -549,8 +545,6 @@ static int dwc3_omap_remove(struct platform_device *pdev) { struct dwc3_omap *omap = platform_get_drvdata(pdev); - extcon_unregister_notifier(omap->edev, EXTCON_USB, &omap->vbus_nb); - extcon_unregister_notifier(omap->edev, EXTCON_USB_HOST, &omap->id_nb); dwc3_omap_disable_irqs(omap); of_platform_depopulate(omap->dev); pm_runtime_put_sync(&pdev->dev);