All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] spi : convert altera_spi to driver model
Date: Tue, 22 Sep 2015 02:10:26 +0200	[thread overview]
Message-ID: <201509220210.26908.marex@denx.de> (raw)
In-Reply-To: <1442840311-12689-1-git-send-email-thomas@wytron.com.tw>

On Monday, September 21, 2015 at 02:58:31 PM, Thomas Chou wrote:
> Convert altera_spi to driver model
> 
> Signed-off-by: Thomas Chou <thomas@wytron.com.tw>

Hi!

> ---
>  drivers/spi/Kconfig      |   8 ++
>  drivers/spi/altera_spi.c | 197
> ++++++++++++++++++++++++++--------------------- 2 files changed, 119
> insertions(+), 86 deletions(-)

[...]

> +
> +static int altera_spi_set_speed(struct udevice *bus, uint speed)
> +{
> +	return 0;
> +}
> +
> +static int altera_spi_set_mode(struct udevice *bus, uint mode)
> +{
> +	return 0;
> +}

I suspect you might want to tweak the core code to check if those
.set_speed and .set_mode are assigned in dm_spi_ops structure and
if not, don't call them.

> +static int altera_spi_probe(struct udevice *bus)
> +{
> +	struct altera_spi_platdata *plat = dev_get_platdata(bus);
> +	struct altera_spi_priv *priv = dev_get_priv(bus);
> +
> +	priv->regs = plat->regs;
> +
> +	return 0;
> +}
> +
> +static int altera_spi_ofdata_to_platdata(struct udevice *bus)
> +{
> +	struct altera_spi_platdata *plat = dev_get_platdata(bus);
> +
> +	plat->regs = ioremap(dev_get_addr(bus),
> +		sizeof(struct altera_spi_regs));

I guess the same thing about ioremap() and ranges applies here?

> +	return 0;
> +}

But all these are minor nits, thanks !

[...]

  parent reply	other threads:[~2015-09-22  0:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-21 12:58 [U-Boot] [PATCH] spi : convert altera_spi to driver model Thomas Chou
2015-09-21 18:01 ` Jagan Teki
2015-09-28  0:40   ` Thomas Chou
2015-09-28  8:42     ` Jagan Teki
2015-09-22  0:10 ` Marek Vasut [this message]
2015-09-22  3:52   ` Thomas Chou
2015-09-22  4:13     ` Marek Vasut
2015-09-22  7:45       ` Thomas Chou
2015-09-22  8:11         ` Marek Vasut
2015-09-28 13:27 ` Thomas Chou

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=201509220210.26908.marex@denx.de \
    --to=marex@denx.de \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.