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

Commit ccdce25b authored by Jack Pham's avatar Jack Pham
Browse files

usb: xhci-msm-hsic: Disable wakeup properly upon remove



In mxhci_hsic_remove(), the call to device_init_wakeup(dev, 0) only
disables wakeup capability but does not remove the wakeup source. This
could lead to a scenario in which the wakeup source is still active
after the driver is unbound (and the device is still registered). Fix
this by calling device_wakeup_disable() instead.

While here, also remove the unused wakeup_source instance, as this
driver is only using the built-in one that's part of the device struct.

Change-Id: I42a0a6af0c1d58ab5691fe7beaf0143dcfde66cb
Signed-off-by: default avatarJack Pham <jackp@codeaurora.org>
parent 219364c5
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -92,8 +92,6 @@ struct mxhci_hsic_hcd {
	struct regulator	*hsic_vddcx;
	struct regulator	*hsic_gdsc;

	struct wakeup_source	ws;

	u32			bus_perf_client;
	struct msm_bus_scale_pdata	*bus_scale_table;
	struct work_struct	bus_vote_w;
@@ -1137,7 +1135,6 @@ static int mxhci_hsic_probe(struct platform_device *pdev)
	mxhci_hsic_ulpi_write(mxhci, 0x01, MSM_HSIC_CFG_SET);

	device_init_wakeup(&pdev->dev, 1);
	wakeup_source_init(&mxhci->ws, dev_name(&pdev->dev));
	pm_stay_awake(mxhci->dev);

	pm_runtime_set_active(&pdev->dev);
@@ -1211,11 +1208,10 @@ static int mxhci_hsic_remove(struct platform_device *pdev)

	destroy_workqueue(mxhci->wq);

	device_init_wakeup(&pdev->dev, 0);
	device_wakeup_disable(&pdev->dev);
	mxhci_hsic_init_vddcx(mxhci, 0);
	mxhci_hsic_init_clocks(mxhci, 0);
	mxhci_msm_config_gdsc(mxhci, 0);
	wakeup_source_trash(&mxhci->ws);
	usb_put_hcd(hcd);

	return 0;