On Fri, Sep 02, 2011 at 05:13:31PM +0200, Guennadi Liakhovetski wrote:
Use the sh_dma dmaengine driver to support DMA on MSIOF.
Signed-off-by: Guennadi Liakhovetski <redacted>
No real opinion one way or the other, just a couple observations.
+static void sh_msiof_request_dma(struct sh_msiof_spi_priv *p)
+{
..
+ p->dummypage = alloc_page(GFP_KERNEL);
+ if (!p->dummypage)
+ return;
+
..
+echantx:
+ __free_pages(p->dummypage, 0);
+}
+
alloc_page() can be balanced out with __free_page().
quoted hunk ↗ jump to hunk
@@ -695,11 +1030,11 @@ static int sh_msiof_spi_remove(struct platform_device *pdev)
ret = spi_bitbang_stop(&p->bitbang);
if (!ret) {
+ sh_msiof_release_dma(p);
pm_runtime_disable(&pdev->dev);
free_irq(platform_get_irq(pdev, 0), p);
iounmap(p->mapbase);
clk_put(p->clk);
- spi_master_put(p->bitbang.master);
}
return ret;
}
You've also killed off the spi_master_put() here.