[PATCH 7/7] ARM: mxs: Add SPI driver for mx233/mx28
Marek Vasut
marex at denx.de
Mon Jun 25 09:30:31 EDT 2012
Dear Fabio Estevam,
> Hi Marek,
>
> On Sat, Jun 23, 2012 at 3:43 PM, Marek Vasut <marex at denx.de> wrote:
> > + ssp->clk = clk_get(&pdev->dev, NULL);
> > + if (IS_ERR(ssp->clk)) {
> > + ret = PTR_ERR(ssp->clk);
> > + goto out_spi_free;
> > + }
>
> You could use devm_clk_get here instead,
>
> > +
> > + clk_prepare_enable(ssp->clk);
> > + ssp->clk_rate = clk_get_rate(ssp->clk) / 1000;
> > +
> > + stmp_reset_block(ssp->base);
> > +
> > + platform_set_drvdata(pdev, host);
> > +
> > + ret = spi_register_master(host);
> > + if (ret) {
> > + dev_err(&pdev->dev, "Cannot register SPI master, %d\n",
> > ret); + goto out_clk_put;
> > + }
> > +
> > + return 0;
> > +
> > +out_clk_put:
> > + clk_disable_unprepare(ssp->clk);
> > + clk_put(ssp->clk);
>
> ,and then you would not need this clk_put here.
Oh, good point! I'll wait a little bit more until someone else reviews it and
then I'll resubmit new version.
btw. I'm already working on a combined PIO/DMA-capable version -- seems like
using PIO for small transfers and DMA for large transfers is good strategy that
gives me about 200kbps boost ;-)
> Driver looks good. Thanks for working on it.
>
> Regards,
>
> Fabio Estevam
Best regards,
Marek Vasut
More information about the linux-arm-kernel
mailing list