1
0
Fork 0

mmc: dw_mmc: change the array of slots

It doesn't need to use the array of slots anymore.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
hifive-unleashed-5.1
Jaehoon Chung 2017-06-05 13:41:32 +09:00 committed by Ulf Hansson
parent 58870241a6
commit b23475faed
2 changed files with 10 additions and 15 deletions

View File

@ -2563,8 +2563,7 @@ static void dw_mci_cmd_interrupt(struct dw_mci *host, u32 status)
static void dw_mci_handle_cd(struct dw_mci *host) static void dw_mci_handle_cd(struct dw_mci *host)
{ {
int i = 0; struct dw_mci_slot *slot = host->slot;
struct dw_mci_slot *slot = host->slot[i];
if (slot->mmc->ops->card_event) if (slot->mmc->ops->card_event)
slot->mmc->ops->card_event(slot->mmc); slot->mmc->ops->card_event(slot->mmc);
@ -2576,8 +2575,7 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
{ {
struct dw_mci *host = dev_id; struct dw_mci *host = dev_id;
u32 pending; u32 pending;
int i = 0; struct dw_mci_slot *slot = host->slot;
struct dw_mci_slot *slot = host->slot[i];
pending = mci_readl(host, MINTSTS); /* read-only mask reg */ pending = mci_readl(host, MINTSTS); /* read-only mask reg */
@ -2707,7 +2705,7 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id)
slot->sdio_id = host->sdio_id0 + id; slot->sdio_id = host->sdio_id0 + id;
slot->mmc = mmc; slot->mmc = mmc;
slot->host = host; slot->host = host;
host->slot[id] = slot; host->slot = slot;
mmc->ops = &dw_mci_ops; mmc->ops = &dw_mci_ops;
if (device_property_read_u32_array(host->dev, "clock-freq-min-max", if (device_property_read_u32_array(host->dev, "clock-freq-min-max",
@ -2807,7 +2805,7 @@ static void dw_mci_cleanup_slot(struct dw_mci_slot *slot, unsigned int id)
{ {
/* Debugfs stuff is cleaned up by mmc core */ /* Debugfs stuff is cleaned up by mmc core */
mmc_remove_host(slot->mmc); mmc_remove_host(slot->mmc);
slot->host->slot[id] = NULL; slot->host->slot = NULL;
mmc_free_host(slot->mmc); mmc_free_host(slot->mmc);
} }
@ -2998,14 +2996,13 @@ static void dw_mci_enable_cd(struct dw_mci *host)
{ {
unsigned long irqflags; unsigned long irqflags;
u32 temp; u32 temp;
int i = 0;
struct dw_mci_slot *slot; struct dw_mci_slot *slot;
/* /*
* No need for CD if all slots have a non-error GPIO * No need for CD if all slots have a non-error GPIO
* as well as broken card detection is found. * as well as broken card detection is found.
*/ */
slot = host->slot[i]; slot = host->slot;
if (slot->mmc->caps & MMC_CAP_NEEDS_POLL) if (slot->mmc->caps & MMC_CAP_NEEDS_POLL)
return; return;
@ -3233,8 +3230,8 @@ void dw_mci_remove(struct dw_mci *host)
int i = 0; int i = 0;
dev_dbg(host->dev, "remove slot %d\n", i); dev_dbg(host->dev, "remove slot %d\n", i);
if (host->slot[i]) if (host->slot)
dw_mci_cleanup_slot(host->slot[i], i); dw_mci_cleanup_slot(host->slot, i);
mci_writel(host, RINTSTS, 0xFFFFFFFF); mci_writel(host, RINTSTS, 0xFFFFFFFF);
mci_writel(host, INTMASK, 0); /* disable all mmc interrupt first */ mci_writel(host, INTMASK, 0); /* disable all mmc interrupt first */
@ -3277,9 +3274,9 @@ EXPORT_SYMBOL(dw_mci_runtime_suspend);
int dw_mci_runtime_resume(struct device *dev) int dw_mci_runtime_resume(struct device *dev)
{ {
int i = 0, ret = 0; int ret = 0;
struct dw_mci *host = dev_get_drvdata(dev); struct dw_mci *host = dev_get_drvdata(dev);
struct dw_mci_slot *slot = host->slot[i]; struct dw_mci_slot *slot = host->slot;
if (host->cur_slot && if (host->cur_slot &&
(mmc_can_gpio_cd(host->cur_slot->mmc) || (mmc_can_gpio_cd(host->cur_slot->mmc) ||

View File

@ -20,8 +20,6 @@
#include <linux/reset.h> #include <linux/reset.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#define MAX_MCI_SLOTS 2
enum dw_mci_state { enum dw_mci_state {
STATE_IDLE = 0, STATE_IDLE = 0,
STATE_SENDING_CMD, STATE_SENDING_CMD,
@ -215,7 +213,7 @@ struct dw_mci {
void *priv; void *priv;
struct clk *biu_clk; struct clk *biu_clk;
struct clk *ciu_clk; struct clk *ciu_clk;
struct dw_mci_slot *slot[MAX_MCI_SLOTS]; struct dw_mci_slot *slot;
/* FIFO push and pull */ /* FIFO push and pull */
int fifo_depth; int fifo_depth;