Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4726112imm; Wed, 30 May 2018 10:43:37 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJZ77y7w0DY4Jdk1Ewkidmuae79bsBTMbFrIAxRD1Yn0bVQaS1Ohch6OSD0gSgK7Od04ker X-Received: by 2002:a65:5789:: with SMTP id b9-v6mr2957362pgr.417.1527702217811; Wed, 30 May 2018 10:43:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527702217; cv=none; d=google.com; s=arc-20160816; b=C3V8LYKS6KDsMncmxF/WeK9cWtglGDaIrWzNWoVmg6yjOwsrVG7HhaUED0r6e1EoB7 6qO8GGfa7kpciyfV0ZVciPpyh59ZQOih8dlUmzVqUY5way+uKbTB2RiHqiw/hwBORoA7 hgGMKE+j5fk7IBRqXXkYyAptbys8jb60OKpUSt1rXMGJ6C5WqU1AD+9Xw+S/cELqIsux eyJ+aO8NTjyMtC5wFF+A0TgKLwhyN2uqFnVtjlpaPJOswhAplelSeNt+0UnYZpz1wuWN eTQp8OV3pQxL4Me0tD4zIX6OZuU8NuRi6BKBY4VyJbjLdCNXcp325hth7tTnXCxEjMJf dkVg== 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=/LJ7SGjfpdScTceNFuSSI1Us+TbToRjyObBFcTD3esY=; b=RhdryrYaErHtM/EBUXXZZcG+J4c2FqaCZf3zjG0GzqjtBNCL0BO1aFY62nwI49xUvb f64ElSanJPLyQAXgFNrM5DtOYB/fXOa+z0uzoVAvy1xkS9n8fWv3gJCZQc5dZvBifhCJ yptBhc/Vi0TG+9D4RWEJ6TpMtmu1DUuWKvKuQeBUfDYWWSihLWJPeb/GHvXyO58n/Czr mBlIvxvTd/z2TITBe5LUWDY7hO4IJ2EQ2A7M+tO2A2Ai/aSyd2aKwQ/bLGmAX3dKV85F P309AUQFdeKsjZax1YEh1urxVrKiLdw0ANd+DacD3tEuqE2mIIwp1TnsIYh5FwmWNijO /Hrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IXSm7eKr; 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 o89-v6si10079022pfi.165.2018.05.30.10.43.23; Wed, 30 May 2018 10:43:37 -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=IXSm7eKr; 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 S1753658AbeE3Rm7 (ORCPT + 99 others); Wed, 30 May 2018 13:42:59 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:44584 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753190AbeE3Rmy (ORCPT ); Wed, 30 May 2018 13:42:54 -0400 Received: by mail-lf0-f65.google.com with SMTP id 36-v6so3656571lfr.11 for ; Wed, 30 May 2018 10:42:53 -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=/LJ7SGjfpdScTceNFuSSI1Us+TbToRjyObBFcTD3esY=; b=IXSm7eKrxSsmcp8Wj9dGoSJIIDKsgskOQvMNj1tinBCvMZG3ki9Kx9Y2ssUIhiKLjJ BSLveYpJG8/o/ftwpaYbo1SxNQB0Gsuzmk+J/3LQyhyuIL+HApy7HTRQgfzg+wRdAFkD VqS1rs0OJEATy/waUQIR+kZLHPJiKJUwuE78a6JztS6HoU7vX/ptF5RjElDe6qwx+XZM yv83BY7utaDkCSrX2E+p6OOvWI0Q31o8EyrtIvzaK9d/Pt20m08MJAvFX99ApcenLucl QqpHscDyt4fDBvaFs2JBPQfJPp60zyYCsg/tiuWil8hao7ZB+ytLNwl+7eri13jP0jxf ZRzw== 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=/LJ7SGjfpdScTceNFuSSI1Us+TbToRjyObBFcTD3esY=; b=qIN+nux7LdEUVsecvxwSLXBEiVF9yTV9P2C8ylVGaqv5CNYHA0vhGd5hxqxS7DE90A DG5Rug/tmGL7ZceMrkb7EVtrk5S98gPLXrrQXmemxFExTrJ2Uxc6+F9iqzJavriMEdIw y121XYC8yWnF23xd/eK6V+sWNi/MMU0zEmtGWAax79mij7K3IIy19lR9+RQkUtm49QUa wvxGcd4z2XVh75tW2h1nfaa/veoMTbq+xAzui22dFw9PBDnOeRU9ecIAInqELABINHSH fG6ddgqlYtgw1gLuOYp53l/to9dtJ79i6TPLApbszKS88qitmr0D2hFnpn1qnV9dz7Bw V40g== X-Gm-Message-State: ALKqPwdiaBjM6VJ9kNqZwZ23lum2iFnj5jTYCdOxLHUZkTmjBoNwZ2pq 4V2iPD/zk879O37b7UnY4E8= X-Received: by 2002:a2e:3806:: with SMTP id f6-v6mr2979984lja.25.1527702172866; Wed, 30 May 2018 10:42:52 -0700 (PDT) Received: from z50.localnet (93-181-165-181.internetia.net.pl. [93.181.165.181]) by smtp.gmail.com with ESMTPSA id x10-v6sm5537720lfe.39.2018.05.30.10.42.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 May 2018 10:42:52 -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 19:43:09 +0200 Message-ID: <1543045.tPZatK9yHU@z50> In-Reply-To: <20180530110500.185b5b7b@bbrezillon> References: <20180525222046.11200-1-jmkrzyszt@gmail.com> <20180530110500.185b5b7b@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 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. Thanks, Janusz