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

Commit 04b8490b authored by Mayank Rana's avatar Mayank Rana
Browse files

usb: phy: Don't free phy memory from remove() API



USB PHY drivers are using managed allocation (i.e. devm_kzalloc())
with its probe() API. Hence remove usage of kfree() from remove()
API as allocated memory would be freed on driver detach itself.
This avoids multiple free of allocated PHY related memory.

Change-Id: Ia89bebe3d9d4d6020a5c72247e0f2970a1e2dd94
Signed-off-by: default avatarMayank Rana <mrana@codeaurora.org>
parent b93572a7
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -682,9 +682,6 @@ static int msm_hsphy_remove(struct platform_device *pdev)

	msm_hsphy_enable_clocks(phy, false);
	msm_hsphy_enable_power(phy, false);

	kfree(phy);

	return 0;
}

+0 −1
Original line number Diff line number Diff line
@@ -1091,7 +1091,6 @@ static int msm_ssphy_qmp_remove(struct platform_device *pdev)
	usb_remove_phy(&phy->phy);
	msm_ssphy_qmp_enable_clks(phy, false);
	msm_ssusb_qmp_ldo_enable(phy, 0);
	kfree(phy);
	return 0;
}