Skip to content

Commit

Permalink
phy: usb: phy-brcm-usb: Remove sysfs attributes upon driver removal
Browse files Browse the repository at this point in the history
[ Upstream commit d9e100829fca6cbd270d7e005b0c0bb2d14924b8 ]

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: 415060b ("phy: usb: phy-brcm-usb: Add ability to force DRD mode to host or device")
Signed-off-by: Florian Fainelli <[email protected]>
Signed-off-by: Kishon Vijay Abraham I <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
ffainelli authored and gregkh committed Jan 27, 2020
1 parent 2ca1130 commit 3085de8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/phy/broadcom/phy-brcm-usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,13 @@ static int brcm_usb_phy_probe(struct platform_device *pdev)
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
static int brcm_usb_phy_suspend(struct device *dev)
{
Expand Down Expand Up @@ -443,6 +450,7 @@ MODULE_DEVICE_TABLE(of, brcm_usb_dt_ids);

static struct platform_driver brcm_usb_driver = {
.probe = brcm_usb_phy_probe,
.remove = brcm_usb_phy_remove,
.driver = {
.name = "brcmstb-usb-phy",
.owner = THIS_MODULE,
Expand Down

0 comments on commit 3085de8

Please sign in to comment.