summaryrefslogtreecommitdiff
path: root/drivers/mmc/host/of_mmc_spi.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2021-04-29 01:56:51 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2021-04-29 01:56:51 +0300
commitbe18cd1fcae2ed7db58d92d20733dfa8aa0a5173 (patch)
tree537192d3bf7f463baa3a06c6f2ed74c2ebf339a2 /drivers/mmc/host/of_mmc_spi.c
parent6fa09d313921cd960ebb7f87132e49deb034b5f1 (diff)
parent97fce126e279690105ee15be652b465fd96f9997 (diff)
downloadlinux-be18cd1fcae2ed7db58d92d20733dfa8aa0a5173.tar.xz
Merge tag 'mmc-v5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc
Pull MMC and MEMSTICK updates from Ulf Hansson: "MMC core: - Fix hanging on I/O during system suspend for removable cards - Set read only for SD cards with permanent write protect bit - Power cycle the SD/SDIO card if CMD11 fails for UHS voltage - Issue a cache flush for eMMC only when it's enabled - Adopt to updated cache ctrl settings for eMMC from MMC ioctls - Use use device property API when parsing voltages - Don't retry eMMC sanitize cmds - Use the timeout from the MMC ioctl for eMMC santize cmds MMC host: - mmc_spi: Make of_mmc_spi.c resource provider agnostic - mmc_spi: Use polling for card detect even without voltage-ranges - sdhci: Check for reset prior to DMA address unmap - sdhci-acpi: Add support for the AMDI0041 eMMC controller variant - sdhci-esdhc-imx: Depending on OF Kconfig and cleanup code - sdhci-pci: Add PCI IDs for Intel LKF - sdhci-pci: Fix initialization of some SD cards for Intel BYT - sdhci-pci-gli: Various improvements for GL97xx variants - sdhci-of-dwcmshc: Enable support for MMC_CAP_WAIT_WHILE_BUSY - sdhci-of-dwcmshc: Add ACPI support for BlueField-3 SoC - sdhci-of-dwcmshc: Add Rockchip platform support - tmio/renesas_sdhi: Extend support for reset and use a reset controller - tmio/renesas_sdhi: Enable support for MMC_CAP_WAIT_WHILE_BUSY - tmio/renesas_sdhi: Various improvements MEMSTICK: - Minor improvements/cleanups" * tag 'mmc-v5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: (79 commits) mmc: block: Issue a cache flush only when it's enabled memstick: r592: ignore kfifo_out() return code again mmc: block: Update ext_csd.cache_ctrl if it was written mmc: mmc_spi: Make of_mmc_spi.c resource provider agnostic mmc: mmc_spi: Use already parsed IRQ mmc: mmc_spi: Drop unused NO_IRQ definition mmc: mmc_spi: Set up polling even if voltage-ranges is not present mmc: core: Convert mmc_of_parse_voltage() to use device property API mmc: core: Correct descriptions in mmc_of_parse() mmc: dw_mmc-rockchip: Just set default sample value for legacy mode mmc: sdhci-s3c: constify uses of driver/match data mmc: sdhci-s3c: correct kerneldoc of sdhci_s3c_drv_data mmc: sdhci-s3c: simplify getting of_device_id match data mmc: tmio: always restore irq register mmc: sdhci-pci-gli: Enlarge ASPM L1 entry delay of GL975x mmc: core: Let eMMC sanitize not retry in case of timeout/failure mmc: core: Add a retries parameter to __mmc_switch function memstick: r592: remove unused variable mmc: sdhci-st: Remove unnecessary error log mmc: sdhci-msm: Remove unnecessary error log ...
Diffstat (limited to 'drivers/mmc/host/of_mmc_spi.c')
-rw-r--r--drivers/mmc/host/of_mmc_spi.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/mmc/host/of_mmc_spi.c b/drivers/mmc/host/of_mmc_spi.c
index 3c4d950a4755..9d480a05f655 100644
--- a/drivers/mmc/host/of_mmc_spi.c
+++ b/drivers/mmc/host/of_mmc_spi.c
@@ -19,11 +19,6 @@
#include <linux/mmc/core.h>
#include <linux/mmc/host.h>
-/* For archs that don't support NO_IRQ (such as mips), provide a dummy value */
-#ifndef NO_IRQ
-#define NO_IRQ 0
-#endif
-
MODULE_LICENSE("GPL");
struct of_mmc_spi {
@@ -54,22 +49,22 @@ 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;
- if (dev->platform_data || !np)
+ if (dev->platform_data || !dev_fwnode(dev))
return dev->platform_data;
oms = kzalloc(sizeof(*oms), GFP_KERNEL);
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);
- if (oms->detect_irq != 0) {
+ oms->detect_irq = spi->irq;
+ if (oms->detect_irq > 0) {
oms->pdata.init = of_mmc_spi_init;
oms->pdata.exit = of_mmc_spi_exit;
} else {
@@ -87,10 +82,9 @@ EXPORT_SYMBOL(mmc_spi_get_pdata);
void mmc_spi_put_pdata(struct spi_device *spi)
{
struct device *dev = &spi->dev;
- struct device_node *np = dev->of_node;
struct of_mmc_spi *oms = to_of_mmc_spi(dev);
- if (!dev->platform_data || !np)
+ if (!dev->platform_data || !dev_fwnode(dev))
return;
kfree(oms);