misc: sram: fix enabled clock leak on error path
authorVladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Mon, 1 Jun 2015 12:29:54 +0000 (15:29 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 13 Jun 2015 00:03:56 +0000 (17:03 -0700)
commitee895ccdf776a676655b1405d493cfcf43d157f0
tree49b5cf106db7c116b8e1f7dd3f3eec6795800647
parent0a3405d35c72535d6a57af3cad29ed14d26cd203
misc: sram: fix enabled clock leak on error path

If devm_gen_pool_create() fails, the previously enabled sram->clk is
not disabled on probe() exit.

Because reserved block logic relies only on information from device tree,
there is no need to get and enable device clock in advance, especially
because not provided clock is not considered as an error, so it is
safe to place devm_clk_get() at the end of probe(). No functional
change.

Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/sram.c