From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Mundt Date: Mon, 05 Sep 2011 04:59:11 +0000 Subject: Re: [PATCH 1/2] SPI: spi_sh_msiof: implement DMA support Message-Id: <20110905045911.GE22142@linux-sh.org> List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Guennadi Liakhovetski Cc: spi-devel-general@lists.sourceforge.net, linux-sh@vger.kernel.org, Grant Likely 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 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(). > @@ -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.