Commit af4698be authored by Rosen Penev's avatar Rosen Penev Committed by Paolo Abeni
Browse files

net: ibm: emac: use devm for mutex_init



It seems since inception that mutex_destroy was never called for these
in _remove. Instead of handling this manually, just use devm for
simplicity.

Signed-off-by: default avatarRosen Penev <rosenp@gmail.com>
Reviewed-by: default avatarShannon Nelson <shannon.nelson@amd.com>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent a598f66d
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -3021,8 +3021,14 @@ static int emac_probe(struct platform_device *ofdev)
	SET_NETDEV_DEV(ndev, &ofdev->dev);

	/* Initialize some embedded data structures */
	mutex_init(&dev->mdio_lock);
	mutex_init(&dev->link_lock);
	err = devm_mutex_init(&ofdev->dev, &dev->mdio_lock);
	if (err)
		goto err_gone;

	err = devm_mutex_init(&ofdev->dev, &dev->link_lock);
	if (err)
		goto err_gone;

	spin_lock_init(&dev->lock);
	INIT_WORK(&dev->reset_work, emac_reset_work);