[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-id: <1483071550-8683-1-git-send-email-cw00.choi@samsung.com>
Date: Fri, 30 Dec 2016 13:19:10 +0900
From: Chanwoo Choi <cw00.choi@...sung.com>
To: b-liu@...com, gregkh@...uxfoundation.org
Cc: maxime.ripard@...e-electrons.com, wens@...e.org,
linux-usb@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, chanwoo@...nel.org,
Chanwoo Choi <cw00.choi@...sung.com>
Subject: [PATCH v2] usb: musb: sunxi: Uses the resource-managed extcon API when
registering extcon notifier
This patch just uses the resource-managed extcon API when registering
the extcon notifier.
Signed-off-by: Chanwoo Choi <cw00.choi@...sung.com>
Acked-by: Maxime Ripard <maxime.ripard@...e-electrons.com>
Acked-by: Bin Liu <b-liu@...com>
---
Changes from v1:
- Rebase this patch based on v4.10-rc1.
- Add acked-by tag from Maxime Ripard and Bin Lin.
- Drop the phy/power-supply/chipidea patches.
drivers/usb/musb/sunxi.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/drivers/usb/musb/sunxi.c b/drivers/usb/musb/sunxi.c
index d0be0eadd0d9..2332294dee0f 100644
--- a/drivers/usb/musb/sunxi.c
+++ b/drivers/usb/musb/sunxi.c
@@ -251,14 +251,14 @@ static int sunxi_musb_init(struct musb *musb)
writeb(SUNXI_MUSB_VEND0_PIO_MODE, musb->mregs + SUNXI_MUSB_VEND0);
/* Register notifier before calling phy_init() */
- ret = extcon_register_notifier(glue->extcon, EXTCON_USB_HOST,
- &glue->host_nb);
+ ret = devm_extcon_register_notifier(glue->dev, glue->extcon,
+ EXTCON_USB_HOST, &glue->host_nb);
if (ret)
goto error_reset_assert;
ret = phy_init(glue->phy);
if (ret)
- goto error_unregister_notifier;
+ goto error_reset_assert;
musb->isr = sunxi_musb_interrupt;
@@ -267,9 +267,6 @@ static int sunxi_musb_init(struct musb *musb)
return 0;
-error_unregister_notifier:
- extcon_unregister_notifier(glue->extcon, EXTCON_USB_HOST,
- &glue->host_nb);
error_reset_assert:
if (test_bit(SUNXI_MUSB_FL_HAS_RESET, &glue->flags))
reset_control_assert(glue->rst);
@@ -293,9 +290,6 @@ static int sunxi_musb_exit(struct musb *musb)
phy_exit(glue->phy);
- extcon_unregister_notifier(glue->extcon, EXTCON_USB_HOST,
- &glue->host_nb);
-
if (test_bit(SUNXI_MUSB_FL_HAS_RESET, &glue->flags))
reset_control_assert(glue->rst);
--
1.9.1
Powered by blists - more mailing lists