public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [Patch 2/2] gpio-pca953x: fix gpio_base and add verbosity
@ 2011-10-10 22:22 Hartmut Knaack
  2011-10-10 22:37 ` Ryan Mallon
  0 siblings, 1 reply; 2+ messages in thread
From: Hartmut Knaack @ 2011-10-10 22:22 UTC (permalink / raw)
  To: Grant Likely; +Cc: linux-kernel

Inspired by the gpio-pcf857x driver, this patch will output information
about the instantiated gpio-chip, including gpio start and end, chip
type and if irq is used.

Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
-------------------------------------------------------------
diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index ae479fd..4bdb88e 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -683,6 +683,12 @@ static int __devinit pca953x_probe(struct
i2c_client *client,
     if (ret)
         goto out_failed;
 
+    dev_info(&client->dev, "gpios %d..%d added on a %s%s\n",
+         chip->gpio_chip.base,
+         chip->gpio_chip.base + chip->gpio_chip.ngpio - 1,
+         client->name,
+         client->irq ? " (irq ignored)" : "");
+   
     ret = gpiochip_add(&chip->gpio_chip);
     if (ret)
         goto out_failed_irq;


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Patch 2/2] gpio-pca953x: fix gpio_base and add verbosity
  2011-10-10 22:22 [Patch 2/2] gpio-pca953x: fix gpio_base and add verbosity Hartmut Knaack
@ 2011-10-10 22:37 ` Ryan Mallon
  0 siblings, 0 replies; 2+ messages in thread
From: Ryan Mallon @ 2011-10-10 22:37 UTC (permalink / raw)
  To: Hartmut Knaack; +Cc: Grant Likely, linux-kernel

On 11/10/11 09:22, Hartmut Knaack wrote:

> Inspired by the gpio-pcf857x driver, this patch will output information
> about the instantiated gpio-chip, including gpio start and end, chip
> type and if irq is used.
> 
> Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
> -------------------------------------------------------------
> diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
> index ae479fd..4bdb88e 100644
> --- a/drivers/gpio/gpio-pca953x.c
> +++ b/drivers/gpio/gpio-pca953x.c
> @@ -683,6 +683,12 @@ static int __devinit pca953x_probe(struct
> i2c_client *client,
>      if (ret)
>          goto out_failed;
>  
> +    dev_info(&client->dev, "gpios %d..%d added on a %s%s\n",
> +         chip->gpio_chip.base,
> +         chip->gpio_chip.base + chip->gpio_chip.ngpio - 1,
> +         client->name,
> +         client->irq ? " (irq ignored)" : "");
> +   


If we want this, why not move it into gpiochip_add rather than
duplicating it in each driver? If you want to keep it here it should
probably be moved below the gpiochip_add, since the above would still
print if gpiochip_add failed.

>      ret = gpiochip_add(&chip->gpio_chip);
>      if (ret)
>          goto out_failed_irq;
> 


~Ryan


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-10-10 22:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-10 22:22 [Patch 2/2] gpio-pca953x: fix gpio_base and add verbosity Hartmut Knaack
2011-10-10 22:37 ` Ryan Mallon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox