public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Siarhei Siamashka <siarhei.siamashka@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] drivers: SPI: sunxi SPL: fix warning
Date: Mon, 14 Nov 2016 20:32:50 +0200	[thread overview]
Message-ID: <20161114203250.5bfe232d@i7> (raw)
In-Reply-To: <1478134692-496-1-git-send-email-andre.przywara@arm.com>

On Thu,  3 Nov 2016 00:58:12 +0000
Andre Przywara <andre.przywara@arm.com> wrote:

> Somehow an int returning function without a return statement sneaked
> in. Fix it.
> 
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> ---
>  drivers/mtd/spi/sunxi_spi_spl.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/spi/sunxi_spi_spl.c b/drivers/mtd/spi/sunxi_spi_spl.c
> index 67c7edd..7502314 100644
> --- a/drivers/mtd/spi/sunxi_spi_spl.c
> +++ b/drivers/mtd/spi/sunxi_spi_spl.c
> @@ -158,9 +158,10 @@ static void spi0_disable_clock(void)
>  			     (1 << AHB_RESET_SPI0_SHIFT));
>  }
>  
> -static int spi0_init(void)
> +static void spi0_init(void)
>  {
>  	unsigned int pin_function = SUNXI_GPC_SPI0;
> +
>  	if (IS_ENABLED(CONFIG_MACH_SUN50I))
>  		pin_function = SUN50I_GPC_SPI0;
>  

Thanks for spotting and fixing this compilation warning.

This was a last minute change. Originally there was also a check for
the pins state and the function returned an error code in the case if
the pins are already configured for NAND. But I removed this code
before sending the patch.

The idea is that probing the SPI flash may be useful in the future even
if booting from some other media. We may store some board-specific
configuration in the on-board SPI flash (for example, the DRAM and
CPU speed grade information). But this functionality definitely belongs
to a separate patch and can be always contributed later. There is also
the SPL size concern and we don't want to unnecessarily increase the
code size.

-- 
Best regards,
Siarhei Siamashka

  parent reply	other threads:[~2016-11-14 18:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-03  0:58 [U-Boot] [PATCH] drivers: SPI: sunxi SPL: fix warning Andre Przywara
2016-11-13 18:48 ` Hans de Goede
2016-11-14 16:30 ` Jagan Teki
2016-11-14 16:47   ` Andre Przywara
2016-11-14 16:56     ` Tom Rini
2016-11-14 18:18       ` Siarhei Siamashka
2016-11-14 18:32 ` Siarhei Siamashka [this message]
2016-11-14 19:43   ` André Przywara
2016-11-14 20:12     ` Tom Rini
2016-11-15 10:48       ` Andre Przywara

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=20161114203250.5bfe232d@i7 \
    --to=siarhei.siamashka@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox