Commit baf4ad0e authored by David Woods's avatar David Woods Committed by Greg Kroah-Hartman

mmc: dw_mmc: Use device_property_read instead of of_property_read

commit 852ff5fe upstream.

Using the device_property interfaces allows the dw_mmc driver to work
on platforms which run on either device tree or ACPI.
Signed-off-by: default avatarDavid Woods <dwoods@mellanox.com>
Reviewed-by: default avatarChris Metcalf <cmetcalf@mellanox.com>
Acked-by: default avatarJaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent bdabf097
...@@ -2610,8 +2610,8 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id) ...@@ -2610,8 +2610,8 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id)
host->slot[id] = slot; host->slot[id] = slot;
mmc->ops = &dw_mci_ops; mmc->ops = &dw_mci_ops;
if (of_property_read_u32_array(host->dev->of_node, if (device_property_read_u32_array(host->dev, "clock-freq-min-max",
"clock-freq-min-max", freq, 2)) { freq, 2)) {
mmc->f_min = DW_MCI_FREQ_MIN; mmc->f_min = DW_MCI_FREQ_MIN;
mmc->f_max = DW_MCI_FREQ_MAX; mmc->f_max = DW_MCI_FREQ_MAX;
} else { } else {
...@@ -2709,7 +2709,6 @@ static void dw_mci_init_dma(struct dw_mci *host) ...@@ -2709,7 +2709,6 @@ static void dw_mci_init_dma(struct dw_mci *host)
{ {
int addr_config; int addr_config;
struct device *dev = host->dev; struct device *dev = host->dev;
struct device_node *np = dev->of_node;
/* /*
* Check tansfer mode from HCON[17:16] * Check tansfer mode from HCON[17:16]
...@@ -2770,8 +2769,9 @@ static void dw_mci_init_dma(struct dw_mci *host) ...@@ -2770,8 +2769,9 @@ static void dw_mci_init_dma(struct dw_mci *host)
dev_info(host->dev, "Using internal DMA controller.\n"); dev_info(host->dev, "Using internal DMA controller.\n");
} else { } else {
/* TRANS_MODE_EDMAC: check dma bindings again */ /* TRANS_MODE_EDMAC: check dma bindings again */
if ((of_property_count_strings(np, "dma-names") < 0) || if ((device_property_read_string_array(dev, "dma-names",
(!of_find_property(np, "dmas", NULL))) { NULL, 0) < 0) ||
!device_property_present(dev, "dmas")) {
goto no_dma; goto no_dma;
} }
host->dma_ops = &dw_mci_edmac_ops; host->dma_ops = &dw_mci_edmac_ops;
...@@ -2931,7 +2931,6 @@ static struct dw_mci_board *dw_mci_parse_dt(struct dw_mci *host) ...@@ -2931,7 +2931,6 @@ static struct dw_mci_board *dw_mci_parse_dt(struct dw_mci *host)
{ {
struct dw_mci_board *pdata; struct dw_mci_board *pdata;
struct device *dev = host->dev; struct device *dev = host->dev;
struct device_node *np = dev->of_node;
const struct dw_mci_drv_data *drv_data = host->drv_data; const struct dw_mci_drv_data *drv_data = host->drv_data;
int ret; int ret;
u32 clock_frequency; u32 clock_frequency;
...@@ -2948,15 +2947,16 @@ static struct dw_mci_board *dw_mci_parse_dt(struct dw_mci *host) ...@@ -2948,15 +2947,16 @@ static struct dw_mci_board *dw_mci_parse_dt(struct dw_mci *host)
} }
/* find out number of slots supported */ /* find out number of slots supported */
of_property_read_u32(np, "num-slots", &pdata->num_slots); device_property_read_u32(dev, "num-slots", &pdata->num_slots);
if (of_property_read_u32(np, "fifo-depth", &pdata->fifo_depth)) if (device_property_read_u32(dev, "fifo-depth", &pdata->fifo_depth))
dev_info(dev, dev_info(dev,
"fifo-depth property not found, using value of FIFOTH register as default\n"); "fifo-depth property not found, using value of FIFOTH register as default\n");
of_property_read_u32(np, "card-detect-delay", &pdata->detect_delay_ms); device_property_read_u32(dev, "card-detect-delay",
&pdata->detect_delay_ms);
if (!of_property_read_u32(np, "clock-frequency", &clock_frequency)) if (!device_property_read_u32(dev, "clock-frequency", &clock_frequency))
pdata->bus_hz = clock_frequency; pdata->bus_hz = clock_frequency;
if (drv_data && drv_data->parse_dt) { if (drv_data && drv_data->parse_dt) {
......
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