]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mtd: nand: orion: fix clk handling
authorSimon Baatz <gmbnomis@gmail.com>
Mon, 27 Mar 2017 18:02:07 +0000 (20:02 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 May 2017 13:46:29 +0000 (15:46 +0200)
commit750d21357e36df3cff1b0419a432c084d13e6ff3
treec462380c2849b6c465e84c7c65fcd3a3e72d33a8
parent6003ac5842145bf865d4adc781a3fe25cb0d4640
mtd: nand: orion: fix clk handling

commit 675b11d94ce9baa5eb365a51b35d2793f77c8ab8 upstream.

The clk handling in orion_nand.c had two problems:

- In the probe function, clk_put() was called for an enabled clock,
  which violates the API (see documentation for clk_put() in
  include/linux/clk.h)

- In the error path of the probe function, clk_put() could be called
  twice for the same clock.

In order to clean this up, use the managed function devm_clk_get() and
store the pointer to the clk in the driver data.

Fixes: baffab28b13120694fa3ebab08d3e99667a851d2 ('ARM: Orion: fix driver probe error handling with respect to clk')
Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mtd/nand/orion_nand.c