Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 874c9cc9 authored by Chanwoo Choi's avatar Chanwoo Choi Committed by Felipe Balbi
Browse files

usb: phy: qcom-8x16-usb: Replace the extcon API



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: default avatarChanwoo Choi <cw00.choi@samsung.com>
Acked-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent e61bebde
Loading
Loading
Loading
Loading
+4 −9
Original line number Original line Diff line number Diff line
@@ -187,7 +187,7 @@ static int phy_8x16_init(struct usb_phy *phy)
	val = ULPI_PWR_OTG_COMP_DISABLE;
	val = ULPI_PWR_OTG_COMP_DISABLE;
	usb_phy_io_write(phy, val, ULPI_SET(ULPI_PWR_CLK_MNG_REG));
	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)
	if (state)
		phy_8x16_vbus_on(qphy);
		phy_8x16_vbus_on(qphy);
	else
	else
@@ -316,23 +316,20 @@ static int phy_8x16_probe(struct platform_device *pdev)
		goto off_clks;
		goto off_clks;


	qphy->vbus_notify.notifier_call = phy_8x16_vbus_notify;
	qphy->vbus_notify.notifier_call = phy_8x16_vbus_notify;
	ret = extcon_register_notifier(qphy->vbus_edev, EXTCON_USB,
	ret = devm_extcon_register_notifier(&pdev->dev, qphy->vbus_edev,
				       &qphy->vbus_notify);
					EXTCON_USB, &qphy->vbus_notify);
	if (ret < 0)
	if (ret < 0)
		goto off_power;
		goto off_power;


	ret = usb_add_phy_dev(&qphy->phy);
	ret = usb_add_phy_dev(&qphy->phy);
	if (ret)
	if (ret)
		goto off_extcon;
		goto off_power;


	qphy->reboot_notify.notifier_call = phy_8x16_reboot_notify;
	qphy->reboot_notify.notifier_call = phy_8x16_reboot_notify;
	register_reboot_notifier(&qphy->reboot_notify);
	register_reboot_notifier(&qphy->reboot_notify);


	return 0;
	return 0;


off_extcon:
	extcon_unregister_notifier(qphy->vbus_edev, EXTCON_USB,
				   &qphy->vbus_notify);
off_power:
off_power:
	regulator_bulk_disable(ARRAY_SIZE(qphy->regulator), qphy->regulator);
	regulator_bulk_disable(ARRAY_SIZE(qphy->regulator), qphy->regulator);
off_clks:
off_clks:
@@ -347,8 +344,6 @@ static int phy_8x16_remove(struct platform_device *pdev)
	struct phy_8x16 *qphy = platform_get_drvdata(pdev);
	struct phy_8x16 *qphy = platform_get_drvdata(pdev);


	unregister_reboot_notifier(&qphy->reboot_notify);
	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
	 * Ensure that D+/D- lines are routed to uB connector, so