Skip to content

Commit afab1bb

Browse files
ahunter6storulf
authored andcommitted
mmc: core: Make mmc_pre_req() and mmc_post_req() available
Make mmc_pre_req() and mmc_post_req() available to the card drivers. Later patches will make use of this. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Tested-by: Linus Walleij <linus.walleij@linaro.org>
1 parent 41e3efd commit afab1bb

File tree

2 files changed

+31
-31
lines changed

2 files changed

+31
-31
lines changed

drivers/mmc/core/core.c

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -657,37 +657,6 @@ bool mmc_is_req_done(struct mmc_host *host, struct mmc_request *mrq)
657657
}
658658
EXPORT_SYMBOL(mmc_is_req_done);
659659

660-
/**
661-
* mmc_pre_req - Prepare for a new request
662-
* @host: MMC host to prepare command
663-
* @mrq: MMC request to prepare for
664-
*
665-
* mmc_pre_req() is called in prior to mmc_start_req() to let
666-
* host prepare for the new request. Preparation of a request may be
667-
* performed while another request is running on the host.
668-
*/
669-
static void mmc_pre_req(struct mmc_host *host, struct mmc_request *mrq)
670-
{
671-
if (host->ops->pre_req)
672-
host->ops->pre_req(host, mrq);
673-
}
674-
675-
/**
676-
* mmc_post_req - Post process a completed request
677-
* @host: MMC host to post process command
678-
* @mrq: MMC request to post process for
679-
* @err: Error, if non zero, clean up any resources made in pre_req
680-
*
681-
* Let the host post process a completed request. Post processing of
682-
* a request may be performed while another reuqest is running.
683-
*/
684-
static void mmc_post_req(struct mmc_host *host, struct mmc_request *mrq,
685-
int err)
686-
{
687-
if (host->ops->post_req)
688-
host->ops->post_req(host, mrq, err);
689-
}
690-
691660
/**
692661
* mmc_finalize_areq() - finalize an asynchronous request
693662
* @host: MMC host to finalize any ongoing request on

drivers/mmc/core/core.h

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,4 +150,35 @@ int mmc_cqe_start_req(struct mmc_host *host, struct mmc_request *mrq);
150150
void mmc_cqe_post_req(struct mmc_host *host, struct mmc_request *mrq);
151151
int mmc_cqe_recovery(struct mmc_host *host);
152152

153+
/**
154+
* mmc_pre_req - Prepare for a new request
155+
* @host: MMC host to prepare command
156+
* @mrq: MMC request to prepare for
157+
*
158+
* mmc_pre_req() is called in prior to mmc_start_req() to let
159+
* host prepare for the new request. Preparation of a request may be
160+
* performed while another request is running on the host.
161+
*/
162+
static inline void mmc_pre_req(struct mmc_host *host, struct mmc_request *mrq)
163+
{
164+
if (host->ops->pre_req)
165+
host->ops->pre_req(host, mrq);
166+
}
167+
168+
/**
169+
* mmc_post_req - Post process a completed request
170+
* @host: MMC host to post process command
171+
* @mrq: MMC request to post process for
172+
* @err: Error, if non zero, clean up any resources made in pre_req
173+
*
174+
* Let the host post process a completed request. Post processing of
175+
* a request may be performed while another request is running.
176+
*/
177+
static inline void mmc_post_req(struct mmc_host *host, struct mmc_request *mrq,
178+
int err)
179+
{
180+
if (host->ops->post_req)
181+
host->ops->post_req(host, mrq, err);
182+
}
183+
153184
#endif

0 commit comments

Comments
 (0)