From patchwork Wed Nov 30 05:57:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanwoo Choi X-Patchwork-Id: 9453721 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 E0DD56071C for ; Wed, 30 Nov 2016 06:01:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D20D62838E for ; Wed, 30 Nov 2016 06:01:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C320D283F9; Wed, 30 Nov 2016 06:01:25 +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 40F6C2838E for ; Wed, 30 Nov 2016 06:01:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755901AbcK3GAm (ORCPT ); Wed, 30 Nov 2016 01:00:42 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:47826 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754602AbcK3F5q (ORCPT ); Wed, 30 Nov 2016 00:57:46 -0500 Received: from epcpsbgm2new.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OHF00UR7XW6ES20@mailout2.samsung.com>; Wed, 30 Nov 2016 14:57:42 +0900 (KST) X-AuditID: cbfee61b-f796f6d000004092-0a-583e6a5658cf Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id 95.62.16530.65A6E385; Wed, 30 Nov 2016 14:57:42 +0900 (KST) Received: from localhost.localdomain ([10.113.62.212]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OHF00E2UXW50C70@mmp1.samsung.com>; Wed, 30 Nov 2016 14:57:42 +0900 (KST) From: Chanwoo Choi To: balbi@kernel.org, gregkh@linuxfoundation.org, kishon@ti.com, sre@kernel.org Cc: Peter.Chen@nxp.com, wens@csie.org, yoshihiro.shimoda.uh@renesas.com, maxime.ripard@free-electrons.com, b-liu@ti.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, linux-usb@vger.kernel.org, linux-omap@vger.kernel.org, linux-renesas-soc@vger.kernel.org, cw00.choi@samsung.com, chanwoo@kernel.org Subject: [PATCH 06/12] usb: dwc3: omap: Replace the extcon API Date: Wed, 30 Nov 2016 14:57:34 +0900 Message-id: <1480485460-2663-7-git-send-email-cw00.choi@samsung.com> X-Mailer: git-send-email 1.8.0 In-reply-to: <1480485460-2663-1-git-send-email-cw00.choi@samsung.com> References: <1480485460-2663-1-git-send-email-cw00.choi@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrGIsWRmVeSWpSXmKPExsVy+t9jAd2wLLsIg703dS3+31nEanGs7Qm7 xcQbV1gsrn95zmrRvHg9m8WFpz1sFpseX2O1uLxrDpvF7CX9LBafe48wWmx9+Y7JYtGyVmaL rZv2Mlv8uXeH1eL07hKLn4fOM1l83fuZzUHQY8Oj1aweTzZdZPTYtKqTzWP/3DXsHpuX1Hts fLeDyePbmYksHn1bVjF6HL+xncnj8ya5AK4oN5uM1MSU1CKF1Lzk/JTMvHRbpdAQN10LJYW8 xNxUW6UIXd+QICWFssScUiDPyAANODgHuAcr6dsluGVMmbyAsaBLpOLU+9lMDYxfBLoYOTkk BEwkFq9rZoOwxSQu3FsPZHNxCAksZZT4NeUHE4Tzg1FiYvdlJpAqNgEtif0vboB1iAj4S+xo nMMCUsQs8IhJ4srL7SwgCWEBO4mZ91YxgtgsAqoSz1ZtBmvgFXCROPh9FjvEOjmJD3seAdkc HJwCrhKTvqeAhIWAStYsXMw0gZF3ASPDKkaJ1ILkguKk9FyjvNRyveLE3OLSvHS95PzcTYzg OHsmvYPx8C73Q4wCHIxKPLwL5thGCLEmlhVX5h5ilOBgVhLhdUuzixDiTUmsrEotyo8vKs1J LT7EaAp010RmKdHkfGAKyCuJNzQxNzE3NrAwt7Q0MVIS522c/SxcSCA9sSQ1OzW1ILUIpo+J g1OqgTEsdeFW3kDh8tcRy/evNtzEzcyQsfPLZIUjCRGr1B74qX9a+9pnnc3cHdcX2fol5vGa vCq5XuGj+/PEOR428x9Mr+ZyfXu/T/V3TIdu5tNVnEtfPalevd/If73/PQF/v+uHZ25pjL82 /TOfe6UEu1H9dXueWKs85XbRVrZJde8Z8s65f32dVavEUpyRaKjFXFScCABzXUcCyQIAAA== X-MTR: 20000000000000000@CPGS 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);