Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756711AbcK3F6c (ORCPT ); Wed, 30 Nov 2016 00:58:32 -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 S1756356AbcK3F6C (ORCPT ); Wed, 30 Nov 2016 00:58:02 -0500 X-AuditID: cbfee61a-f79916d0000062de-f5-583e6a56eab9 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 07/12] usb: sunxi: Uses the resource-managed extcon API when registering extcon notifier Date: Wed, 30 Nov 2016 14:57:35 +0900 Message-id: <1480485460-2663-8-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+NgFtrKIsWRmVeSWpSXmKPExsVy+t9jAd2wLLsIg0kH9S3+31nEanGs7Qm7 xcQbV1gsrn95zmrRvHg9m8WFpz1sFpseX2O1uLxrDpvF7CX9LBafe48wWmx9+Y7JYtGyVmaL rZv2Mlv8uXeH1eL07hKLn4fOM1l83fuZzUHQY8Oj1aweTzZdZPTYtKqTzWP/3DXsHpuX1Hts fLeDyePbmYksHn1bVjF6HL+xncnj8ya5AK4oN5uM1MSU1CKF1Lzk/JTMvHRbpdAQN10LJYW8 xNxUW6UIXd+QICWFssScUiDPyAANODgHuAcr6dsluGW8anUouMFT8WneWdYGxhNcXYycHBIC JhLvHp1jhLDFJC7cW8/WxcjFISSwlFFiW8cEZgjnB6PExO7LTCBVbAJaEvtf3GADsUUE/CV2 NM5hASliFnjEJHHl5XYWkISwQJZE17IHrCA2i4CqROfEP2DNvAIuEv2bZ7NBrJOT+LDnEXsX IwcHp4CrxKTvKSBhIaCSNQsXM01g5F3AyLCKUSK1ILmgOCk91zAvtVyvODG3uDQvXS85P3cT IzjKnkntYDy4y/0QowAHoxIP74Q+2wgh1sSy4srcQ4wSHMxKIrxuaXYRQrwpiZVVqUX58UWl OanFhxhNge6ayCwlmpwPTAB5JfGGJuYm5sYGFuaWliZGSuK8jbOfhQsJpCeWpGanphakFsH0 MXFwSjUw8h39dbkm8vg94xkPQ1s0423+v16yb9fcHc+3vFkop/l5l7R0zePwaW/CT/1Pv3tn y55/mirxxg84Ls6I2uNw98sypr1XrFZsq/4z9Zzukn172/buDluruGL3zW7TLd0aovwfJOKt zjYm1mQ7Lf7hMJUtyHAud9bfuleHo69UvN+1//rc9SXpN74osRRnJBpqMRcVJwIATMhDMsgC AAA= X-MTR: 20000000000000000@CPGS Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1570 Lines: 52 This patch just uses the resource-managed extcon API when registering the extcon notifier. Signed-off-by: Chanwoo Choi --- 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 1408245be18e..4b531551e49d 100644 --- a/drivers/usb/musb/sunxi.c +++ b/drivers/usb/musb/sunxi.c @@ -261,14 +261,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; @@ -277,9 +277,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); @@ -303,9 +300,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