omap2_sdrc_get_params() should check to see if a board-*.c file has
called omap2_init_common_hw() with a null pointer for the
omap_sdrc_params argument, rather than attempting to dereference it.
Otherwise, boot will fail after the "Reprogramming SDRC" boot message.
Problem found by Peter Barada <peterb@logicpd.com>.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Tested-by: Peter Barada <peterb@logicpd.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
{
struct omap_sdrc_params *sp;
{
struct omap_sdrc_params *sp;
+ if (!sdrc_init_params)
+ return NULL;
+
sp = sdrc_init_params;
while (sp->rate && sp->rate != r)
sp = sdrc_init_params;
while (sp->rate && sp->rate != r)