]> git.baikalelectronics.ru Git - kernel.git/commit
usb: ehci-orion: fix clock reference leaking
authorGregory CLEMENT <gregory.clement@free-electrons.com>
Thu, 15 May 2014 10:17:28 +0000 (12:17 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 27 May 2014 22:33:12 +0000 (15:33 -0700)
commita6478b4026c6c6a6dba951c4306fd427ce2a4c9a
treefc04eaeae3b8b58876c813f602e29d784d52bd23
parent5dde5dc3eba56dc2e424bc20461968faf793826f
usb: ehci-orion: fix clock reference leaking

In order to disable the clock in the ->remove() function, a call to
devm_clk_get() is being made, which further increases the reference
count of the clock.

In order to clean this up, a private structure holding a pointer to
the clock is added using the override mechanism provided by the ehci
framework. This makes the driver clock handling much more logical.

The bug was introduced in v3.6, however the ehci framework allowing to
use the override mechanism has only been introduced in v3.8, so this
patch won't apply before it.

[Thomas: reword commit log, fix goto label names.]

Fixes: a279bbee79fbd5439d11724a51a19fd2844bb899 ('ARM: Orion: EHCI: Add support for enabling clocks')
Cc: <stable@vger.kernel.org> # v3.8+
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/ehci-orion.c