• Simon Baatz's avatar
    mtd: nand: orion: fix clk handling · 675b11d9
    Simon Baatz authored
    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: baffab28 ('ARM: Orion: fix driver probe error handling with respect to clk')
    Cc: <stable@vger.kernel.org> # v4.5+
    Signed-off-by: default avatarSimon Baatz <gmbnomis@gmail.com>
    Signed-off-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
    675b11d9
orion_nand.c 4.95 KB