Commit 7cdcc480 authored by Heiner Kallweit's avatar Heiner Kallweit Committed by Ulf Hansson

mmc: meson-gx: remove member mrq from struct meson_host

Struct mmc_command includes a reference to the related mmc_request.
Therefore we don't have to store mrq separately in struct meson_host.
And we can remove some now unneeded WARN_ON's.
Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Acked-by: default avatarKevin Hilman <khilman@baylibre.com>
Tested-by: default avatarKevin Hilman <khilman@baylibre.com>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent c01d1219
...@@ -122,7 +122,6 @@ ...@@ -122,7 +122,6 @@
struct meson_host { struct meson_host {
struct device *dev; struct device *dev;
struct mmc_host *mmc; struct mmc_host *mmc;
struct mmc_request *mrq;
struct mmc_command *cmd; struct mmc_command *cmd;
spinlock_t lock; spinlock_t lock;
...@@ -416,9 +415,6 @@ static void meson_mmc_request_done(struct mmc_host *mmc, ...@@ -416,9 +415,6 @@ static void meson_mmc_request_done(struct mmc_host *mmc,
{ {
struct meson_host *host = mmc_priv(mmc); struct meson_host *host = mmc_priv(mmc);
WARN_ON(host->mrq != mrq);
host->mrq = NULL;
host->cmd = NULL; host->cmd = NULL;
mmc_request_done(host->mmc, mrq); mmc_request_done(host->mmc, mrq);
} }
...@@ -525,13 +521,9 @@ static void meson_mmc_request(struct mmc_host *mmc, struct mmc_request *mrq) ...@@ -525,13 +521,9 @@ static void meson_mmc_request(struct mmc_host *mmc, struct mmc_request *mrq)
{ {
struct meson_host *host = mmc_priv(mmc); struct meson_host *host = mmc_priv(mmc);
WARN_ON(host->mrq != NULL);
/* Stop execution */ /* Stop execution */
writel(0, host->regs + SD_EMMC_START); writel(0, host->regs + SD_EMMC_START);
host->mrq = mrq;
if (mrq->sbc) if (mrq->sbc)
meson_mmc_start_cmd(mmc, mrq->sbc); meson_mmc_start_cmd(mmc, mrq->sbc);
else else
...@@ -555,7 +547,6 @@ static void meson_mmc_read_resp(struct mmc_host *mmc, struct mmc_command *cmd) ...@@ -555,7 +547,6 @@ static void meson_mmc_read_resp(struct mmc_host *mmc, struct mmc_command *cmd)
static irqreturn_t meson_mmc_irq(int irq, void *dev_id) static irqreturn_t meson_mmc_irq(int irq, void *dev_id)
{ {
struct meson_host *host = dev_id; struct meson_host *host = dev_id;
struct mmc_request *mrq;
struct mmc_command *cmd; struct mmc_command *cmd;
u32 irq_en, status, raw_status; u32 irq_en, status, raw_status;
irqreturn_t ret = IRQ_HANDLED; irqreturn_t ret = IRQ_HANDLED;
...@@ -565,11 +556,6 @@ static irqreturn_t meson_mmc_irq(int irq, void *dev_id) ...@@ -565,11 +556,6 @@ static irqreturn_t meson_mmc_irq(int irq, void *dev_id)
cmd = host->cmd; cmd = host->cmd;
mrq = host->mrq;
if (WARN_ON(!mrq))
return IRQ_NONE;
if (WARN_ON(!cmd)) if (WARN_ON(!cmd))
return IRQ_NONE; return IRQ_NONE;
...@@ -616,7 +602,7 @@ static irqreturn_t meson_mmc_irq(int irq, void *dev_id) ...@@ -616,7 +602,7 @@ static irqreturn_t meson_mmc_irq(int irq, void *dev_id)
else { else {
dev_warn(host->dev, "Unknown IRQ! status=0x%04x: MMC CMD%u arg=0x%08x flags=0x%08x stop=%d\n", dev_warn(host->dev, "Unknown IRQ! status=0x%04x: MMC CMD%u arg=0x%08x flags=0x%08x stop=%d\n",
status, cmd->opcode, cmd->arg, status, cmd->opcode, cmd->arg,
cmd->flags, mrq->stop ? 1 : 0); cmd->flags, cmd->mrq->stop ? 1 : 0);
if (cmd->data) { if (cmd->data) {
struct mmc_data *data = cmd->data; struct mmc_data *data = cmd->data;
...@@ -643,14 +629,10 @@ static irqreturn_t meson_mmc_irq(int irq, void *dev_id) ...@@ -643,14 +629,10 @@ static irqreturn_t meson_mmc_irq(int irq, void *dev_id)
static irqreturn_t meson_mmc_irq_thread(int irq, void *dev_id) static irqreturn_t meson_mmc_irq_thread(int irq, void *dev_id)
{ {
struct meson_host *host = dev_id; struct meson_host *host = dev_id;
struct mmc_request *mrq = host->mrq;
struct mmc_command *cmd = host->cmd; struct mmc_command *cmd = host->cmd;
struct mmc_data *data; struct mmc_data *data;
unsigned int xfer_bytes; unsigned int xfer_bytes;
if (WARN_ON(!mrq))
return IRQ_NONE;
if (WARN_ON(!cmd)) if (WARN_ON(!cmd))
return IRQ_NONE; return IRQ_NONE;
...@@ -664,8 +646,8 @@ static irqreturn_t meson_mmc_irq_thread(int irq, void *dev_id) ...@@ -664,8 +646,8 @@ static irqreturn_t meson_mmc_irq_thread(int irq, void *dev_id)
} }
meson_mmc_read_resp(host->mmc, cmd); meson_mmc_read_resp(host->mmc, cmd);
if (!data || !data->stop || mrq->sbc) if (!data || !data->stop || cmd->mrq->sbc)
meson_mmc_request_done(host->mmc, mrq); meson_mmc_request_done(host->mmc, cmd->mrq);
else else
meson_mmc_start_cmd(host->mmc, data->stop); meson_mmc_start_cmd(host->mmc, data->stop);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment