From patchwork Fri Dec 5 19:10:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Stein X-Patchwork-Id: 5445451 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 525599F1D4 for ; Fri, 5 Dec 2014 19:11:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6AF70201F4 for ; Fri, 5 Dec 2014 19:11:11 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 345D7201ED for ; Fri, 5 Dec 2014 19:11:10 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 5BADB26512D; Fri, 5 Dec 2014 20:11:04 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 2BDB52650BE; Fri, 5 Dec 2014 20:10:32 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 6E1C92650C0; Fri, 5 Dec 2014 20:10:31 +0100 (CET) Received: from mout.web.de (mout.web.de [212.227.15.4]) by alsa0.perex.cz (Postfix) with ESMTP id 6176A264F54 for ; Fri, 5 Dec 2014 20:10:21 +0100 (CET) Received: from kongar.lan.local ([77.64.221.251]) by smtp.web.de (mrweb002) with ESMTPSA (Nemesis) id 0Lud96-1XoPg83Amm-00znqI; Fri, 05 Dec 2014 20:10:16 +0100 From: Alexander Stein To: Jaroslav Kysela , Takashi Iwai Date: Fri, 5 Dec 2014 20:10:06 +0100 Message-Id: <1417806607-8433-1-git-send-email-alexanders83@web.de> X-Mailer: git-send-email 2.2.0 X-Provags-ID: V03:K0:X6AlhP+O0SSkgkWdZjFzcfHBcIneS4J7oPFP/CSO0Tx+GGAbfuD mNuu+9upNWsxVDICzPvFlt7Y5NhlFUMGoCY7ihKT+jWeOfnMoMo3Y7BeA4qB/T1p3l7alSS e9hv2sF8VhrzH5GfJtM6NFqEZwDU1UuohiuvscMz33DcDWHIrCqjUp2DZckgg1ldf5/93iO a+IUVfo6I2KRdpIANo2/Q== X-UI-Out-Filterresults: notjunk:1; Cc: Alexander Stein , Alexandre Belloni , alsa-devel@alsa-project.org, Nicolas Ferre , Arnd Bergmann Subject: [alsa-devel] [PATCH v2 1/2] ALSA: sound/atmel/ac97c.c: Add missing clock prepare X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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 86f07e9..fa283d3 100644 --- a/sound/atmel/ac97c.c +++ b/sound/atmel/ac97c.c @@ -989,7 +989,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, @@ -1167,7 +1167,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; } @@ -1184,7 +1184,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; } @@ -1194,7 +1194,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); @@ -1222,7 +1222,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);