Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756613AbcK3F6X (ORCPT ); Wed, 30 Nov 2016 00:58:23 -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 X-AuditID: cbfee61a-f79916d0000062de-f7-583e6a567d0d 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-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2107 Lines: 62 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 --- 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", }, -- 1.9.1