From patchwork Mon Jun 2 23:14:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 4284481 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id AEF30BEEA7 for ; Mon, 2 Jun 2014 23:14:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E59E4201C8 for ; Mon, 2 Jun 2014 23:14:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1C314201BB for ; Mon, 2 Jun 2014 23:14:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753205AbaFBXO3 (ORCPT ); Mon, 2 Jun 2014 19:14:29 -0400 Received: from mho-02-ewr.mailhop.org ([204.13.248.72]:17775 "EHLO mho-02-ewr.mailhop.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752527AbaFBXO2 (ORCPT ); Mon, 2 Jun 2014 19:14:28 -0400 Received: from 99-127-230-128.lightspeed.sntcca.sbcglobal.net ([99.127.230.128] helo=atomide.com) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.72) (envelope-from ) id 1WrbQx-000PLH-F1; Mon, 02 Jun 2014 23:14:27 +0000 X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 99.127.230.128 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX18ztNGYe8hhxX5x09ACEcei Date: Mon, 2 Jun 2014 16:14:23 -0700 From: Tony Lindgren To: Linus Walleij Cc: Thierry Reding , Alexandre Courbot , "linux-gpio@vger.kernel.org" , "linux-kernel@vger.kernel.org" , linux-omap@vger.kernel.org Subject: Re: [PATCH 2/2] gpio: of: Allow -gpio suffix for property names Message-ID: <20140602231423.GF11004@atomide.com> References: <1398266889-17489-1-git-send-email-thierry.reding@gmail.com> <1398266889-17489-2-git-send-email-thierry.reding@gmail.com> <20140602230457.GE11004@atomide.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20140602230457.GE11004@atomide.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP * Tony Lindgren [140602 16:06]: > * Linus Walleij [140425 00:53]: > > On Wed, Apr 23, 2014 at 5:28 PM, Thierry Reding > > wrote: > > > > > From: Thierry Reding > > > > > > Many bindings use the -gpio suffix in property names. Support this in > > > addition to the -gpios suffix when requesting GPIOs using the new > > > descriptor-based API. > > > > > > Signed-off-by: Thierry Reding > > > > It appears this can save quite a lot of code in drivers, work that > > I trust Thierry to persue based on this to some extent so patch is > > tentatively applied unless something comes up. > > Looks like this patch causes a regression where GPIOs on I2C will > no longer return -EPROBE_DEFER but seem to return -ENOENT instead. > > This breaks drivers using things like devm_gpiod_get_index() > on a GPIO that's on a I2C bus not probed yet. > > Reverting commit dd34c37aa3e (gpio: of: Allow -gpio suffix for > property names) fixes things. Looks like something like below fixes the issue. Regards, Tony 8< ----------------------- From: Tony Lindgren Date: Mon, 2 Jun 2014 16:13:46 -0700 Subject: [PATCH] gpio: of: Fix handling for deferred probe for -gpio suffix Commit dd34c37aa3e (gpio: of: Allow -gpio suffix for property names) added parsing for both -gpio and -gpios suffix but also changed the handling for deferred probe unintentionally. Because of the looping the second name will now return -ENOENT instead of -EPROBE_DEFER. Fix the issue by breaking out of the loop if -EPROBE_DEFER is encountered. Signed-off-by: Tony Lindgren Reviewed-by: Thierry Reding --- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -2614,7 +2614,7 @@ static struct gpio_desc *of_find_gpio(struct device *dev, const char *con_id, desc = of_get_named_gpiod_flags(dev->of_node, prop_name, idx, &of_flags); - if (!IS_ERR(desc)) + if (!IS_ERR(desc) || (PTR_ERR(desc) == -EPROBE_DEFER)) break; }