Skip to content

Commit

Permalink
mmc: arasan: Fix the issue in reading tap values from DT
Browse files Browse the repository at this point in the history
'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]>
  • Loading branch information
Sai Krishna Potthuri authored and storulf committed Aug 24, 2021
1 parent 4dd7080 commit 5c7e468
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/mmc/host/sdhci-of-arasan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down

0 comments on commit 5c7e468

Please sign in to comment.