Skip to content

Commit

Permalink
net: mdio-mux: bcm-iproc: fix wrong getter and setter pair
Browse files Browse the repository at this point in the history
mdio_mux_iproc_probe() uses platform_set_drvdata() to store md pointer
in device, whereas mdio_mux_iproc_remove() restores md pointer by
dev_get_platdata(&pdev->dev). This leads to wrong resources release.

The patch replaces getter to platform_get_drvdata.

Fixes: 98bc865 ("net: mdio-mux: Add MDIO mux driver for iProc SoCs")
Signed-off-by: Anton Vasilyev <vasilyev@ispras.ru>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Anton Vasilyev authored and David S. Miller committed Jul 29, 2018
1 parent 9fc1202 commit b075340
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/phy/mdio-mux-bcm-iproc.c
Original file line number Diff line number Diff line change
@@ -218,7 +218,7 @@ static int mdio_mux_iproc_probe(struct platform_device *pdev)

static int mdio_mux_iproc_remove(struct platform_device *pdev)
{
struct iproc_mdiomux_desc *md = dev_get_platdata(&pdev->dev);
struct iproc_mdiomux_desc *md = platform_get_drvdata(pdev);

mdio_mux_uninit(md->mux_handle);
mdiobus_unregister(md->mii_bus);

0 comments on commit b075340

Please sign in to comment.