All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/panel: simple: Use devm_gpiod_get_optional()
@ 2014-07-25 14:47 ` Alexandre Courbot
  0 siblings, 0 replies; 5+ messages in thread
From: Alexandre Courbot @ 2014-07-25 14:47 UTC (permalink / raw)
  To: Thierry Reding; +Cc: gnurou, linux-kernel, dri-devel

Use the new devm_gpiod_get_optional() to simplify the probe code.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
---
 drivers/gpu/drm/panel/panel-simple.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
index a251361..91bf566 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -185,16 +185,14 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
 	if (IS_ERR(panel->supply))
 		return PTR_ERR(panel->supply);
 
-	panel->enable_gpio = devm_gpiod_get(dev, "enable");
+	panel->enable_gpio = devm_gpiod_get_optional(dev, "enable");
 	if (IS_ERR(panel->enable_gpio)) {
 		err = PTR_ERR(panel->enable_gpio);
-		if (err != -ENOENT) {
-			dev_err(dev, "failed to request GPIO: %d\n", err);
-			return err;
-		}
+		dev_err(dev, "failed to request GPIO: %d\n", err);
+		return err;
+	}
 
-		panel->enable_gpio = NULL;
-	} else {
+	if (panel->enable_gpio) {
 		err = gpiod_direction_output(panel->enable_gpio, 0);
 		if (err < 0) {
 			dev_err(dev, "failed to setup GPIO: %d\n", err);
-- 
2.0.2

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

* [PATCH] drm/panel: simple: Use devm_gpiod_get_optional()
@ 2014-07-25 14:47 ` Alexandre Courbot
  0 siblings, 0 replies; 5+ messages in thread
From: Alexandre Courbot @ 2014-07-25 14:47 UTC (permalink / raw)
  To: Thierry Reding; +Cc: dri-devel, linux-kernel, gnurou, Alexandre Courbot

Use the new devm_gpiod_get_optional() to simplify the probe code.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
---
 drivers/gpu/drm/panel/panel-simple.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
index a251361..91bf566 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -185,16 +185,14 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
 	if (IS_ERR(panel->supply))
 		return PTR_ERR(panel->supply);
 
-	panel->enable_gpio = devm_gpiod_get(dev, "enable");
+	panel->enable_gpio = devm_gpiod_get_optional(dev, "enable");
 	if (IS_ERR(panel->enable_gpio)) {
 		err = PTR_ERR(panel->enable_gpio);
-		if (err != -ENOENT) {
-			dev_err(dev, "failed to request GPIO: %d\n", err);
-			return err;
-		}
+		dev_err(dev, "failed to request GPIO: %d\n", err);
+		return err;
+	}
 
-		panel->enable_gpio = NULL;
-	} else {
+	if (panel->enable_gpio) {
 		err = gpiod_direction_output(panel->enable_gpio, 0);
 		if (err < 0) {
 			dev_err(dev, "failed to setup GPIO: %d\n", err);
-- 
2.0.2


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

* Re: [PATCH] drm/panel: simple: Use devm_gpiod_get_optional()
  2014-07-25 14:47 ` Alexandre Courbot
  (?)
@ 2014-08-07  7:10 ` Alexandre Courbot
  -1 siblings, 0 replies; 5+ messages in thread
From: Alexandre Courbot @ 2014-08-07  7:10 UTC (permalink / raw)
  To: Alexandre Courbot
  Cc: Thierry Reding, dri-devel@lists.freedesktop.org,
	Linux Kernel Mailing List

Ping, Thierry?

On Fri, Jul 25, 2014 at 11:47 PM, Alexandre Courbot <acourbot@nvidia.com> wrote:
> Use the new devm_gpiod_get_optional() to simplify the probe code.
>
> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
> ---
>  drivers/gpu/drm/panel/panel-simple.c | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
> index a251361..91bf566 100644
> --- a/drivers/gpu/drm/panel/panel-simple.c
> +++ b/drivers/gpu/drm/panel/panel-simple.c
> @@ -185,16 +185,14 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
>         if (IS_ERR(panel->supply))
>                 return PTR_ERR(panel->supply);
>
> -       panel->enable_gpio = devm_gpiod_get(dev, "enable");
> +       panel->enable_gpio = devm_gpiod_get_optional(dev, "enable");
>         if (IS_ERR(panel->enable_gpio)) {
>                 err = PTR_ERR(panel->enable_gpio);
> -               if (err != -ENOENT) {
> -                       dev_err(dev, "failed to request GPIO: %d\n", err);
> -                       return err;
> -               }
> +               dev_err(dev, "failed to request GPIO: %d\n", err);
> +               return err;
> +       }
>
> -               panel->enable_gpio = NULL;
> -       } else {
> +       if (panel->enable_gpio) {
>                 err = gpiod_direction_output(panel->enable_gpio, 0);
>                 if (err < 0) {
>                         dev_err(dev, "failed to setup GPIO: %d\n", err);
> --
> 2.0.2
>

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

* Re: [PATCH] drm/panel: simple: Use devm_gpiod_get_optional()
  2014-07-25 14:47 ` Alexandre Courbot
@ 2014-08-07  7:46   ` Thierry Reding
  -1 siblings, 0 replies; 5+ messages in thread
From: Thierry Reding @ 2014-08-07  7:46 UTC (permalink / raw)
  To: Alexandre Courbot; +Cc: gnurou, linux-kernel, dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 438 bytes --]

On Fri, Jul 25, 2014 at 11:47:25PM +0900, Alexandre Courbot wrote:
> Use the new devm_gpiod_get_optional() to simplify the probe code.
> 
> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
> ---
>  drivers/gpu/drm/panel/panel-simple.c | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)

For some reason I thought I had already applied this, but apparently I
was mistaken. Applied now, thanks.

Thierry

[-- Attachment #1.2: Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm/panel: simple: Use devm_gpiod_get_optional()
@ 2014-08-07  7:46   ` Thierry Reding
  0 siblings, 0 replies; 5+ messages in thread
From: Thierry Reding @ 2014-08-07  7:46 UTC (permalink / raw)
  To: Alexandre Courbot; +Cc: dri-devel, linux-kernel, gnurou

[-- Attachment #1: Type: text/plain, Size: 438 bytes --]

On Fri, Jul 25, 2014 at 11:47:25PM +0900, Alexandre Courbot wrote:
> Use the new devm_gpiod_get_optional() to simplify the probe code.
> 
> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
> ---
>  drivers/gpu/drm/panel/panel-simple.c | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)

For some reason I thought I had already applied this, but apparently I
was mistaken. Applied now, thanks.

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

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

end of thread, other threads:[~2014-08-07  7:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-25 14:47 [PATCH] drm/panel: simple: Use devm_gpiod_get_optional() Alexandre Courbot
2014-07-25 14:47 ` Alexandre Courbot
2014-08-07  7:10 ` Alexandre Courbot
2014-08-07  7:46 ` Thierry Reding
2014-08-07  7:46   ` Thierry Reding

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.