Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4866741imm; Wed, 30 May 2018 13:41:40 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJJUS5841zGlnMIZI6EsPMty6pFg+1D5LxXeJhs72dIfC0CeL0SpCDwt9n8plSwb9tf78mk X-Received: by 2002:a65:558c:: with SMTP id j12-v6mr3403137pgs.262.1527712900139; Wed, 30 May 2018 13:41:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527712900; cv=none; d=google.com; s=arc-20160816; b=i1je2+FOn8JKDMEM2NWuVaLmRJ0lDOAEfkxP5bHnPFNlgfFmUiI3uiG6X7JNnraA/1 rsvVWwIzWBScm7ebU47gzL3KkiLGkdPBOnwY5cHFQaX2hrpjJZy5cnyKuoxeLfaLsRg6 qshUF2tQvvQqWDiqG7znaMuLm50Vt+pNoZb2HSe59qBQjL5ayo23Ax8JUUHuLPAV8AND drksgNOeXRJbdIIVmtS4GVr1038iP32SBu4Z2Ciq6B5a+51HqrB4/AcPIeUJ0RB3yBGk lOCUinr5Wvi26wGrc7OlZt0zgY+ku3p1iGFalJ1TO1ATiJctriijLGefsvE9g9MfvTNg 5krA== 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:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=N9He6dcIJSiowP+bDJ5qeUgzLlhs5zCatxDWIfVrpdE=; b=T9QDMqxZZryY0CCab863C8fJzTNmXpBLGBoRzDhnchbbNPNQBthjnXjtEVcwRpwyvn iX6lR8H071dL8BPvMPlY3uBPH9qeZj4TuS6W49Qa7bxeK1p+OZ+/AUNhSJ6b8B+4FZrP 7GNQtU5Qyp6dIYEQBJIk89bm1GB8g/UXwr/FGPlu50v0JEfXrnuq7xvLZpbTBAyG7Pea aFL2xYXSWCR3Gardpc5Nksb42yvd/R7sV/A711i/m62TNuG9AA+Ig78p+l3sFwr2BQBV 8O4Yb9TL6ExYUPj+tkmTxdevYwLI/bNwhAOSYRXdYPDxGINrOwS45fpeSUjZxP7/XBri 5kXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=t/Dfg3V+; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d9-v6si14348459pli.201.2018.05.30.13.41.25; Wed, 30 May 2018 13:41:40 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=t/Dfg3V+; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932269AbeE3Ujy (ORCPT + 99 others); Wed, 30 May 2018 16:39:54 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:43725 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932176AbeE3Ujx (ORCPT ); Wed, 30 May 2018 16:39:53 -0400 Received: by mail-lf0-f66.google.com with SMTP id n18-v6so6335793lfh.10 for ; Wed, 30 May 2018 13:39:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=N9He6dcIJSiowP+bDJ5qeUgzLlhs5zCatxDWIfVrpdE=; b=t/Dfg3V+aAlxr1FFrQFxEOKZ+hZdRguaugC6Qal0/YWGxTx+BVqqejf5MGljlg5RZB JNfX+i/HMAXnvEAWVQgPbfyYG6G6bviux5D5oxT1UtyZJIFWoEiVqvtNZegge1p37oDt xM1Pb59bsYxRp5i+N8suGu1LXqSZ+y80O11przngyHOfWLyfo59jEYEFUsVkK1eYmpp3 Jy2prmfWVAG8ex/0KMIz1dOhO2IfbR0DKMov1maQElepVjd0hGG8ntdZpBmHtFLH8GXG Ad9JPvMyksnfICB2INXYmiABx8ELN1IlVZ4PsfiSq5buf4CpZgjXkTJrKyj5SEpgWj32 apNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=N9He6dcIJSiowP+bDJ5qeUgzLlhs5zCatxDWIfVrpdE=; b=aKFd8qkxDqbxhdiP2Z1vfNvUFX0mhwN6mkrFt1pl+YdR6j99GnEVDhD91Qf5Qs65Hb CJoTTdXdQm6eG4aISeyID2iI48jy0QOfSHP/ioDj86ZaESaa5WxwcpqWgE4N0t0BKCSG EAsBAby/M3X+l/Qmnv+LITRsqw8KnDlBRcJ9nuu8Sm/pAHB/D/zaiTzmn5ak5NaKTLIA bLDy3+RlLWR6qTQJctWvOQ2eqzr6JyeyvvrjXtEDDtUfDIzr+PvpHFdexM7CDtwv3NKh Rc3BTBaQRLPTtjwoZ3pqMSGvuj2no1L6TEvIz8S9jc7MTxc4WmE58UfMhkS0oh3XgCh6 6pJA== X-Gm-Message-State: ALKqPweXOPCbfFMttTEydhWP4nTYx1Ua9TlnIux0v03dyKk/aGR0i407 8RwPLOS2l6UvKs+qgdUH/8Q= X-Received: by 2002:a2e:401b:: with SMTP id n27-v6mr263890lja.6.1527712792017; Wed, 30 May 2018 13:39:52 -0700 (PDT) Received: from z50.localnet ([31.0.82.127]) by smtp.gmail.com with ESMTPSA id j15-v6sm7236304lji.89.2018.05.30.13.39.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 May 2018 13:39:51 -0700 (PDT) From: Janusz Krzysztofik To: Boris Brezillon 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 Date: Wed, 30 May 2018 22:39:03 +0200 Message-ID: <1582841.uoaVdad1fL@z50> In-Reply-To: <20180530195220.3527f0fc@bbrezillon> References: <1543045.tPZatK9yHU@z50> <20180530195220.3527f0fc@bbrezillon> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday, May 30, 2018 7:52:20 PM CEST Boris Brezillon wrote: > 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? When e.g. I'd like to register my GPIO consumer platform device at late_initcall for some reason, and I'm not sure what exact dev_name my consomer will be registered with by the platform bus. In that case I think I should assign dev_name to the lookup table after the consumer device is registered and its exact dev_name can be obtained, then register the table, Am I missing something? Thanks, Janusz