[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1623753837-21035-8-git-send-email-manish.narani@xilinx.com>
Date: Tue, 15 Jun 2021 16:13:57 +0530
From: Manish Narani <manish.narani@...inx.com>
To: <michal.simek@...inx.com>, <adrian.hunter@...el.com>,
<ulf.hansson@...aro.org>
CC: <linux-arm-kernel@...ts.infradead.org>,
<linux-mmc@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
Sai Krishna Potthuri <lakshmi.sai.krishna.potthuri@...inx.com>,
Manish Narani <manish.narani@...inx.com>
Subject: [PATCH 7/7] mmc: arasan: Fix the issue in reading tap values from DT
From: Sai Krishna Potthuri <lakshmi.sai.krishna.potthuri@...inx.com>
'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 <lakshmi.sai.krishna.potthuri@...inx.com>
Signed-off-by: Manish Narani <manish.narani@...inx.com>
---
drivers/mmc/host/sdhci-of-arasan.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c
index 61fe13c..3f50095 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]);
--
2.1.1
Powered by blists - more mailing lists