Skip to content

Commit d9e1008

Browse files
ffainellikishon
authored andcommitted
phy: usb: phy-brcm-usb: Remove sysfs attributes upon driver removal
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 <f.fainelli@gmail.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
1 parent d4a36e8 commit d9e1008

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎drivers/phy/broadcom/phy-brcm-usb.c‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,13 @@ static int brcm_usb_phy_probe(struct platform_device *pdev)
376376
return PTR_ERR_OR_ZERO(phy_provider);
377377
}
378378

379+
static int brcm_usb_phy_remove(struct platform_device *pdev)
380+
{
381+
sysfs_remove_group(&pdev->dev.kobj, &brcm_usb_phy_group);
382+
383+
return 0;
384+
}
385+
379386
#ifdef CONFIG_PM_SLEEP
380387
static int brcm_usb_phy_suspend(struct device *dev)
381388
{
@@ -441,6 +448,7 @@ MODULE_DEVICE_TABLE(of, brcm_usb_dt_ids);
441448

442449
static struct platform_driver brcm_usb_driver = {
443450
.probe = brcm_usb_phy_probe,
451+
.remove = brcm_usb_phy_remove,
444452
.driver = {
445453
.name = "brcmstb-usb-phy",
446454
.owner = THIS_MODULE,

0 commit comments

Comments
 (0)