ddr: fsl: fix null pointer dereference handling DDR4 memories
cppcheck reports:

  drivers/ddr/fsl/util.c:42:27: error: Null pointer dereference:
	  c [ctunullpointer]
   unsigned int data_rate = c->ddr_freq;
                            ^
  drivers/ddr/fsl/ctrl_regs.c:1114:55: note: Calling function
      get_memory_clk_period_ps, 1st argument is null
   const unsigned int mclk_ps = get_memory_clk_period_ps(0);

Because get_memory_clk_period_ps expects a valid pointer, but is instead
passed NULL. Fix this by passing along the DDR controller handle like all
other calls to the function do. This is untested.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent 4bed1f2 commit e75b084a61355788ffb1d6942ad84d1f449d1128
@Ahmad Fatoum Ahmad Fatoum authored on 29 Apr 2020
Sascha Hauer committed on 29 Apr 2020
Showing 1 changed file
View
drivers/ddr/fsl/ctrl_regs.c