Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dmaengine: at_hdmac: prepare clk before calling enable

Replace clk_enable/disable with clk_prepare_enable/disable_unprepare to
avoid common clk framework warnings.

Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
[nicolas.ferre@atmel.com: remove return code checking in at_dma_resume_noirq()]
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>

authored by

Boris BREZILLON and committed by
Vinod Koul
f784d9c9 c3dbc60c

+9 -6
+9 -6
drivers/dma/at_hdmac.c
··· 1460 1460 err = PTR_ERR(atdma->clk); 1461 1461 goto err_clk; 1462 1462 } 1463 - clk_enable(atdma->clk); 1463 + err = clk_prepare_enable(atdma->clk); 1464 + if (err) 1465 + goto err_clk_prepare; 1464 1466 1465 1467 /* force dma off, just in case */ 1466 1468 at_dma_off(atdma); ··· 1562 1560 err_pool_create: 1563 1561 free_irq(platform_get_irq(pdev, 0), atdma); 1564 1562 err_irq: 1565 - clk_disable(atdma->clk); 1563 + clk_disable_unprepare(atdma->clk); 1564 + err_clk_prepare: 1566 1565 clk_put(atdma->clk); 1567 1566 err_clk: 1568 1567 iounmap(atdma->regs); ··· 1599 1596 list_del(&chan->device_node); 1600 1597 } 1601 1598 1602 - clk_disable(atdma->clk); 1599 + clk_disable_unprepare(atdma->clk); 1603 1600 clk_put(atdma->clk); 1604 1601 1605 1602 iounmap(atdma->regs); ··· 1618 1615 struct at_dma *atdma = platform_get_drvdata(pdev); 1619 1616 1620 1617 at_dma_off(platform_get_drvdata(pdev)); 1621 - clk_disable(atdma->clk); 1618 + clk_disable_unprepare(atdma->clk); 1622 1619 } 1623 1620 1624 1621 static int at_dma_prepare(struct device *dev) ··· 1675 1672 1676 1673 /* disable DMA controller */ 1677 1674 at_dma_off(atdma); 1678 - clk_disable(atdma->clk); 1675 + clk_disable_unprepare(atdma->clk); 1679 1676 return 0; 1680 1677 } 1681 1678 ··· 1705 1702 struct dma_chan *chan, *_chan; 1706 1703 1707 1704 /* bring back DMA controller */ 1708 - clk_enable(atdma->clk); 1705 + clk_prepare_enable(atdma->clk); 1709 1706 dma_writel(atdma, EN, AT_DMA_ENABLE); 1710 1707 1711 1708 /* clear any pending interrupt */