summaryrefslogtreecommitdiff
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:41:52 +0100
commit178d07a0b8c4dc1f6e8a924f04231a5cf9cf86d1 (patch)
tree3ffda5362e786996e5c318e9b8824c9f7e6fe3de /drivers/bcma
parent6f9c02ab9d0d5aefa15953ad3d55912e3a7abb57 (diff)
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 2c1798e38abd..38688236b3cd 100644
--- a/drivers/bcma/main.c
+++ b/drivers/bcma/main.c
@@ -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;
}