diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2021-04-19 14:24:55 +0300 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2021-04-23 09:29:49 +0200 |
commit | 6dab809bb5b183015e19d558bfa95107de660be0 (patch) | |
tree | f93693d6866d448af6b22289f29397dc8082414c /drivers/mmc/host | |
parent | 0f2c771e74b56e8c0101cac2b8671bcf6feccd96 (diff) |
mmc: core: Convert mmc_of_parse_voltage() to use device property API
mmc_of_parse() for a few years has been using device property API.
Convert mmc_of_parse_voltage() as well.
At the same time switch users to new API.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20210419112459.25241-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/host')
-rw-r--r-- | drivers/mmc/host/mmc_spi.c | 8 | ||||
-rw-r--r-- | drivers/mmc/host/of_mmc_spi.c | 3 | ||||
-rw-r--r-- | drivers/mmc/host/sdhci-esdhc-imx.c | 2 | ||||
-rw-r--r-- | drivers/mmc/host/sdhci-of-esdhc.c | 2 |
4 files changed, 8 insertions, 7 deletions
diff --git a/drivers/mmc/host/mmc_spi.c b/drivers/mmc/host/mmc_spi.c index 02f4fd26e76a..9776a03a10f5 100644 --- a/drivers/mmc/host/mmc_spi.c +++ b/drivers/mmc/host/mmc_spi.c @@ -1397,6 +1397,8 @@ static int mmc_spi_probe(struct spi_device *spi) host->ones = ones; + dev_set_drvdata(&spi->dev, mmc); + /* Platform data is used to hook up things like card sensing * and power switching gpios. */ @@ -1413,8 +1415,6 @@ static int mmc_spi_probe(struct spi_device *spi) host->powerup_msecs = 250; } - dev_set_drvdata(&spi->dev, mmc); - /* preallocate dma buffers */ host->data = kmalloc(sizeof(*host->data), GFP_KERNEL); if (!host->data) @@ -1494,8 +1494,8 @@ fail_glue_init: fail_dma: kfree(host->data); fail_nobuf1: - mmc_free_host(mmc); mmc_spi_put_pdata(spi); + mmc_free_host(mmc); nomem: kfree(ones); return status; @@ -1518,8 +1518,8 @@ static int mmc_spi_remove(struct spi_device *spi) kfree(host->ones); spi->max_speed_hz = mmc->f_max; - mmc_free_host(mmc); mmc_spi_put_pdata(spi); + mmc_free_host(mmc); return 0; } diff --git a/drivers/mmc/host/of_mmc_spi.c b/drivers/mmc/host/of_mmc_spi.c index 3c4d950a4755..acd96ea399b8 100644 --- a/drivers/mmc/host/of_mmc_spi.c +++ b/drivers/mmc/host/of_mmc_spi.c @@ -54,6 +54,7 @@ static void of_mmc_spi_exit(struct device *dev, void *mmc) struct mmc_spi_platform_data *mmc_spi_get_pdata(struct spi_device *spi) { + struct mmc_host *mmc = dev_get_drvdata(&spi->dev); struct device *dev = &spi->dev; struct device_node *np = dev->of_node; struct of_mmc_spi *oms; @@ -65,7 +66,7 @@ struct mmc_spi_platform_data *mmc_spi_get_pdata(struct spi_device *spi) if (!oms) return NULL; - if (mmc_of_parse_voltage(np, &oms->pdata.ocr_mask) <= 0) + if (mmc_of_parse_voltage(mmc, &oms->pdata.ocr_mask) <= 0) goto err_ocr; oms->detect_irq = irq_of_parse_and_map(np, 0); diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index a380244db521..b991cf0e60c5 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c @@ -1485,7 +1485,7 @@ sdhci_esdhc_imx_probe_dt(struct platform_device *pdev, if (of_property_read_u32(np, "fsl,delay-line", &boarddata->delay_line)) boarddata->delay_line = 0; - mmc_of_parse_voltage(np, &host->ocr_mask); + mmc_of_parse_voltage(host->mmc, &host->ocr_mask); if (esdhc_is_usdhc(imx_data) && !IS_ERR(imx_data->pinctrl)) { imx_data->pins_100mhz = pinctrl_lookup_state(imx_data->pinctrl, diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-of-esdhc.c index ab5ab969f711..a593b1fbd69e 100644 --- a/drivers/mmc/host/sdhci-of-esdhc.c +++ b/drivers/mmc/host/sdhci-of-esdhc.c @@ -1489,7 +1489,7 @@ static int sdhci_esdhc_probe(struct platform_device *pdev) if (ret) goto err; - mmc_of_parse_voltage(np, &host->ocr_mask); + mmc_of_parse_voltage(host->mmc, &host->ocr_mask); ret = sdhci_add_host(host); if (ret) |