[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAVeFu+c5Wx3wExeqpFX3YfGisZwr32XbgPo6f7FpOpieiZR3w@mail.gmail.com>
Date: Thu, 7 Aug 2014 16:10:24 +0900
From: Alexandre Courbot <gnurou@...il.com>
To: Alexandre Courbot <acourbot@...dia.com>
Cc: Thierry Reding <thierry.reding@...il.com>,
"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] drm/panel: simple: Use devm_gpiod_get_optional()
Ping, Thierry?
On Fri, Jul 25, 2014 at 11:47 PM, Alexandre Courbot <acourbot@...dia.com> wrote:
> Use the new devm_gpiod_get_optional() to simplify the probe code.
>
> Signed-off-by: Alexandre Courbot <acourbot@...dia.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
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists