Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756985AbcK3GAV (ORCPT ); Wed, 30 Nov 2016 01:00:21 -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 S1756403AbcK3F6K (ORCPT ); Wed, 30 Nov 2016 00:58:10 -0500 X-AuditID: cbfee61a-f79916d0000062de-f8-583e6a576bba 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 10/12] usb: phy: qcom-8x16-usb: Replace the extcon API Date: Wed, 30 Nov 2016 14:57:38 +0900 Message-id: <1480485460-2663-11-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+NgFtrGIsWRmVeSWpSXmKPExsVy+t9jAd3wLLsIg60P+S3+31nEanGs7Qm7 xcQbV1gsrn95zmrRvHg9m8WFpz1sFpseX2O1uLxrDpvF7CX9LBafe48wWmx9+Y7JYtGyVmaL rZv2Mlv8uXeH1eL07hKLn4fOM1l83fuZzUHQY8Oj1aweTzZdZPTYtKqTzWP/3DXsHpuX1Hts fLeDyePbmYksHn1bVjF6HL+xncnj8ya5AK4oN5uM1MSU1CKF1Lzk/JTMvHRbpdAQN10LJYW8 xNxUW6UIXd+QICWFssScUiDPyAANODgHuAcr6dsluGV8mtrDXrBToGLZ1kusDYwfebsYOTkk BEwk5m7dxw5hi0lcuLeerYuRi0NIYCmjRO+a/8wQzg9GiYndl5lAqtgEtCT2v7jBBmKLCPhL 7GicwwJSxCzwiEniysvtLCAJYQE3iVtdU5lBbBYBVYkZX86xgti8Aq4Sze3dUOvkJD7seQRk c3BwAsUnfU8BCQsJuEisWbiYaQIj7wJGhlWMEqkFyQXFSem5hnmp5XrFibnFpXnpesn5uZsY wXH2TGoH48Fd7ocYBTgYlXh4J/TZRgixJpYVV+YeYpTgYFYS4XVLs4sQ4k1JrKxKLcqPLyrN SS0+xGgKdNdEZinR5HxgCsgriTc0MTcxNzawMLe0NDFSEudtnP0sXEggPbEkNTs1tSC1CKaP iYNTqoExtmXzweeqYmcTucXPvuU6d/DP1jscxj3zF0qflPCanPhGcIKWoE7wXK0jW6T2VOqr xZ2fof1mQdMS97A79/Y3KHrMylmQqRn2ufjJQcuTzreyn63yPF0pGH1idcNmrYKvL8LYo5Si Zt9PPO/+80Xlz2Vux4Rmy+5YMW1bwvLjwatPaFuY6ifnKrEUZyQaajEXFScCAJy46LXJAgAA X-MTR: 20000000000000000@CPGS Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2043 Lines: 60 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 --- drivers/usb/phy/phy-qcom-8x16-usb.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/usb/phy/phy-qcom-8x16-usb.c b/drivers/usb/phy/phy-qcom-8x16-usb.c index d8593adb3621..fdf686398772 100644 --- a/drivers/usb/phy/phy-qcom-8x16-usb.c +++ b/drivers/usb/phy/phy-qcom-8x16-usb.c @@ -187,7 +187,7 @@ static int phy_8x16_init(struct usb_phy *phy) val = ULPI_PWR_OTG_COMP_DISABLE; usb_phy_io_write(phy, val, ULPI_SET(ULPI_PWR_CLK_MNG_REG)); - state = extcon_get_cable_state_(qphy->vbus_edev, EXTCON_USB); + state = extcon_get_state(qphy->vbus_edev, EXTCON_USB); if (state) phy_8x16_vbus_on(qphy); else @@ -316,23 +316,20 @@ static int phy_8x16_probe(struct platform_device *pdev) goto off_clks; qphy->vbus_notify.notifier_call = phy_8x16_vbus_notify; - ret = extcon_register_notifier(qphy->vbus_edev, EXTCON_USB, - &qphy->vbus_notify); + ret = devm_extcon_register_notifier(&pdev->dev, qphy->vbus_edev, + EXTCON_USB, &qphy->vbus_notify); if (ret < 0) goto off_power; ret = usb_add_phy_dev(&qphy->phy); if (ret) - goto off_extcon; + goto off_power; qphy->reboot_notify.notifier_call = phy_8x16_reboot_notify; register_reboot_notifier(&qphy->reboot_notify); return 0; -off_extcon: - extcon_unregister_notifier(qphy->vbus_edev, EXTCON_USB, - &qphy->vbus_notify); off_power: regulator_bulk_disable(ARRAY_SIZE(qphy->regulator), qphy->regulator); off_clks: @@ -347,8 +344,6 @@ static int phy_8x16_remove(struct platform_device *pdev) struct phy_8x16 *qphy = platform_get_drvdata(pdev); unregister_reboot_notifier(&qphy->reboot_notify); - extcon_unregister_notifier(qphy->vbus_edev, EXTCON_USB, - &qphy->vbus_notify); /* * Ensure that D+/D- lines are routed to uB connector, so -- 1.9.1