mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
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 <[email protected]> Cc: Stable <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
This commit is contained in:
parent
2a2a5d1835
commit
a971df0b9d
1 changed files with 4 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue