All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Olliver Schinagl <o.schinagl@ultimaker.com>
Cc: Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Alexandre Courbot <gnurou@gmail.com>,
	Bryan Wu <cooloney@gmail.com>, Richard Purdie <rpurdie@rpsys.net>,
	Olliver Schinagl <oliver@schinagl.nl>,
	Robin Gong <b38343@freescale.com>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Aaron Lu <aaron.lu@intel.com>,
	Grant Likely <grant.likely@linaro.org>,
	Jingoo Han <jg1.han@samsung.com>,
	Alexander Shiyan <shc_work@mail.ru>,
	Wolfram Sang <wsa@the-dreams.de>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-gpio@vger.kernel.org, linux-input@vger.kernel.org,
	linux-leds@vger.kernel.org
Subject: Re: [PATCH v2 4/4] leds: no longer use unnamed gpios
Date: Thu, 22 Jan 2015 08:33:13 -0800	[thread overview]
Message-ID: <20150122163313.GD18153@dtor-ws> (raw)
In-Reply-To: <1421876028-22799-5-git-send-email-o.schinagl@ultimaker.com>

Hi Olliver,

On Wed, Jan 21, 2015 at 10:33:48PM +0100, Olliver Schinagl wrote:
> diff --git a/drivers/input/keyboard/gpio_keys_polled.c b/drivers/input/keyboard/gpio_keys_polled.c
> index 097d721..eadb472 100644
> --- a/drivers/input/keyboard/gpio_keys_polled.c
> +++ b/drivers/input/keyboard/gpio_keys_polled.c
> @@ -125,15 +125,19 @@ static struct gpio_keys_platform_data *gpio_keys_polled_get_devtree_pdata(struct
>  	device_for_each_child_node(dev, child) {
>  		struct gpio_desc *desc;
>  
> -		desc = devm_get_gpiod_from_child(dev, NULL, child);
> +		desc = devm_get_gpiod_from_child(dev, "gpio_keys_polled",
> +						 child);
>  		if (IS_ERR(desc)) {
> -			error = PTR_ERR(desc);
> -			if (error != -EPROBE_DEFER)
> -				dev_err(dev,
> -					"Failed to get gpio flags, error: %d\n",
> -					error);
> -			fwnode_handle_put(child);
> -			return ERR_PTR(error);
> +			desc = devm_get_gpiod_from_child(dev, NULL, child);
> +			if (IS_ERR(desc)) {
> +				error = PTR_ERR(desc);
> +				if (error != -EPROBE_DEFER)
> +					dev_err(dev,
> +						"Failed to get gpio flags, error: %d\n",
> +						error);
> +				fwnode_handle_put(child);
> +				return ERR_PTR(error);
> +			}
>  		}
>  

I do not think this is correct. If devm_get_gpiod_from_child(dev,
"gpio_keys_polled", child) retruns -EPROBE_DEFER we'll try
devm_get_gpiod_from_child(dev, NULL, child). If that returns some other
error we'll fail probing entire driver.

Did I mention how *I HATE* the -EPROBE_DEFER (the error that is not an
error)?

Thanks.

-- 
Dmitry

      parent reply	other threads:[~2015-01-22 16:33 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-21 21:33 [PATCH v2 0/4] Let leds use named gpios Olliver Schinagl
2015-01-21 21:33 ` [PATCH v2 1/4] gpio: use sizeof() instead of hardcoded values Olliver Schinagl
2015-01-30 13:43   ` Linus Walleij
2015-01-30 13:43     ` Linus Walleij
2015-01-21 21:33 ` [PATCH v2 2/4] gpio: add parameter to allow the use named gpios Olliver Schinagl
2015-01-30 13:46   ` Linus Walleij
2015-01-30 19:12     ` Bryan Wu
2015-01-30 19:12       ` Bryan Wu
2015-01-30 22:16       ` Dmitry Torokhov
2015-01-30 22:16         ` Dmitry Torokhov
2015-01-30 22:22         ` Dmitry Torokhov
2015-01-30 22:22           ` Dmitry Torokhov
2015-02-09  5:24     ` Alexandre Courbot
2015-02-09  5:24       ` Alexandre Courbot
     [not found]   ` <1421876028-22799-3-git-send-email-o.schinagl-U3FVU11NWA554TAoqtyWWQ@public.gmane.org>
2015-03-04 13:00     ` Linus Walleij
2015-03-04 13:00       ` Linus Walleij
2015-01-21 21:33 ` [PATCH v2 3/4] leds: Let the binding document example for leds-gpio follow the gpio bindings Olliver Schinagl
2015-03-02 11:24   ` Linus Walleij
2015-03-02 11:24     ` Linus Walleij
2015-03-02 20:03     ` Bryan Wu
2015-03-02 20:03       ` Bryan Wu
2015-01-21 21:33 ` [PATCH v2 4/4] leds: no longer use unnamed gpios Olliver Schinagl
2015-01-22  9:32   ` Rojhalat Ibrahim
2015-01-22  9:37     ` Olliver Schinagl
2015-01-22  9:37       ` Olliver Schinagl
2015-01-22 16:33   ` Dmitry Torokhov [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=20150122163313.GD18153@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=aaron.lu@intel.com \
    --cc=b38343@freescale.com \
    --cc=cooloney@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=gnurou@gmail.com \
    --cc=grant.likely@linaro.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=jg1.han@samsung.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mika.westerberg@linux.intel.com \
    --cc=o.schinagl@ultimaker.com \
    --cc=oliver@schinagl.nl \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=rpurdie@rpsys.net \
    --cc=shc_work@mail.ru \
    --cc=wsa@the-dreams.de \
    /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.