From patchwork Wed Nov 30 05:57:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanwoo Choi X-Patchwork-Id: 9453681 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 DDCD760756 for ; Wed, 30 Nov 2016 05:59:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D0248283D3 for ; Wed, 30 Nov 2016 05:59:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C420B283F8; Wed, 30 Nov 2016 05:59:57 +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 5C730283D3 for ; Wed, 30 Nov 2016 05:59:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756466AbcK3F6N (ORCPT ); Wed, 30 Nov 2016 00:58:13 -0500 Received: from mailout4.samsung.com ([203.254.224.34]:60608 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755359AbcK3F6H (ORCPT ); Wed, 30 Nov 2016 00:58:07 -0500 Received: from epcpsbgm1new.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OHF02NLLXW1ZE30@mailout4.samsung.com>; Wed, 30 Nov 2016 14:57:43 +0900 (KST) X-AuditID: cbfee61a-f79916d0000062de-f7-583e6a567d0d Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id EF.5F.25310.65A6E385; Wed, 30 Nov 2016 14:57:43 +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 09/12] usb: phy: omap-otg: Replace the extcon API Date: Wed, 30 Nov 2016 14:57:37 +0900 Message-id: <1480485460-2663-10-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+NgFtrCIsWRmVeSWpSXmKPExsVy+t9jAd3wLLsIg74JjBb/7yxitTjW9oTd YuKNKywW1788Z7VoXryezeLC0x42i02Pr7FaXN41h81i9pJ+FovPvUcYLba+fMdksWhZK7PF 1k17mS3+3LvDanF6d4nFz0PnmSy+7v3M5iDoseHRalaPJ5suMnpsWtXJ5rF/7hp2j81L6j02 vtvB5PHtzEQWj74tqxg9jt/YzuTxeZNcAFeUm01GamJKapFCal5yfkpmXrqtUmiIm66FkkJe Ym6qrVKErm9IkJJCWWJOKZBnZIAGHJwD3IOV9O0S3DIePHvKXvBboOLJ86PMDYzb+LoYOTkk BEwk7t+ewwZhi0lcuLceyObiEBJYyigxZecDFgjnB6PExO7LTCBVbAJaEvtf3ADrEBHwl9jR OAesiFngEZPElZfbWUASwgKOEuf7m4FsDg4WAVWJ3efVQExeAVeJ+U8dIJbJSXzY84gdJMwJ FJ70PQUkLCTgIrFm4WKmCYy8CxgZVjFKpBYkFxQnpeca5qWW6xUn5haX5qXrJefnbmIEx9gz qR2MB3e5H2IU4GBU4uGd0GcbIcSaWFZcmXuIUYKDWUmE1y3NLkKINyWxsiq1KD++qDQntfgQ oynQVROZpUST84Hxn1cSb2hibmJubGBhbmlpYqQkzts4+1m4kEB6YklqdmpqQWoRTB8TB6dU A2PWj1SLPu+AQ6tvbH/GxSxZ2bsx6DbnBlV+AdfPnQwV7etfdJ33M4+0OOr6Zx8HG0PzrNs3 5pl9+H7Nee9q0+sHambNYl0+/+HOXxuu+aUtSWOT51pvGq5o0zP99rE3Ru9V47L2smXdTGvS kDULV5vvOnfG7umTv7jsTeOz2/8mOT56xuT5ItuVWIozEg21mIuKEwEOg2ohxwIAAA== 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/phy/phy-omap-otg.c | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/drivers/usb/phy/phy-omap-otg.c b/drivers/usb/phy/phy-omap-otg.c index 6523af4f8f93..800d1d90753d 100644 --- a/drivers/usb/phy/phy-omap-otg.c +++ b/drivers/usb/phy/phy-omap-otg.c @@ -118,19 +118,19 @@ static int omap_otg_probe(struct platform_device *pdev) otg_dev->id_nb.notifier_call = omap_otg_id_notifier; otg_dev->vbus_nb.notifier_call = omap_otg_vbus_notifier; - ret = extcon_register_notifier(extcon, EXTCON_USB_HOST, &otg_dev->id_nb); + ret = devm_extcon_register_notifier(&pdev->dev, extcon, + EXTCON_USB_HOST, &otg_dev->id_nb); if (ret) return ret; - ret = extcon_register_notifier(extcon, EXTCON_USB, &otg_dev->vbus_nb); + ret = devm_extcon_register_notifier(&pdev->dev, extcon, + EXTCON_USB, &otg_dev->vbus_nb); if (ret) { - extcon_unregister_notifier(extcon, EXTCON_USB_HOST, - &otg_dev->id_nb); return ret; } - otg_dev->id = extcon_get_cable_state_(extcon, EXTCON_USB_HOST); - otg_dev->vbus = extcon_get_cable_state_(extcon, EXTCON_USB); + otg_dev->id = extcon_get_state(extcon, EXTCON_USB_HOST); + otg_dev->vbus = extcon_get_state(extcon, EXTCON_USB); omap_otg_set_mode(otg_dev); rev = readl(otg_dev->base); @@ -145,20 +145,8 @@ static int omap_otg_probe(struct platform_device *pdev) return 0; } -static int omap_otg_remove(struct platform_device *pdev) -{ - struct otg_device *otg_dev = platform_get_drvdata(pdev); - struct extcon_dev *edev = otg_dev->extcon; - - extcon_unregister_notifier(edev, EXTCON_USB_HOST, &otg_dev->id_nb); - extcon_unregister_notifier(edev, EXTCON_USB, &otg_dev->vbus_nb); - - return 0; -} - static struct platform_driver omap_otg_driver = { .probe = omap_otg_probe, - .remove = omap_otg_remove, .driver = { .name = "omap_otg", },