diff options
author | Rafał Miłecki <rafal@milecki.pl> | 2017-01-28 14:31:22 +0100 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2017-01-31 09:27:09 +0200 |
commit | a971df0b9d04674e325346c17de9a895425ca5e1 (patch) | |
tree | eda823e66ba32740c28a8ce4113b27caaa969423 /drivers/bcma/main.c | |
parent | 2a2a5d1835b6f0baa0e207426d3c79eefd32e253 (diff) | |
download | talos-op-linux-a971df0b9d04674e325346c17de9a895425ca5e1.tar.gz talos-op-linux-a971df0b9d04674e325346c17de9a895425ca5e1.zip |
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/main.c')
-rw-r--r-- | drivers/bcma/main.c | 4 |
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; } |