Commit bb1d1ce8 authored by Chanwoo Choi's avatar Chanwoo Choi Committed by Greg Kroah-Hartman

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: default avatarChanwoo Choi <cw00.choi@samsung.com>
Acked-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: default avatarBin Liu <b-liu@ti.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 486fc20a
...@@ -251,14 +251,14 @@ static int sunxi_musb_init(struct musb *musb) ...@@ -251,14 +251,14 @@ static int sunxi_musb_init(struct musb *musb)
writeb(SUNXI_MUSB_VEND0_PIO_MODE, musb->mregs + SUNXI_MUSB_VEND0); writeb(SUNXI_MUSB_VEND0_PIO_MODE, musb->mregs + SUNXI_MUSB_VEND0);
/* Register notifier before calling phy_init() */ /* Register notifier before calling phy_init() */
ret = extcon_register_notifier(glue->extcon, EXTCON_USB_HOST, ret = devm_extcon_register_notifier(glue->dev, glue->extcon,
&glue->host_nb); EXTCON_USB_HOST, &glue->host_nb);
if (ret) if (ret)
goto error_reset_assert; goto error_reset_assert;
ret = phy_init(glue->phy); ret = phy_init(glue->phy);
if (ret) if (ret)
goto error_unregister_notifier; goto error_reset_assert;
musb->isr = sunxi_musb_interrupt; musb->isr = sunxi_musb_interrupt;
...@@ -267,9 +267,6 @@ static int sunxi_musb_init(struct musb *musb) ...@@ -267,9 +267,6 @@ static int sunxi_musb_init(struct musb *musb)
return 0; return 0;
error_unregister_notifier:
extcon_unregister_notifier(glue->extcon, EXTCON_USB_HOST,
&glue->host_nb);
error_reset_assert: error_reset_assert:
if (test_bit(SUNXI_MUSB_FL_HAS_RESET, &glue->flags)) if (test_bit(SUNXI_MUSB_FL_HAS_RESET, &glue->flags))
reset_control_assert(glue->rst); reset_control_assert(glue->rst);
...@@ -293,9 +290,6 @@ static int sunxi_musb_exit(struct musb *musb) ...@@ -293,9 +290,6 @@ static int sunxi_musb_exit(struct musb *musb)
phy_exit(glue->phy); 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)) if (test_bit(SUNXI_MUSB_FL_HAS_RESET, &glue->flags))
reset_control_assert(glue->rst); reset_control_assert(glue->rst);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment