[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150122163313.GD18153@dtor-ws>
Date: Thu, 22 Jan 2015 08:33:13 -0800
From: Dmitry Torokhov <dmitry.torokhov@...il.com>
To: Olliver Schinagl <o.schinagl@...imaker.com>
Cc: Rob Herring <robh+dt@...nel.org>, Pawel Moll <pawel.moll@....com>,
Mark Rutland <mark.rutland@....com>,
Ian Campbell <ijc+devicetree@...lion.org.uk>,
Kumar Gala <galak@...eaurora.org>,
Linus Walleij <linus.walleij@...aro.org>,
Alexandre Courbot <gnurou@...il.com>,
Bryan Wu <cooloney@...il.com>,
Richard Purdie <rpurdie@...ys.net>,
Olliver Schinagl <oliver@...inagl.nl>,
Robin Gong <b38343@...escale.com>,
Mika Westerberg <mika.westerberg@...ux.intel.com>,
Aaron Lu <aaron.lu@...el.com>,
Grant Likely <grant.likely@...aro.org>,
Jingoo Han <jg1.han@...sung.com>,
Alexander Shiyan <shc_work@...l.ru>,
Wolfram Sang <wsa@...-dreams.de>, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-gpio@...r.kernel.org,
linux-input@...r.kernel.org, linux-leds@...r.kernel.org
Subject: Re: [PATCH v2 4/4] leds: no longer use unnamed gpios
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
--
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