net: mdio-mux: bcm-iproc: fix wrong getter and setter pair
authorAnton Vasilyev <vasilyev@ispras.ru>
Fri, 27 Jul 2018 15:57:47 +0000 (18:57 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Aug 2018 05:50:44 +0000 (07:50 +0200)
[ Upstream commit b0753408aadf32c7ece9e6b765017881e54af833 ]

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: 98bc865a1ec8 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/phy/mdio-mux-bcm-iproc.c

index 0831b7142df7a334b889296688cc3218d8efa2a1..0c5b68e7da51aa8d0c7c73e7c6b3cc632b1e3510 100644 (file)
@@ -218,7 +218,7 @@ out:
 
 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);