aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSai Krishna Potthuri <[email protected]>2021-06-15 16:13:57 +0530
committerUlf Hansson <[email protected]>2021-08-24 10:15:29 +0200
commit5c7e468ab17fe9cc9ce94a6fdef635d5289a8095 (patch)
tree81cdc8fc94a9498a764469a3e3ceb6f4611feb51
parent4dd7080a78925ff293f1ded598b2010bd4ed3729 (diff)
mmc: arasan: Fix the issue in reading tap values from DT
'of_property_read_variable_u32_array' function returns number of elements read on success. This patch updates the condition check in the driver to overwrite the tap values from DT if exist. Signed-off-by: Sai Krishna Potthuri <[email protected]> Signed-off-by: Manish Narani <[email protected]> Acked-by: Adrian Hunter <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
-rw-r--r--drivers/mmc/host/sdhci-of-arasan.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c
index ba425b9563bf..737e2bfdedc2 100644
--- a/drivers/mmc/host/sdhci-of-arasan.c
+++ b/drivers/mmc/host/sdhci-of-arasan.c
@@ -1019,13 +1019,15 @@ static void arasan_dt_read_clk_phase(struct device *dev,
struct device_node *np = dev->of_node;
u32 clk_phase[2] = {0};
+ int ret;
/*
* Read Tap Delay values from DT, if the DT does not contain the
* Tap Values then use the pre-defined values.
*/
- if (of_property_read_variable_u32_array(np, prop, &clk_phase[0],
- 2, 0)) {
+ ret = of_property_read_variable_u32_array(np, prop, &clk_phase[0],
+ 2, 0);
+ if (ret < 0) {
dev_dbg(dev, "Using predefined clock phase for %s = %d %d\n",
prop, clk_data->clk_phase_in[timing],
clk_data->clk_phase_out[timing]);