Commit 79a7ff14 authored by Rafał Miłecki's avatar Rafał Miłecki Committed by Greg Kroah-Hartman

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

commit a971df0b upstream.

This allows tracking device state and e.g. makes devm work as expected.
Signed-off-by: default avatarRafał Miłecki <rafal@milecki.pl>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5a1f03f1
...@@ -640,8 +640,11 @@ static int bcma_device_probe(struct device *dev) ...@@ -640,8 +640,11 @@ static int bcma_device_probe(struct device *dev)
drv); drv);
int err = 0; int err = 0;
get_device(dev);
if (adrv->probe) if (adrv->probe)
err = adrv->probe(core); err = adrv->probe(core);
if (err)
put_device(dev);
return err; return err;
} }
...@@ -654,6 +657,7 @@ static int bcma_device_remove(struct device *dev) ...@@ -654,6 +657,7 @@ static int bcma_device_remove(struct device *dev)
if (adrv->remove) if (adrv->remove)
adrv->remove(core); adrv->remove(core);
put_device(dev);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment