If common clock framework is configured, the driver generates warnings, which is fixed by this change: 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@xxxxxxxxx> --- drivers/usb/gadget/udc/lpc32xx_udc.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/usb/gadget/udc/lpc32xx_udc.c b/drivers/usb/gadget/udc/lpc32xx_udc.c index 00b5006..d634a68 100644 --- a/drivers/usb/gadget/udc/lpc32xx_udc.c +++ b/drivers/usb/gadget/udc/lpc32xx_udc.c @@ -995,13 +995,13 @@ static void udc_clk_set(struct lpc32xx_udc *udc, int enable) udc->clocked = 1; /* 48MHz PLL up */ - clk_enable(udc->usb_pll_clk); + clk_prepare_enable(udc->usb_pll_clk); /* Enable the USB device clock */ writel(readl(USB_CTRL) | USB_DEV_NEED_CLK_EN, USB_CTRL); - clk_enable(udc->usb_otg_clk); + clk_prepare_enable(udc->usb_otg_clk); } else { if (!udc->clocked) return; @@ -1011,13 +1011,13 @@ static void udc_clk_set(struct lpc32xx_udc *udc, int enable) /* Never disable the USB_HCLK during normal operation */ /* 48MHz PLL dpwn */ - clk_disable(udc->usb_pll_clk); + clk_disable_unprepare(udc->usb_pll_clk); /* Disable the USB device clock */ writel(readl(USB_CTRL) & ~USB_DEV_NEED_CLK_EN, USB_CTRL); - clk_disable(udc->usb_otg_clk); + clk_disable_unprepare(udc->usb_otg_clk); } } @@ -3162,7 +3162,7 @@ static int lpc32xx_udc_probe(struct platform_device *pdev) } /* Setup PLL clock to 48MHz */ - retval = clk_enable(udc->usb_pll_clk); + retval = clk_prepare_enable(udc->usb_pll_clk); if (retval < 0) { dev_err(udc->dev, "failed to start USB PLL\n"); goto pll_enable_fail; @@ -3177,14 +3177,14 @@ static int lpc32xx_udc_probe(struct platform_device *pdev) writel(readl(USB_CTRL) | USB_DEV_NEED_CLK_EN, USB_CTRL); /* Enable USB device clock */ - retval = clk_enable(udc->usb_slv_clk); + retval = clk_prepare_enable(udc->usb_slv_clk); if (retval < 0) { dev_err(udc->dev, "failed to start USB device clock\n"); goto usb_clk_enable_fail; } /* Enable USB OTG clock */ - retval = clk_enable(udc->usb_otg_clk); + retval = clk_prepare_enable(udc->usb_otg_clk); if (retval < 0) { dev_err(udc->dev, "failed to start USB otg clock\n"); goto usb_otg_clk_enable_fail; @@ -3300,12 +3300,12 @@ dma_alloc_fail: dma_free_coherent(&pdev->dev, UDCA_BUFF_SIZE, udc->udca_v_base, udc->udca_p_base); i2c_fail: - clk_disable(udc->usb_otg_clk); + clk_disable_unprepare(udc->usb_otg_clk); usb_otg_clk_enable_fail: - clk_disable(udc->usb_slv_clk); + clk_disable_unprepare(udc->usb_slv_clk); usb_clk_enable_fail: pll_set_fail: - clk_disable(udc->usb_pll_clk); + clk_disable_unprepare(udc->usb_pll_clk); pll_enable_fail: clk_put(udc->usb_otg_clk); usb_otg_clk_get_fail: @@ -3349,11 +3349,11 @@ static int lpc32xx_udc_remove(struct platform_device *pdev) free_irq(udc->udp_irq[IRQ_USB_HP], udc); free_irq(udc->udp_irq[IRQ_USB_LP], udc); - clk_disable(udc->usb_otg_clk); + clk_disable_unprepare(udc->usb_otg_clk); clk_put(udc->usb_otg_clk); - clk_disable(udc->usb_slv_clk); + clk_disable_unprepare(udc->usb_slv_clk); clk_put(udc->usb_slv_clk); - clk_disable(udc->usb_pll_clk); + clk_disable_unprepare(udc->usb_pll_clk); clk_put(udc->usb_pll_clk); iounmap(udc->udp_baseaddr); release_mem_region(udc->io_p_start, udc->io_p_size); @@ -3380,7 +3380,7 @@ static int lpc32xx_udc_suspend(struct platform_device *pdev, pm_message_t mesg) udc->clocked = 1; /* Kill global USB clock */ - clk_disable(udc->usb_slv_clk); + clk_disable_unprepare(udc->usb_slv_clk); } return 0; @@ -3392,7 +3392,7 @@ static int lpc32xx_udc_resume(struct platform_device *pdev) if (udc->clocked) { /* Enable global USB clock */ - clk_enable(udc->usb_slv_clk); + clk_prepare_enable(udc->usb_slv_clk); /* Enable clocking */ udc_clk_set(udc, 1); -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html