All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: Florian Fainelli <florian@openwrt.org>
Cc: linux-mips@linux-mips.org, Maxime Bizon <mbizon@freebox.fr>
Subject: Re: [PATCH 3/3] bcm63xx: early registering of gpiochip
Date: Tue, 2 Jun 2009 11:00:09 +0100	[thread overview]
Message-ID: <20090602100009.GD3527@linux-mips.org> (raw)
In-Reply-To: <200906012018.20972.florian@openwrt.org>

On Mon, Jun 01, 2009 at 08:18:20PM +0200, Florian Fainelli wrote:

> This patch makes the gpiochip be registered
> earlier in the prom code. This allows GPIO-based
> board detection to be made earlier.
> 
> Tested-by: Maxime Bizon <mbizon@freebox.fr>
> Signed-off-by: Florian Fainelli <florian@openwrt.org>
> ---
> diff --git a/arch/mips/bcm63xx/gpio.c b/arch/mips/bcm63xx/gpio.c
> index b78d3fd..997fcaa 100644
> --- a/arch/mips/bcm63xx/gpio.c
> +++ b/arch/mips/bcm63xx/gpio.c
> @@ -120,9 +120,8 @@ static struct gpio_chip bcm63xx_gpio_chip = {
>  	.ngpio			= BCM63XX_GPIO_COUNT,
>  };
>  
> -static int __init bcm63xx_gpio_init(void)
> +int __init bcm63xx_gpio_init(void)
>  {
>  	printk(KERN_INFO "registering %d GPIOs\n", BCM63XX_GPIO_COUNT);
>  	return gpiochip_add(&bcm63xx_gpio_chip);
>  }
> -arch_initcall(bcm63xx_gpio_init);
> diff --git a/arch/mips/bcm63xx/prom.c b/arch/mips/bcm63xx/prom.c
> index d97ceed..1e5bb15 100644
> --- a/arch/mips/bcm63xx/prom.c
> +++ b/arch/mips/bcm63xx/prom.c
> @@ -13,6 +13,7 @@
>  #include <bcm63xx_cpu.h>
>  #include <bcm63xx_io.h>
>  #include <bcm63xx_regs.h>
> +#include <bcm63xx_gpio.h>
>  
>  void __init prom_init(void)
>  {
> @@ -40,6 +41,9 @@ void __init prom_init(void)
>  
>  	/* do low level board init */
>  	board_prom_init();
> +
> +	/* early register gpio */

That word order sounds odd ...

> +	bcm63xx_gpio_init();
>  }
>  
>  void __init prom_free_prom_memory(void)
> diff --git a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_gpio.h b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_gpio.h
> index 72cee75..8bc812f 100644
> --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_gpio.h
> +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_gpio.h
> @@ -1,6 +1,8 @@
>  #ifndef BCM63XX_GPIO_H
>  #define BCM63XX_GPIO_H
>  
> +int __init bcm63xx_gpio_init(void);

It is not necessary to declare a function as __init.  But if you do you
better include <linux/init.h> first.  With this patch you'd rely on init.h
having previously included which eventually when the context changes will
blow up.

And not last, the patch seems to reject ...

  Ralf

      reply	other threads:[~2009-06-02 10:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-01 18:18 [PATCH 3/3] bcm63xx: early registering of gpiochip Florian Fainelli
2009-06-02 10:00 ` Ralf Baechle [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=20090602100009.GD3527@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=florian@openwrt.org \
    --cc=linux-mips@linux-mips.org \
    --cc=mbizon@freebox.fr \
    /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.