Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a971df0b authored by Rafał Miłecki's avatar Rafał Miłecki Committed by Kalle Valo
Browse files

bcma: use (get|put)_device when probing/removing device driver



This allows tracking device state and e.g. makes devm work as expected.

Signed-off-by: default avatarRafał Miłecki <rafal@milecki.pl>
Cc: Stable <stable@vger.kernel.org>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 2a2a5d18
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -633,8 +633,11 @@ static int bcma_device_probe(struct device *dev)
					       drv);
	int err = 0;

	get_device(dev);
	if (adrv->probe)
		err = adrv->probe(core);
	if (err)
		put_device(dev);

	return err;
}
@@ -647,6 +650,7 @@ static int bcma_device_remove(struct device *dev)

	if (adrv->remove)
		adrv->remove(core);
	put_device(dev);

	return 0;
}