aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorChanwoo Choi <cw00.choi@samsung.com>2017-02-01 21:30:21 -0600
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-02-03 10:05:11 +0100
commitbb1d1ce8c74ee967f578d5e4cae9b88d7344c12b (patch)
tree6981fb9813ccc21a522bb2b7fa08e1f30fec0556 /drivers/usb
parentusb: musb: da8xx: Fix host mode suspend (diff)
downloadlinux-dev-bb1d1ce8c74ee967f578d5e4cae9b88d7344c12b.tar.xz
linux-dev-bb1d1ce8c74ee967f578d5e4cae9b88d7344c12b.zip
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@samsung.com> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Bin Liu <b-liu@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/musb/sunxi.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/usb/musb/sunxi.c b/drivers/usb/musb/sunxi.c
index 64545de4871f..05cab67d4106 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);