usb: udc: lpc32xx: switch to clock prepare/unprepare model
authorVladimir Zapolskiy <vz@mleia.com>
Thu, 3 Mar 2016 04:52:57 +0000 (06:52 +0200)
committerFelipe Balbi <balbi@kernel.org>
Fri, 4 Mar 2016 13:14:49 +0000 (15:14 +0200)
commit68726e772d3d2a65a4ea593a6cbde21a9700985a
tree4c58a925df3f88aafbdbcc76e25141be2a183947
parent11ebf3ad3b871d262491790e3b273e963d4c3c28
usb: udc: lpc32xx: switch to clock prepare/unprepare model

The driver requires to prepare/unprepare clocks to work properly on a
platform with enabled common clock framework, otherwise unprepared
clocks are not enabled:

    WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:728 clk_core_enable+0x2c/0xf0()
    Modules linked in:
    CPU: 0 PID: 1 Comm: swapper Not tainted 4.3.0-rc2+ #284
    Hardware name: LPC32XX SoC (Flattened Device Tree)
    Backtrace:
    [<>] (dump_backtrace) from [<>] (show_stack+0x18/0x1c)
    [<>] (show_stack) from [<>] (dump_stack+0x20/0x28)
    [<>] (dump_stack) from [<>] (warn_slowpath_common+0x90/0xb8)
    [<>] (warn_slowpath_common) from [<>] (warn_slowpath_null+0x24/0x2c)
    [<>] (warn_slowpath_null) from [<>] (clk_core_enable+0x2c/0xf0)
    [<>] (clk_core_enable) from [<>] (clk_enable+0x24/0x38)
    [<>] (clk_enable) from [<>] (lpc32xx_udc_probe+0x284/0x924)
    [<>] (lpc32xx_udc_probe) from [<>] (platform_drv_probe+0x50/0xa0)
    [<>] (platform_drv_probe) from [<>] (driver_probe_device+0x18c/0x408)
    [<>] (driver_probe_device) from [<>] (__driver_attach+0x70/0x94)
    [<>] (__driver_attach) from [<>] (bus_for_each_dev+0x74/0x98)
    [<>] (bus_for_each_dev) from [<>] (driver_attach+0x20/0x28)
    [<>] (driver_attach) from [<>] (bus_add_driver+0x11c/0x248)
    [<>] (bus_add_driver) from [<>] (driver_register+0xa4/0xe8)
    [<>] (driver_register) from [<>] (__platform_driver_register+0x50/0x64)
    [<>] (__platform_driver_register) from [<>] (__platform_driver_probe+0x54/0x100)
    [<>] (__platform_driver_probe) from [<>] (lpc32xx_udc_driver_init+0x1c/0x28)
    [<>] (lpc32xx_udc_driver_init) from [<>] (do_one_initcall+0x11c/0x1dc)
    [<>] (do_one_initcall) from [<>] (kernel_init_freeable+0x10c/0x1d4)
    [<>] (kernel_init_freeable) from [<>] (kernel_init+0x10/0xec)
    [<>] (kernel_init) from [<>] (ret_from_fork+0x14/0x24)

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
drivers/usb/gadget/udc/lpc32xx_udc.c