Skip to content

Commit

Permalink
bcma: use (get|put)_device when probing/removing device driver
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Rafał Miłecki authored and Kalle Valo committed Jan 31, 2017
1 parent 2a2a5d1 commit a971df0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/bcma/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -647,6 +650,7 @@ static int bcma_device_remove(struct device *dev)

if (adrv->remove)
adrv->remove(core);
put_device(dev);

return 0;
}
Expand Down

0 comments on commit a971df0

Please sign in to comment.