public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gpio / ACPI: return -ENOENT when no mapping exists
@ 2013-12-10 10:00 Mika Westerberg
  2013-12-10 11:11 ` Alex Courbot
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Mika Westerberg @ 2013-12-10 10:00 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Alex Courbot, Rafael J. Wysocki, linux-gpio, Mathias Nyman,
	linux-acpi, Mika Westerberg

Doing this allows drivers to distinguish between a real error case (if
there was an error when we tried to resolve the GPIO) and when the optional
GPIO line was not available.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
 drivers/gpio/gpiolib-acpi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
index 8506e4ce41f7..716ee9843110 100644
--- a/drivers/gpio/gpiolib-acpi.c
+++ b/drivers/gpio/gpiolib-acpi.c
@@ -307,7 +307,7 @@ struct gpio_desc *acpi_get_gpiod_by_index(struct device *dev, int index,
 	if (lookup.desc && info)
 		*info = lookup.info;
 
-	return lookup.desc ? lookup.desc : ERR_PTR(-ENODEV);
+	return lookup.desc ? lookup.desc : ERR_PTR(-ENOENT);
 }
 
 void acpi_gpiochip_add(struct gpio_chip *chip)
-- 
1.8.5.1


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

* Re: [PATCH] gpio / ACPI: return -ENOENT when no mapping exists
  2013-12-10 10:00 [PATCH] gpio / ACPI: return -ENOENT when no mapping exists Mika Westerberg
@ 2013-12-10 11:11 ` Alex Courbot
  2013-12-12  1:39 ` Rafael J. Wysocki
  2013-12-12 20:57 ` Linus Walleij
  2 siblings, 0 replies; 4+ messages in thread
From: Alex Courbot @ 2013-12-10 11:11 UTC (permalink / raw)
  To: Mika Westerberg, Linus Walleij
  Cc: Rafael J. Wysocki, linux-gpio@vger.kernel.org, Mathias Nyman,
	linux-acpi@vger.kernel.org

On 12/10/2013 07:00 PM, Mika Westerberg wrote:
> Doing this allows drivers to distinguish between a real error case (if
> there was an error when we tried to resolve the GPIO) and when the optional
> GPIO line was not available.
>
> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>

Thanks!

Acked-by: Alexandre Courbot <acourbot@nvidia.com>


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

* Re: [PATCH] gpio / ACPI: return -ENOENT when no mapping exists
  2013-12-10 10:00 [PATCH] gpio / ACPI: return -ENOENT when no mapping exists Mika Westerberg
  2013-12-10 11:11 ` Alex Courbot
@ 2013-12-12  1:39 ` Rafael J. Wysocki
  2013-12-12 20:57 ` Linus Walleij
  2 siblings, 0 replies; 4+ messages in thread
From: Rafael J. Wysocki @ 2013-12-12  1:39 UTC (permalink / raw)
  To: Mika Westerberg
  Cc: Linus Walleij, Alex Courbot, linux-gpio, Mathias Nyman,
	linux-acpi

On Tuesday, December 10, 2013 12:00:27 PM Mika Westerberg wrote:
> Doing this allows drivers to distinguish between a real error case (if
> there was an error when we tried to resolve the GPIO) and when the optional
> GPIO line was not available.
> 
> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>

Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

> ---
>  drivers/gpio/gpiolib-acpi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
> index 8506e4ce41f7..716ee9843110 100644
> --- a/drivers/gpio/gpiolib-acpi.c
> +++ b/drivers/gpio/gpiolib-acpi.c
> @@ -307,7 +307,7 @@ struct gpio_desc *acpi_get_gpiod_by_index(struct device *dev, int index,
>  	if (lookup.desc && info)
>  		*info = lookup.info;
>  
> -	return lookup.desc ? lookup.desc : ERR_PTR(-ENODEV);
> +	return lookup.desc ? lookup.desc : ERR_PTR(-ENOENT);
>  }
>  
>  void acpi_gpiochip_add(struct gpio_chip *chip)
> 
-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

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

* Re: [PATCH] gpio / ACPI: return -ENOENT when no mapping exists
  2013-12-10 10:00 [PATCH] gpio / ACPI: return -ENOENT when no mapping exists Mika Westerberg
  2013-12-10 11:11 ` Alex Courbot
  2013-12-12  1:39 ` Rafael J. Wysocki
@ 2013-12-12 20:57 ` Linus Walleij
  2 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2013-12-12 20:57 UTC (permalink / raw)
  To: Mika Westerberg
  Cc: Alex Courbot, Rafael J. Wysocki, linux-gpio@vger.kernel.org,
	Mathias Nyman, ACPI Devel Maling List

On Tue, Dec 10, 2013 at 11:00 AM, Mika Westerberg
<mika.westerberg@linux.intel.com> wrote:

> Doing this allows drivers to distinguish between a real error case (if
> there was an error when we tried to resolve the GPIO) and when the optional
> GPIO line was not available.
>
> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>

Patch applied with Alex's and Rafael's ACKs.

Yours,
Linus Walleij

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

end of thread, other threads:[~2013-12-12 20:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-10 10:00 [PATCH] gpio / ACPI: return -ENOENT when no mapping exists Mika Westerberg
2013-12-10 11:11 ` Alex Courbot
2013-12-12  1:39 ` Rafael J. Wysocki
2013-12-12 20:57 ` Linus Walleij

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