From: Marek Vasut <marex-ynQEQJNshbs@public.gmane.org>
To: Fabio Estevam <festevam-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Fabio Estevam
<fabio.estevam-KZfg59tc24xl57MIdRCFDg@public.gmane.org>,
Chris Ball <cjb-2X9k7bc8m7Mdnm+yROfE0A@public.gmane.org>,
Wolfgang Denk <wd-ynQEQJNshbs@public.gmane.org>,
Detlev Zundel <dzu-ynQEQJNshbs@public.gmane.org>,
Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>,
Stefano Babic <sbabic-ynQEQJNshbs@public.gmane.org>,
spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
Shawn Guo <shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Dong Aisheng <b29396-KZfg59tc24xl57MIdRCFDg@public.gmane.org>,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH 7/7] ARM: mxs: Add SPI driver for mx233/mx28
Date: Mon, 25 Jun 2012 15:30:31 +0200 [thread overview]
Message-ID: <201206251530.32203.marex@denx.de> (raw)
In-Reply-To: <CAOMZO5BYoU5=tJCUH1nkT24FJhhXXhNwF46yYREGJj7G33HdVg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
Dear Fabio Estevam,
> Hi Marek,
>
> On Sat, Jun 23, 2012 at 3:43 PM, Marek Vasut <marex-ynQEQJNshbs@public.gmane.org> 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
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
next prev parent reply other threads:[~2012-06-25 13:30 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-23 18:43 [PATCH 1/7] ARM: mxs: Move SSP register definitions into separate file Marek Vasut
2012-06-23 18:43 ` [PATCH 2/7] ARM: mxs: Rename IMX2[38]_MMC to IMX2[38]_SSP Marek Vasut
2012-06-23 18:43 ` [PATCH 3/7] ARM: mxs: Add necessary bits into mxs-spi.h Marek Vasut
2012-06-23 18:43 ` [PATCH 4/7] ARM: mxs: Add SPI clock into clk framwork Marek Vasut
2012-06-26 6:54 ` Shawn Guo
[not found] ` <20120626065428.GM2342-rvtDTF3kK1ictlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2012-06-26 12:16 ` Marek Vasut
2012-06-26 12:24 ` Shawn Guo
[not found] ` <20120626122424.GG8858-rvtDTF3kK1ictlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2012-06-26 12:31 ` Marek Vasut
2012-06-23 18:43 ` [PATCH 5/7] ARM: mxs: Pull out parts shared between MMC and SPI Marek Vasut
2012-06-23 18:43 ` [PATCH 6/7] ARM: mxs: Pull out the SSP clock configuration function Marek Vasut
2012-06-23 18:43 ` [PATCH 7/7] ARM: mxs: Add SPI driver for mx233/mx28 Marek Vasut
[not found] ` <1340477033-2761-7-git-send-email-marex-ynQEQJNshbs@public.gmane.org>
2012-06-25 13:22 ` Fabio Estevam
[not found] ` <CAOMZO5BYoU5=tJCUH1nkT24FJhhXXhNwF46yYREGJj7G33HdVg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-06-25 13:30 ` Marek Vasut [this message]
2012-06-26 1:42 ` Alain-Serge Nagni
2012-06-26 7:43 ` Shawn Guo
[not found] ` <20120626074342.GA4928-rvtDTF3kK1ictlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2012-06-26 12:22 ` Marek Vasut
2012-06-26 12:31 ` Shawn Guo
[not found] ` <20120626123141.GH8858-rvtDTF3kK1ictlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2012-06-26 12:50 ` Marek Vasut
2012-06-26 6:52 ` [PATCH 1/7] ARM: mxs: Move SSP register definitions into separate file Shawn Guo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201206251530.32203.marex@denx.de \
--to=marex-ynqeqjnshbs@public.gmane.org \
--cc=b29396-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
--cc=cjb-2X9k7bc8m7Mdnm+yROfE0A@public.gmane.org \
--cc=dzu-ynQEQJNshbs@public.gmane.org \
--cc=fabio.estevam-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
--cc=festevam-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org \
--cc=sbabic-ynQEQJNshbs@public.gmane.org \
--cc=shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
--cc=wd-ynQEQJNshbs@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).