From: Chanwoo Choi <cw00.choi@samsung.com> To: balbi@kernel.org Cc: kishon@ti.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org, cw00.choi@samsung.com, chanwoo@kernel.org, myungjoo.ham@samsung.com Subject: [PATCH v2 1/5] phy: qcom-usb-hs: Replace the extcon API Date: Thu, 03 Aug 2017 17:20:44 +0900 [thread overview] Message-ID: <1501748448-26821-2-git-send-email-cw00.choi@samsung.com> (raw) In-Reply-To: <1501748448-26821-1-git-send-email-cw00.choi@samsung.com> This patch uses the resource-managed extcon API for extcon_register_notifier() and replaces the deprecated extcon API as following: - (deprecated) extcon_get_cable_state_() -> extcon_get_state() Acked-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> --- drivers/phy/qualcomm/phy-qcom-usb-hs.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-usb-hs.c b/drivers/phy/qualcomm/phy-qcom-usb-hs.c index 4b20abc3ae2f..2d0c70b5589f 100644 --- a/drivers/phy/qualcomm/phy-qcom-usb-hs.c +++ b/drivers/phy/qualcomm/phy-qcom-usb-hs.c @@ -155,12 +155,12 @@ static int qcom_usb_hs_phy_power_on(struct phy *phy) } if (uphy->vbus_edev) { - state = extcon_get_cable_state_(uphy->vbus_edev, EXTCON_USB); + state = extcon_get_state(uphy->vbus_edev, EXTCON_USB); /* setup initial state */ qcom_usb_hs_phy_vbus_notifier(&uphy->vbus_notify, state, uphy->vbus_edev); - ret = extcon_register_notifier(uphy->vbus_edev, EXTCON_USB, - &uphy->vbus_notify); + ret = devm_extcon_register_notifier(&ulpi->dev, uphy->vbus_edev, + EXTCON_USB, &uphy->vbus_notify); if (ret) goto err_ulpi; } @@ -179,16 +179,8 @@ static int qcom_usb_hs_phy_power_on(struct phy *phy) static int qcom_usb_hs_phy_power_off(struct phy *phy) { - int ret; struct qcom_usb_hs_phy *uphy = phy_get_drvdata(phy); - if (uphy->vbus_edev) { - ret = extcon_unregister_notifier(uphy->vbus_edev, EXTCON_USB, - &uphy->vbus_notify); - if (ret) - return ret; - } - regulator_disable(uphy->v3p3); regulator_disable(uphy->v1p8); clk_disable_unprepare(uphy->sleep_clk); -- 1.9.1
WARNING: multiple messages have this Message-ID (diff)
From: cw00.choi@samsung.com (Chanwoo Choi) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 1/5] phy: qcom-usb-hs: Replace the extcon API Date: Thu, 03 Aug 2017 17:20:44 +0900 [thread overview] Message-ID: <1501748448-26821-2-git-send-email-cw00.choi@samsung.com> (raw) In-Reply-To: <1501748448-26821-1-git-send-email-cw00.choi@samsung.com> This patch uses the resource-managed extcon API for extcon_register_notifier() and replaces the deprecated extcon API as following: - (deprecated) extcon_get_cable_state_() -> extcon_get_state() Acked-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> --- drivers/phy/qualcomm/phy-qcom-usb-hs.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-usb-hs.c b/drivers/phy/qualcomm/phy-qcom-usb-hs.c index 4b20abc3ae2f..2d0c70b5589f 100644 --- a/drivers/phy/qualcomm/phy-qcom-usb-hs.c +++ b/drivers/phy/qualcomm/phy-qcom-usb-hs.c @@ -155,12 +155,12 @@ static int qcom_usb_hs_phy_power_on(struct phy *phy) } if (uphy->vbus_edev) { - state = extcon_get_cable_state_(uphy->vbus_edev, EXTCON_USB); + state = extcon_get_state(uphy->vbus_edev, EXTCON_USB); /* setup initial state */ qcom_usb_hs_phy_vbus_notifier(&uphy->vbus_notify, state, uphy->vbus_edev); - ret = extcon_register_notifier(uphy->vbus_edev, EXTCON_USB, - &uphy->vbus_notify); + ret = devm_extcon_register_notifier(&ulpi->dev, uphy->vbus_edev, + EXTCON_USB, &uphy->vbus_notify); if (ret) goto err_ulpi; } @@ -179,16 +179,8 @@ static int qcom_usb_hs_phy_power_on(struct phy *phy) static int qcom_usb_hs_phy_power_off(struct phy *phy) { - int ret; struct qcom_usb_hs_phy *uphy = phy_get_drvdata(phy); - if (uphy->vbus_edev) { - ret = extcon_unregister_notifier(uphy->vbus_edev, EXTCON_USB, - &uphy->vbus_notify); - if (ret) - return ret; - } - regulator_disable(uphy->v3p3); regulator_disable(uphy->v1p8); clk_disable_unprepare(uphy->sleep_clk); -- 1.9.1
next prev parent reply other threads:[~2017-08-03 8:20 UTC|newest] Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <CGME20170803082049epcas1p3ca6cb415ce40b24fa360f7155ea0829c@epcas1p3.samsung.com> 2017-08-03 8:20 ` [PATCH v2 0/5] usb: Replace the deprecated extcon API Chanwoo Choi 2017-08-03 8:20 ` Chanwoo Choi [not found] ` <CGME20170803082050epcas1p2d72847ff1a6c31a9ba281daeecd17b18@epcas1p2.samsung.com> 2017-08-03 8:20 ` Chanwoo Choi [this message] 2017-08-03 8:20 ` [PATCH v2 1/5] phy: qcom-usb-hs: Replace the " Chanwoo Choi [not found] ` <CGME20170803082050epcas1p3040420e1fef2186519f50a68f865e006@epcas1p3.samsung.com> 2017-08-03 8:20 ` [PATCH v2 2/5] phy: rockchip-inno-usb2: " Chanwoo Choi 2017-08-03 8:20 ` Chanwoo Choi [not found] ` <CGME20170803082050epcas1p179818a40e214e4ab5884f8a3bca657f8@epcas1p1.samsung.com> 2017-08-03 8:20 ` [PATCH v2 3/5] phy: phy-bcm-ns2-usbdrd: Replace the deprecated " Chanwoo Choi 2017-08-03 8:20 ` Chanwoo Choi [not found] ` <CGME20170803082050epcas1p2491eedf2f26510f55cd15ce777356fce@epcas1p2.samsung.com> 2017-08-03 8:20 ` [PATCH v2 4/5] usb: gadget: udc: " Chanwoo Choi 2017-08-03 8:20 ` Chanwoo Choi 2017-08-07 2:07 ` Chanwoo Choi 2017-08-07 2:07 ` Chanwoo Choi 2017-08-10 0:09 ` Chanwoo Choi 2017-08-10 0:09 ` Chanwoo Choi 2017-08-15 9:48 ` Felipe Balbi 2017-08-15 9:48 ` Felipe Balbi 2017-08-16 0:19 ` Chanwoo Choi 2017-08-16 0:19 ` Chanwoo Choi [not found] ` <CGME20170803082050epcas1p38d70b5df911a855708c891b659a56fce@epcas1p3.samsung.com> 2017-08-03 8:20 ` [PATCH v2 5/5] extcon: Remove deprecated extcon_set/get_cable_state_() Chanwoo Choi 2017-08-03 8:20 ` Chanwoo Choi 2017-08-16 1:52 ` [PATCH v2 0/5] usb: Replace the deprecated extcon API Chanwoo Choi 2017-08-16 1:52 ` Chanwoo Choi
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1501748448-26821-2-git-send-email-cw00.choi@samsung.com \ --to=cw00.choi@samsung.com \ --cc=balbi@kernel.org \ --cc=chanwoo@kernel.org \ --cc=gregkh@linuxfoundation.org \ --cc=kishon@ti.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-usb@vger.kernel.org \ --cc=myungjoo.ham@samsung.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.