From patchwork Mon Jan 16 12:36:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanwoo Choi X-Patchwork-Id: 9518609 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 9ECDC6020B for ; Mon, 16 Jan 2017 12:37:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8486A281F9 for ; Mon, 16 Jan 2017 12:37:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 795EB2824F; Mon, 16 Jan 2017 12:37:41 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id ED1D5281F9 for ; Mon, 16 Jan 2017 12:37:40 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cT6Xb-0006ij-UE; Mon, 16 Jan 2017 12:37:39 +0000 Received: from mailout2.samsung.com ([203.254.224.25]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cT6XY-0006gg-At for linux-arm-kernel@lists.infradead.org; Mon, 16 Jan 2017 12:37:38 +0000 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 <0OJV02A1THQ2A510@mailout2.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 16 Jan 2017 21:37:14 +0900 (KST) Received: from epsmges1p5.samsung.com (unknown [182.195.40.70]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20170116123713epcas1p116a91ed9f4cb217fd2f043cb2cab8510~aQMMY8okn1644816448epcas1p12; Mon, 16 Jan 2017 12:37:13 +0000 (GMT) Received: from epcas1p1.samsung.com ( [182.195.41.45]) by epsmges1p5.samsung.com (Symantec Messaging Gateway) with SMTP id 42.7A.04055.97EBC785; Mon, 16 Jan 2017 21:37:13 +0900 (KST) Received: from epcpsbgm1new.samsung.com (u26.gpu120.samsung.co.kr [203.254.230.26]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20170116123713epcas1p1ebe3e43a7a3cf20c0981966842a3992f~aQMMJRh_v1653316533epcas1p11; Mon, 16 Jan 2017 12:37:13 +0000 (GMT) X-AuditID: b6c32a39-f793d6d000000fd7-46-587cbe79634b Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id C5.BC.08931.97EBC785; Mon, 16 Jan 2017 21:37:13 +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 <0OJV00E5AHQ1PE30@mmp1.samsung.com>; Mon, 16 Jan 2017 21:37:13 +0900 (KST) From: Chanwoo Choi To: balbi@kernel.org, gregkh@linuxfoundation.org Subject: [PATCH v3 1/6] usb: dwc3: omap: Replace the extcon API Date: Mon, 16 Jan 2017 21:36:57 +0900 Message-id: <1484570222-30522-2-git-send-email-cw00.choi@samsung.com> X-Mailer: git-send-email 1.8.0 In-reply-to: <1484570222-30522-1-git-send-email-cw00.choi@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrEKsWRmVeSWpSXmKPExsWy7bCmrm7lvpoIg5u7DC2OtT1ht5h44wqL xfUvz1ktmhevZ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fE1VovLu+awWcxe0s9isWhZK7MDh8emVZ1sHvvnrmH32Lyk3qNvyypG j8+b5AJYo9xsMlITU1KLFFLzkvNTMvPSbZVCQ9x0LZQU8hJzU22VInR9Q4KUFMoSc0qBPCMD NODgHOAerKRvl+CWMX9lbMF7kYqXT7axNTBeEOxi5OSQEDCR2Ne9lx3CFpO4cG89WxcjF4eQ wFJGia2/V7JAOD8YJeYtm8YCUsUmoCWx/8UNoCoODhEBA4m2G2IgYWaB3YwSa04ygdjCAvYS lzpPsoCUsAioSrzbAFbCK+AqsWfXL0aIXXISH/Y8Ygcp4RRwk1je4woSFgIqWfWtl3ECI+8C RoZVjBKpBckFxUnpuYZ5qeV6xYm5xaV56XrJ+bmbGMFB/UxqB+PBXe6HGAU4GJV4eBfsqI4Q Yk0sK67MPcQowcGsJMLrvrMmQog3JbGyKrUoP76oNCe1+BCjKdBZE5mlRJPzgRGXVxJvaGJu Ym5sYGFuaWlipCTO2zj7WbiQQHpiSWp2ampBahFMHxMHp1QD4/FoyUkbL61vtpynM585/5jT GZP0b0z+Kd21hQf386xdMCXQePqupM2zJm0/m3W9YoW9ynrpyZqL+qN9te+c8lyY/7nuqfvO kt9Mh0913SuZFhtcyyB8c+709e1Pwjt/bXB5Xr/ppVKRpOF5R+PsUzErTZ9lX9lzYGvaOxWT mG+PHL6cT2mZ8l+JpTgj0VCLuag4EQDKGx0YgAIAAA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170116123713epcas1p1ebe3e43a7a3cf20c0981966842a3992f X-Msg-Generator: CA X-Sender-IP: 203.254.230.26 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: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-HopCount: 7 X-CMS-RootMailID: 20170116123713epcas1p1ebe3e43a7a3cf20c0981966842a3992f X-RootMTR: 20170116123713epcas1p1ebe3e43a7a3cf20c0981966842a3992f References: <1484570222-30522-1-git-send-email-cw00.choi@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170116_043736_524152_2A11BFFF X-CRM114-Status: GOOD ( 12.70 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Chanwoo Choi , chanwoo@kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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() Cc: linux-omap@vger.kernel.org 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 eb1b9cb3f9d1..2092e46b1380 100644 --- a/drivers/usb/dwc3/dwc3-omap.c +++ b/drivers/usb/dwc3/dwc3-omap.c @@ -426,20 +426,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; @@ -528,17 +528,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); enable_irq(omap->irq); 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); @@ -550,8 +546,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); disable_irq(omap->irq); of_platform_depopulate(omap->dev);