Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1532980

[PATCH 09/12] usb: phy: omap-otg: Replace the extcon API

From Chanwoo Choi <cw00.choi@samsung.com>
Newsgroups linux.kernel
Subject [PATCH 09/12] usb: phy: omap-otg: Replace the extcon API
Date 2016-11-30 07:00 +0100
Message-ID <sJ65Y-214-23@gated-at.bofh.it> (permalink)
References <sJ65X-214-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 <cw00.choi@samsung.com>
---
 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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/12] extcon: Replace the deprecated extcon API Chanwoo Choi <cw00.choi@samsung.com> - 2016-11-30 07:00 +0100
  [PATCH 09/12] usb: phy: omap-otg: Replace the extcon API Chanwoo Choi <cw00.choi@samsung.com> - 2016-11-30 07:00 +0100
    Re: [PATCH 09/12] usb: phy: omap-otg: Replace the extcon API Felipe Balbi <balbi@kernel.org> - 2016-11-30 11:50 +0100
  [PATCH 02/12] phy: sun4i-usb: Replace the deprecated extcon API Chanwoo Choi <cw00.choi@samsung.com> - 2016-11-30 07:10 +0100
  [PATCH 08/12] usb: phy: msm: Replace the extcon API Chanwoo Choi <cw00.choi@samsung.com> - 2016-11-30 07:10 +0100
    Re: [PATCH 08/12] usb: phy: msm: Replace the extcon API Felipe Balbi <balbi@kernel.org> - 2016-11-30 11:50 +0100
  [PATCH 12/12] usb: renesas_usbhs: Replace the deprecated extcon API Chanwoo Choi <cw00.choi@samsung.com> - 2016-11-30 07:10 +0100
    Re: [PATCH 12/12] usb: renesas_usbhs: Replace the deprecated extcon API Felipe Balbi <balbi@kernel.org> - 2016-11-30 11:50 +0100
    RE: [PATCH 12/12] usb: renesas_usbhs: Replace the deprecated extcon  API Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> - 2016-12-06 02:40 +0100
  [PATCH 10/12] usb: phy: qcom-8x16-usb: Replace the extcon API Chanwoo Choi <cw00.choi@samsung.com> - 2016-11-30 07:10 +0100
    Re: [PATCH 10/12] usb: phy: qcom-8x16-usb: Replace the extcon API Felipe Balbi <balbi@kernel.org> - 2016-11-30 11:50 +0100
  [PATCH 06/12] usb: dwc3: omap: Replace the extcon API Chanwoo Choi <cw00.choi@samsung.com> - 2016-11-30 07:10 +0100
    Re: [PATCH 06/12] usb: dwc3: omap: Replace the extcon API Felipe Balbi <balbi@kernel.org> - 2016-11-30 11:40 +0100
      Re: [PATCH 06/12] usb: dwc3: omap: Replace the extcon API Chanwoo Choi <cw00.choi@samsung.com> - 2016-12-02 09:00 +0100
        Re: [PATCH 06/12] usb: dwc3: omap: Replace the extcon API Felipe Balbi <balbi@kernel.org> - 2016-12-02 10:10 +0100
          Re: [PATCH 06/12] usb: dwc3: omap: Replace the extcon API Chanwoo Choi <cwchoi00@gmail.com> - 2016-12-02 14:30 +0100

csiph-web