summaryrefslogtreecommitdiffstats
path: root/drivers/bcma
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2017-01-28 08:31:22 -0500
committerKalle Valo <kvalo@codeaurora.org>2017-01-31 02:27:09 -0500
commita971df0b9d04674e325346c17de9a895425ca5e1 (patch)
treeeda823e66ba32740c28a8ce4113b27caaa969423 /drivers/bcma
parent2a2a5d1835b6f0baa0e207426d3c79eefd32e253 (diff)
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: Rafał Miłecki <rafal@milecki.pl> Cc: Stable <stable@vger.kernel.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.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)
633 drv); 633 drv);
634 int err = 0; 634 int err = 0;
635 635
636 get_device(dev);
636 if (adrv->probe) 637 if (adrv->probe)
637 err = adrv->probe(core); 638 err = adrv->probe(core);
639 if (err)
640 put_device(dev);
638 641
639 return err; 642 return err;
640} 643}
@@ -647,6 +650,7 @@ static int bcma_device_remove(struct device *dev)
647 650
648 if (adrv->remove) 651 if (adrv->remove)
649 adrv->remove(core); 652 adrv->remove(core);
653 put_device(dev);
650 654
651 return 0; 655 return 0;
652} 656}