summaryrefslogtreecommitdiffstats
path: root/drivers/bcma
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2017-01-28 14:31:22 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-03-12 06:37:30 +0100
commit79a7ff1443bd85c02786732080dff8d0696a0d11 (patch)
tree695fb236e67b9a4b7cc9c9bc15b282f0cfc722f6 /drivers/bcma
parent5a1f03f1ee9170f99760d7abcb68754f551b3187 (diff)
downloadlinux-stable-79a7ff1443bd85c02786732080dff8d0696a0d11.tar.gz
linux-stable-79a7ff1443bd85c02786732080dff8d0696a0d11.tar.bz2
linux-stable-79a7ff1443bd85c02786732080dff8d0696a0d11.zip
bcma: use (get|put)_device when probing/removing device driver
commit a971df0b9d04674e325346c17de9a895425ca5e1 upstream. This allows tracking device state and e.g. makes devm work as expected. Signed-off-by: Rafał Miłecki <rafal@milecki.pl> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/bcma')
-rw-r--r--drivers/bcma/main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c
index 59d8d0d14824..327f9e374b44 100644
--- a/drivers/bcma/main.c
+++ b/drivers/bcma/main.c
@@ -640,8 +640,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;
}
@@ -654,6 +657,7 @@ static int bcma_device_remove(struct device *dev)
if (adrv->remove)
adrv->remove(core);
+ put_device(dev);
return 0;
}