Commit 3085de8d authored by Florian Fainelli's avatar Florian Fainelli Committed by Greg Kroah-Hartman

phy: usb: phy-brcm-usb: Remove sysfs attributes upon driver removal

[ Upstream commit d9e10082 ]

We are not destroying the sysfs attribute groupe we registered during
the probe function which will make subsequent probe calls to that
driver fail. Correct that with adding a remove function which only
removes those attributes since the reference counting on clocks did its
job already.

Fixes: 415060b2 ("phy: usb: phy-brcm-usb: Add ability to force DRD mode to host or device")
Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 2ca11301
...@@ -378,6 +378,13 @@ static int brcm_usb_phy_probe(struct platform_device *pdev) ...@@ -378,6 +378,13 @@ static int brcm_usb_phy_probe(struct platform_device *pdev)
return 0; return 0;
} }
static int brcm_usb_phy_remove(struct platform_device *pdev)
{
sysfs_remove_group(&pdev->dev.kobj, &brcm_usb_phy_group);
return 0;
}
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
static int brcm_usb_phy_suspend(struct device *dev) static int brcm_usb_phy_suspend(struct device *dev)
{ {
...@@ -443,6 +450,7 @@ MODULE_DEVICE_TABLE(of, brcm_usb_dt_ids); ...@@ -443,6 +450,7 @@ MODULE_DEVICE_TABLE(of, brcm_usb_dt_ids);
static struct platform_driver brcm_usb_driver = { static struct platform_driver brcm_usb_driver = {
.probe = brcm_usb_phy_probe, .probe = brcm_usb_phy_probe,
.remove = brcm_usb_phy_remove,
.driver = { .driver = {
.name = "brcmstb-usb-phy", .name = "brcmstb-usb-phy",
.owner = THIS_MODULE, .owner = THIS_MODULE,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment