Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4734188imm; Wed, 30 May 2018 10:54:11 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIyFGJBZyrHmFBIoPO4+XOiMeJN9ilVeUhkiGRF6UVXJLVe4GfQG7ofGv3fIhNExON1fH2Q X-Received: by 2002:aa7:83c7:: with SMTP id j7-v6mr3694118pfn.50.1527702851582; Wed, 30 May 2018 10:54:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527702851; cv=none; d=google.com; s=arc-20160816; b=WXb707r1a2k/U4/7cy7QH8oi4yug462zXJTiqTBGwddvnGwL/qJ87AgfqampAUqzex 4U4c7dbihF1l/oELlWvIso1N0VxbsA3yQB+S7xROg9pskbW8wID4aIIFOkzJmUmASy/9 cEwfHsjCcbQUZrF3VwxlWN1p6Uql9DrV7mOPPo7tdY5oBrSMH3bs7C69o831s+KgQBSh ITg9a7KBzME2IKRAYLA7SzNAr32n9Y2X7iDJow3MmuUTrXTqd++Dq+959kJ2V1OOgAr4 Hg3ZcEjNNTPk5Udtv/2d90r75VLVLn1INl6x8l6nO4vq4P19vA+0/AbNhuYdi0sCfS0x Vp5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=MNnnIhRDVkbxRpjhqTeyQ6Kmj6sQW3eLGVi6g6pstSo=; b=jvoj1/LMBKSO/vGfBan2C6s9UZwW6o60Icx2q4O83cyUXsHtKNIGtMRmSyILsUFr83 uXpfxrhD+vbdHuUAb5FGUh5rCso7xl16R+HpSqGaAdR4ATzHUXgPxWErx1gVWd76AXcS myXfQ6hyhfR0YA+kDRLTEYZTNc+eP9M+COCenk63+4E81rWE0smL3Q5C9ySmZICxlAFU 8W9mzy/zTgqEyI9rmlbnmPjb2wysNhuyO2rIe2F7PBLBDMLVBOC46TaJs3HqeQC0oOie 4eik2ZPfEPWB9m733ParQI6faSmZjDNnJTQnYSp9mGj2ehPaXWMh3iJ6j+bG7e4IBJey pYTw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o23-v6si33947162pll.54.2018.05.30.10.53.57; Wed, 30 May 2018 10:54:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753651AbeE3Rwd (ORCPT + 99 others); Wed, 30 May 2018 13:52:33 -0400 Received: from mail.bootlin.com ([62.4.15.54]:52375 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753442AbeE3Rwc (ORCPT ); Wed, 30 May 2018 13:52:32 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 9153B207F0; Wed, 30 May 2018 19:52:31 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.0 Received: from bbrezillon (unknown [91.160.177.164]) by mail.bootlin.com (Postfix) with ESMTPSA id 3820B20720; Wed, 30 May 2018 19:52:21 +0200 (CEST) Date: Wed, 30 May 2018 19:52:20 +0200 From: Boris Brezillon To: Janusz Krzysztofik Cc: Richard Weinberger , H Hartley Sweeten , Tony Lindgren , linux-kernel@vger.kernel.org, Marek Vasut , Krzysztof Halasa , Shreeya Patel , Arvind Yadav , Brian Norris , David Woodhouse , linux-mtd@lists.infradead.org Subject: Re: [PATCH 5/6 v2] mtd: rawnand: ams-delta: use GPIO lookup table Message-ID: <20180530195220.3527f0fc@bbrezillon> In-Reply-To: <1543045.tPZatK9yHU@z50> References: <20180525222046.11200-1-jmkrzyszt@gmail.com> <20180530110500.185b5b7b@bbrezillon> <1543045.tPZatK9yHU@z50> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 30 May 2018 19:43:09 +0200 Janusz Krzysztofik wrote: > On Wednesday, May 30, 2018 11:05:00 AM CEST Boris Brezillon wrote: > > Hi Janusz, > > Hi Boris, > > > On Sat, 26 May 2018 00:20:45 +0200 > > Janusz Krzysztofik wrote: > > > ... > > > Changes since v1: > > > - fix handling of devm_gpiod_get_optional() return values - thanks to > > > Andy Shevchenko. > > > > Can you put the changelog after the "---" separator so that it does not > > appear in the final commit message? > > Yes, sure, sorry for that. > > > > +err_gpiod: > > > + if (err == -ENODEV || err == -ENOENT) > > > + err = -EPROBE_DEFER; > > > > Hm, isn't it better to make gpiod_find() return ERR_PTR(-EPROBE_DEFER) > > here [1]? At least, ENOENT should not be turned into EPROBE_DEFER, > > because it's returned when there's no entry matching the requested gpio > > in the lookup table, and deferring the probe won't solve this problem. > > ENOENT is also returned when no matching lookup table is found. That may > happen if consumer dev_name stored in the table differs from dev_name assigned > to the consumer by its bus, the platform bus in this case. For that reason I > think the consumer dev_name should be initialized in the table after the > device is registered, when its actual dev_name can be obtained. If that device > registration happens after the driver is already registered, e.g., at > late_initcall, the device is probed before its lookup table is ready. For that > reason returning EPROBE_DEFER seems better to me even in the ENOENT case. Sorry, I don't get it. Aren't GPIO lookup tables supposed to be declared in board files, especially if the GPIO is used by a platform device? When would you have a lookup table registered later in the init/boot process?