From 1132015b16580d3f53385354ffec0f58443a1ffd Mon Sep 17 00:00:00 2001 From: Alexander Stein Date: Fri, 5 Dec 2014 20:10:06 +0100 Subject: [PATCH] ALSA: sound/atmel/ac97c.c: Add missing clock prepare Clocks must be prepared before enabling them. Do this in one step. Replace clk_enable with clk_prepare_enable and clk_disable with clk_disable_unprepare. This fixes the following warning: ------------[ cut here ]------------ WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:895 __clk_enable+0x24/0x9c() Modules linked in: CPU: 0 PID: 1 Comm: swapper Tainted: G W 3.18.0-rc7+ #245 [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [] (show_stack) from [] (warn_slowpath_common+0x60/0x80) [] (warn_slowpath_common) from [] (warn_slowpath_null+0x18/0x20) [] (warn_slowpath_null) from [] (__clk_enable+0x24/0x9c) [] (__clk_enable) from [] (clk_enable+0x18/0x2c) [] (clk_enable) from [] (atmel_ac97c_probe+0x154/0x694) [] (atmel_ac97c_probe) from [] (platform_drv_probe+0x48/0x94) [] (platform_drv_probe) from [] (driver_probe_device+0x138/0x350) [] (driver_probe_device) from [] (__driver_attach+0x68/0x8c) [] (__driver_attach) from [] (bus_for_each_dev+0x70/0x84) [] (bus_for_each_dev) from [] (bus_add_driver+0xfc/0x1f8) [] (bus_add_driver) from [] (driver_register+0x9c/0xe0) [] (driver_register) from [] (do_one_initcall+0x110/0x1c8) [] (do_one_initcall) from [] (kernel_init_freeable+0xf8/0x1b8) [] (kernel_init_freeable) from [] (kernel_init+0x8/0xe4) [] (kernel_init) from [] (ret_from_fork+0x14/0x24) ---[ end trace cb88537fdc8fa201 ]--- atmel_ac97c fffa0000.sound: AC'97 0 does not respond - RESET atmel_ac97c fffa0000.sound: AC'97 0 access is not valid [0xffffffff], removing mixer. ------------[ cut here ]------------ Signed-off-by: Alexander Stein Signed-off-by: Takashi Iwai --- sound/atmel/ac97c.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sound/atmel/ac97c.c b/sound/atmel/ac97c.c index f1d119538397..cb44c74c9702 100644 --- a/sound/atmel/ac97c.c +++ b/sound/atmel/ac97c.c @@ -944,7 +944,7 @@ static int atmel_ac97c_probe(struct platform_device *pdev) dev_dbg(&pdev->dev, "no peripheral clock\n"); return PTR_ERR(pclk); } - clk_enable(pclk); + clk_prepare_enable(pclk); retval = snd_card_new(&pdev->dev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1, THIS_MODULE, @@ -1122,7 +1122,7 @@ err_ioremap: err_request_irq: snd_card_free(card); err_snd_card_new: - clk_disable(pclk); + clk_disable_unprepare(pclk); clk_put(pclk); return retval; } @@ -1139,7 +1139,7 @@ static int atmel_ac97c_suspend(struct device *pdev) if (test_bit(DMA_TX_READY, &chip->flags)) dw_dma_cyclic_stop(chip->dma.tx_chan); } - clk_disable(chip->pclk); + clk_disable_unprepare(chip->pclk); return 0; } @@ -1149,7 +1149,7 @@ static int atmel_ac97c_resume(struct device *pdev) struct snd_card *card = dev_get_drvdata(pdev); struct atmel_ac97c *chip = card->private_data; - clk_enable(chip->pclk); + clk_prepare_enable(chip->pclk); if (cpu_is_at32ap7000()) { if (test_bit(DMA_RX_READY, &chip->flags)) dw_dma_cyclic_start(chip->dma.rx_chan); @@ -1177,7 +1177,7 @@ static int atmel_ac97c_remove(struct platform_device *pdev) ac97c_writel(chip, COMR, 0); ac97c_writel(chip, MR, 0); - clk_disable(chip->pclk); + clk_disable_unprepare(chip->pclk); clk_put(chip->pclk); iounmap(chip->regs); free_irq(chip->irq, chip); -- 2.39.5