diff options
author | Arun Parameswaran <arun.parameswaran@broadcom.com> | 2018-08-02 02:53:50 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-08-02 23:36:49 +0200 |
commit | 0fe2cd564c35ce322830967e24693a36bf30cc7f (patch) | |
tree | 1a024bd22c4eb888600235b81d65d7d9fd042782 /drivers/net/phy | |
parent | net: phy: Disable external master access in bcm mdio mux driver (diff) | |
download | linux-0fe2cd564c35ce322830967e24693a36bf30cc7f.tar.xz linux-0fe2cd564c35ce322830967e24693a36bf30cc7f.zip |
net: phy: Use devm api for mdio bus allocation in bcm iproc mdio mux
Use devm_mdiobus_alloc() instead of mdiobus_alloc() in the Broadcom
iProc mdio mux driver.
Signed-off-by: Arun Parameswaran <arun.parameswaran@broadcom.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy')
-rw-r--r-- | drivers/net/phy/mdio-mux-bcm-iproc.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/net/phy/mdio-mux-bcm-iproc.c b/drivers/net/phy/mdio-mux-bcm-iproc.c index 4a253c28edbc..e6146b439b45 100644 --- a/drivers/net/phy/mdio-mux-bcm-iproc.c +++ b/drivers/net/phy/mdio-mux-bcm-iproc.c @@ -198,7 +198,7 @@ static int mdio_mux_iproc_probe(struct platform_device *pdev) return PTR_ERR(md->base); } - md->mii_bus = mdiobus_alloc(); + md->mii_bus = devm_mdiobus_alloc(&pdev->dev); if (!md->mii_bus) { dev_err(&pdev->dev, "mdiomux bus alloc failed\n"); return -ENOMEM; @@ -217,7 +217,7 @@ static int mdio_mux_iproc_probe(struct platform_device *pdev) rc = mdiobus_register(bus); if (rc) { dev_err(&pdev->dev, "mdiomux registration failed\n"); - goto out; + return rc; } platform_set_drvdata(pdev, md); @@ -236,8 +236,6 @@ static int mdio_mux_iproc_probe(struct platform_device *pdev) out_register: mdiobus_unregister(bus); -out: - mdiobus_free(bus); return rc; } @@ -247,7 +245,6 @@ static int mdio_mux_iproc_remove(struct platform_device *pdev) mdio_mux_uninit(md->mux_handle); mdiobus_unregister(md->mii_bus); - mdiobus_free(md->mii_bus); return 0; } |