[alsa-devel] [PATCH 1/2] ALSA: sound/atmel/ac97c.c: Add missing clock prepare
Takashi Iwai
tiwai at suse.de
Fri Dec 5 17:40:00 CET 2014
At Fri, 5 Dec 2014 15:42:53 +0100,
Alexander Stein wrote:
>
> Replace clk_enable with clk_prepare_enable and clk_disable with
> clk_disable_unprepare.
The important information is missing: why it's necessary.
Also, can you patch abdac.c, too?
thanks,
Takashi
>
> Signed-off-by: Alexander Stein <alexanders83 at web.de>
> ---
> 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 b2a3225..ff2f743 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);
> --
> 2.2.0
>
More information about the Alsa-devel
mailing list