mmc: dw_mmc: return error for invalid voltage setting
authorKaustabh Chakraborty <kauschluss@disroot.org>
Fri, 17 Oct 2025 15:24:10 +0000 (20:54 +0530)
committerPeng Fan <peng.fan@nxp.com>
Thu, 30 Oct 2025 02:11:17 +0000 (10:11 +0800)
commit0b75109b6aafd1e796bc8cee0953cd6c5ba77610
tree2585a08d03a34f1acc733b116ad51063c7c4fa89
parente6b66e9f338fe9c8a6bc498399e736f7ec9deb10
mmc: dw_mmc: return error for invalid voltage setting

In certain cases, the VQMMC regulator may not support certain voltages.
For instance, a VQMMC regulator which supports only up to 2.7V will not
accept 3.3V as an argument. This is unaccounted for, and thus the driver
incorrectly assumes that the voltage is set successfully.

Fetch the return value in a variable and return if it's non-zero.
(-ENOSYS is exempted as it implies that the voltage adjustment
functionality as a whole isn't supported).

Signed-off-by: Kaustabh Chakraborty <kauschluss@disroot.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
drivers/mmc/dw_mmc.c