Skip to content

Commit

Permalink
mmc: omap_hsmmc: stop using ->enable|disable() callbacks
Browse files Browse the repository at this point in the history
The ->enable|disable() callbacks are only used to get and put runtime
PM references. Currently omap_hsmmc's ->set_ios() already does this
itself.

Other host drivers deals with runtime PM without using the
->enable|disable() callbacks and thus do the runtime PM reference
counting themselves. Apply that approach for omap_hsmmc as well and
then discard the ->enable|disable() callbacks.

Signed-off-by: NeilBrown <neil@brown.name>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
  • Loading branch information
neilbrown authored and storulf committed Mar 27, 2015
1 parent 3a3ad3e commit f57ba4c
Showing 1 changed file with 9 additions and 21 deletions.
30 changes: 9 additions & 21 deletions drivers/mmc/host/omap_hsmmc.c
Expand Up @@ -864,6 +864,8 @@ static void omap_hsmmc_request_done(struct omap_hsmmc_host *host, struct mmc_req
return;
host->mrq = NULL;
mmc_request_done(host->mmc, mrq);
pm_runtime_mark_last_busy(host->dev);
pm_runtime_put_autosuspend(host->dev);
}

/*
Expand Down Expand Up @@ -1309,6 +1311,8 @@ static void omap_hsmmc_dma_callback(void *param)

host->mrq = NULL;
mmc_request_done(host->mmc, mrq);
pm_runtime_mark_last_busy(host->dev);
pm_runtime_put_autosuspend(host->dev);
}
}

Expand Down Expand Up @@ -1541,6 +1545,7 @@ static void omap_hsmmc_request(struct mmc_host *mmc, struct mmc_request *req)

BUG_ON(host->req_in_progress);
BUG_ON(host->dma_ch != -1);
pm_runtime_get_sync(host->dev);
if (host->protect_card) {
if (host->reqs_blocked < 3) {
/*
Expand All @@ -1557,6 +1562,8 @@ static void omap_hsmmc_request(struct mmc_host *mmc, struct mmc_request *req)
req->data->error = -EBADF;
req->cmd->retries = 0;
mmc_request_done(mmc, req);
pm_runtime_mark_last_busy(host->dev);
pm_runtime_put_autosuspend(host->dev);
return;
} else if (host->reqs_blocked)
host->reqs_blocked = 0;
Expand All @@ -1570,6 +1577,8 @@ static void omap_hsmmc_request(struct mmc_host *mmc, struct mmc_request *req)
req->data->error = err;
host->mrq = NULL;
mmc_request_done(mmc, req);
pm_runtime_mark_last_busy(host->dev);
pm_runtime_put_autosuspend(host->dev);
return;
}
if (req->sbc && !(host->flags & AUTO_CMD23)) {
Expand Down Expand Up @@ -1773,25 +1782,6 @@ static void omap_hsmmc_conf_bus_power(struct omap_hsmmc_host *host)
set_sd_bus_power(host);
}

static int omap_hsmmc_enable_fclk(struct mmc_host *mmc)
{
struct omap_hsmmc_host *host = mmc_priv(mmc);

pm_runtime_get_sync(host->dev);

return 0;
}

static int omap_hsmmc_disable_fclk(struct mmc_host *mmc)
{
struct omap_hsmmc_host *host = mmc_priv(mmc);

pm_runtime_mark_last_busy(host->dev);
pm_runtime_put_autosuspend(host->dev);

return 0;
}

static int omap_hsmmc_multi_io_quirk(struct mmc_card *card,
unsigned int direction, int blk_size)
{
Expand All @@ -1803,8 +1793,6 @@ static int omap_hsmmc_multi_io_quirk(struct mmc_card *card,
}

static struct mmc_host_ops omap_hsmmc_ops = {
.enable = omap_hsmmc_enable_fclk,
.disable = omap_hsmmc_disable_fclk,
.post_req = omap_hsmmc_post_req,
.pre_req = omap_hsmmc_pre_req,
.request = omap_hsmmc_request,
Expand Down

0 comments on commit f57ba4c

Please sign in to comment.