Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mmc: mmc_spi: Set up polling even if voltage-ranges is not present

When voltage-ranges property is not present the driver assumes that
it is 3.3v (3.2v..3.4v). But at the same time it disallows polling.

Fix that by dropping the comparison to 0 when no property is provided.

While at it, mark voltage-ranges property optional as it was initially.

Fixes: 9c43df57910b ("mmc_spi: Add support for OpenFirmware bindings")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20210419112459.25241-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Andy Shevchenko and committed by
Ulf Hansson
6c857ccf 6dab809b

+4 -4
+3 -3
Documentation/devicetree/bindings/mmc/mmc-spi-slot.txt
··· 5 5 6 6 Required properties: 7 7 - spi-max-frequency : maximum frequency for this device (Hz). 8 - - voltage-ranges : two cells are required, first cell specifies minimum 9 - slot voltage (mV), second cell specifies maximum slot voltage (mV). 10 - Several ranges could be specified. 11 8 12 9 Optional properties: 10 + - voltage-ranges : two cells are required, first cell specifies minimum 11 + slot voltage (mV), second cell specifies maximum slot voltage (mV). 12 + Several ranges could be specified. If not provided, 3.2v..3.4v is assumed. 13 13 - gpios : may specify GPIOs in this order: Card-Detect GPIO, 14 14 Write-Protect GPIO. Note that this does not follow the 15 15 binding from mmc.txt, for historical reasons.
+1 -1
drivers/mmc/host/of_mmc_spi.c
··· 66 66 if (!oms) 67 67 return NULL; 68 68 69 - if (mmc_of_parse_voltage(mmc, &oms->pdata.ocr_mask) <= 0) 69 + if (mmc_of_parse_voltage(mmc, &oms->pdata.ocr_mask) < 0) 70 70 goto err_ocr; 71 71 72 72 oms->detect_irq = irq_of_parse_and_map(np, 0);