Skip to content

Commit

Permalink
mmc: sdio: Tidy error path in mmc_attach_sdio()
Browse files Browse the repository at this point in the history
The error path deletes the device by calling mmc_sdio_remove() which must
be called without the host claimed. Simplify the error path so it does just
that and add a comment about why we don't disable runtime PM.

Signed-off-by: Adrian Hunter <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
  • Loading branch information
ahunter6 authored and storulf committed Jun 20, 2017
1 parent bc55dcd commit 82e7edc
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions drivers/mmc/core/sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1159,15 +1159,14 @@ int mmc_attach_sdio(struct mmc_host *host)
return 0;


remove_added:
/* Remove without lock if the device has been added. */
mmc_sdio_remove(host);
mmc_claim_host(host);
remove:
/* And with lock if it hasn't been added. */
mmc_release_host(host);
if (host->card)
mmc_sdio_remove(host);
remove_added:
/*
* The devices are being deleted so it is not necessary to disable
* runtime PM.
*/
mmc_sdio_remove(host);
mmc_claim_host(host);
err:
mmc_detach_bus(host);
Expand Down

0 comments on commit 82e7edc

Please sign in to comment.