Skip to content

Commit

Permalink
mmc: pwrseq: Fix error code propagation in mmc_pwrseq_simple_alloc()
Browse files Browse the repository at this point in the history
If the struct mmc_pwrseq_match .alloc function used to allocate a
struct mmc_pwrseq fails, the error is propagated to mmc_of_parse().

But instead of returning the error code in pwrseq, host->pwrseq is
returned which will always be 0. So mmc_of_parse() succeeds even if
the pwrseq .alloc function failed and host->pwrseq is NULL.

This makes the SDIO device to not be powered if the power sequencing
.alloc functions wants to be deferred due a missing resource because
the mmc controller driver probe did wrongly succeed.

Fixes: 0f12a0c ("mmc: pwrseq: simplify alloc/free hooks")
Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
  • Loading branch information
Javier Martinez Canillas authored and Ulf Hansson committed Apr 17, 2015
1 parent 4fc8adc commit 636efbc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mmc/core/pwrseq.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ int mmc_pwrseq_alloc(struct mmc_host *host)

pwrseq = match->alloc(host, &pdev->dev);
if (IS_ERR(pwrseq)) {
ret = PTR_ERR(host->pwrseq);
ret = PTR_ERR(pwrseq);
goto err;
}

Expand Down

0 comments on commit 636efbc

Please sign in to comment.