From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfgang Denk Date: Mon, 17 Jan 2011 22:23:22 +0100 Subject: [U-Boot] [PATCH v2] spi: add new driver for OpenCores tiny_spi In-Reply-To: <1294626279-8601-1-git-send-email-thomas@wytron.com.tw> References: <201101082044.52773.vapier@gentoo.org> <1294626279-8601-1-git-send-email-thomas@wytron.com.tw> Message-ID: <20110117212322.46153D1CAD5@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Thomas Chou, In message <1294626279-8601-1-git-send-email-thomas@wytron.com.tw> you wrote: > This patch adds support for OpenCores tiny_spi. > > http://opencores.org/project,tiny_spi > > Signed-off-by: Thomas Chou > --- > for u-boot > v2, use const and clean up as Mike suggested. ... > +void spi_cs_activate(struct spi_slave *slave) > +{ > + struct tiny_spi_slave *tiny_spi = to_tiny_spi_slave(slave); > + unsigned int cs = slave->cs; > + gpio_set_value(cs, tiny_spi->flg); > + debug("%s: SPI_CS_GPIO:%x\n", __func__, gpio_get_value(cs)); > +} Please separate declartations and code with a blank line. Please fix globally. ... > +int spi_claim_bus(struct spi_slave *slave) > +{ > + struct tiny_spi_slave *tiny_spi = to_tiny_spi_slave(slave); > + const struct tiny_spi_host *host = tiny_spi->host; > + debug("%s: bus:%i cs:%i\n", __func__, slave->bus, slave->cs); > + gpio_direction_output(slave->cs, !tiny_spi->flg); > + writel(tiny_spi->mode, host->base + TINY_SPI_CONTROL); > + writel(tiny_spi->baud, host->base + TINY_SPI_BAUD); Please do not use base + offset notation. Use a proper C struct instead. Please fix globally. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de A conservative is a man who believes that nothing should be done for the first time. - Alfred E. Wiggam