linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wolfram Sang <w.sang@pengutronix.de>
To: Barry Song <21cnbao@gmail.com>
Cc: workgroup.linux@csr.com, Song <zhiwu.song@csr.com>,
	grant.likely@secretlab.ca, linux-arm-kernel@lists.infradead.org,
	Barry Song <Baohua.Song@csr.com>,
	spi-devel-general@lists.sourceforge.net,
	Barry Song <Barry.Song@csr.com>
Subject: Re: [PATCH] SPI: add CSR SiRFprimaII SPI controller driver
Date: Sun, 11 Dec 2011 16:05:48 +0100	[thread overview]
Message-ID: <20111211150548.GA30502@pengutronix.de> (raw)
In-Reply-To: <CAGsJ_4xeN5D47UbG-Xfr0NkvkcuYjP-LRUjumHz+OqTbH=y-_g@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1937 bytes --]


> >> +     writel(0, sspi->base + SPI_RXFIFO_OP);  /* TX, RX FIFO stop */
> >> +     writel(0, sspi->base + SPI_TXFIFO_OP);
> >> +     writel(0, sspi->base + SPI_TX_RX_EN);   /* RX, TX disable */
> >> +     writel(0, sspi->base + SPI_INT_EN);     /* Disable all interrupts */
> >
> > I'd think the comments after all those writel are stating the obvious :)
> 
> the last two are. but the first one can still be there by:
> /* TX, RX FIFO stop */
> writel(0, sspi->base + SPI_RXFIFO_OP);
> writel(0, sspi->base + SPI_TXFIFO_OP);

ACK. There are similar "obvious" ones in other places of the code, take care
you get them all, please.

> >> +     mem_res = platform_get_resource(dev, IORESOURCE_MEM, 0);
> >> +     if (mem_res == NULL) {
> >> +             dev_err(&dev->dev, "Unable to get IO resource\n");
> >> +             ret = -ENOMEM;
> >> +             goto free_master;
> >> +     }
> >
> > devm_request_mem_region() is missing. Or use the new
> > devm_request_and_ioremap() function (although currently only available
> > in linux-next).
> 
> many drivers ignore the process to request mem region. if you like, i will add.

That doesn't make it "right", though. In fact, this flaw was one reason I wrote
devm_request_and_ioremap().

> i'd like to use devm_request_mem_region() + devm_ioremap() at first,
> then move to devm_request_and_ioremap() in next window.

Why? You could just pick the patch into your branch and mention the dependency,
so we will merge it after drivers/base.

> >> +     spi_bitbang_stop(&sspi->bitbang);
> >> +     clk_put(sspi->clk);
> >> +     clk_disable(sspi->clk);
> >
> > First put then disable?
> clk_disable(sspi->clk);
> clk_put(sspi->clk);

That looks better :)

Regards,

   Wolfram

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

      reply	other threads:[~2011-12-11 15:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-02  3:51 [PATCH] SPI: add CSR SiRFprimaII SPI controller driver Barry Song
2011-12-08 13:15 ` Wolfram Sang
     [not found]   ` <20111208131509.GA13430-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2011-12-11 13:05     ` Barry Song
2011-12-11 15:05       ` Wolfram Sang [this message]

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=20111211150548.GA30502@pengutronix.de \
    --to=w.sang@pengutronix.de \
    --cc=21cnbao@gmail.com \
    --cc=Baohua.Song@csr.com \
    --cc=Barry.Song@csr.com \
    --cc=grant.likely@secretlab.ca \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=spi-devel-general@lists.sourceforge.net \
    --cc=workgroup.linux@csr.com \
    --cc=zhiwu.song@csr.com \
    /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).