Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp6694019imm; Sun, 20 May 2018 08:38:17 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoLTPoWXPpDMpMBBscf2su5sl45WxgxWx8nYOjSkX7P1LOlHpBKake9gdXo64YUH73nt5Cc X-Received: by 2002:a65:4d08:: with SMTP id i8-v6mr1136510pgt.51.1526830697728; Sun, 20 May 2018 08:38:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526830697; cv=none; d=google.com; s=arc-20160816; b=p0ZJEA7qzbNiwmZ707LO1RJlt51t/z2mdAajb1dbXfr21rKLv394AAoa/UwNv6mrfX 98dHPnHJ4WFrMVs/YGw2Glk4nkUctZws5caQ9x7DNCQXtGMz0zmFvI1ixrb06Icq0+Mf YALSfwx72o00AFdQpZQjpHQRAFgVY+F9LmjN+Z++eJzXCsfKxTAHs1GweVqH2ix7mVtG KpIpe3qoZ4KIhsT3GaNgj4JoL7GW/gl3tyVcwZLxnaeE1Q3Jjxu+5b5m1dIyw0Zs8Vrf TilKHk06OZw3BjOrtkSd+gOKZ3JmjtILqtXnKQvNZkG9OecsPAlwcgP3M0dgDrAgrzBn iZ8w== 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=RkUinN+fxENu/B0jvacQxM9L7rhH8Ssg6P0jZha1P7E=; b=TlyyRlgsSXlEdrl9dxLPtilT1AIZzie/tjw2Ivzxjfx3Je8EgVLwfAueJlHFe/rMiP p661EiSo0SOrMb/pLN6RY2TdOlTCLI88/hoPVtlwUOTWTE49BGoVuPvl63K/JMXLusOo H3EY3LnZIpZgoTkHrRGaiC8vcYY7Z6jB6eA9e9g28KYwFWhvvRUMRJnlTk7SgO/7WWPd 3D3uFecNggcyb3Y0nZ29OAphfZuTnnVteRW42P/yMSHZHPqa4Nwy/LtIOkjwahTI7tsg xsnXjiQ4apcjtbh7SOsYSrD9e7I8KghD0f9AqdZEE6Pgxeh6z8u2+zWcklkEKxrHKw4w C/KQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=o+cwJ4BK; 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 m13-v6si9498284pgu.237.2018.05.20.08.38.03; Sun, 20 May 2018 08:38:17 -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=o+cwJ4BK; 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 S1752308AbeETPhr (ORCPT + 99 others); Sun, 20 May 2018 11:37:47 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:40893 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751348AbeETPho (ORCPT ); Sun, 20 May 2018 11:37:44 -0400 Received: by mail-lf0-f66.google.com with SMTP id u140-v6so8152123lff.7; Sun, 20 May 2018 08:37:43 -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=RkUinN+fxENu/B0jvacQxM9L7rhH8Ssg6P0jZha1P7E=; b=o+cwJ4BKFlvv8iWrqQnQm57xMICb+GUk86isuvLiY+4y2GUn70+l0olkcHVZ2IubXl iWfm5qMSmG5TE68H4X2Titow3RhpNyONQBJy5pY0mmmmDRKBscopIgMRtf+gG9KLKUcI T4vEQuP6S+l/Y9YVcaoos1/IRH61vORVGXVxpjAPIRk853BrcmJbF/Si4uvC66jBl27S YyPffmf+7G7/9jawKlNB3XfC35iRDRTORTtS1K9x4I463r19XBLntS66as+laVB877jk zD15R4Qep/gOhKNR7RnnFYsNTb6G/ALEY2laDPATl+uOye5qrk4kX77JAF85HtlEZzBo 1z2A== 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=RkUinN+fxENu/B0jvacQxM9L7rhH8Ssg6P0jZha1P7E=; b=l1WcNRSQ2g+6QBiW658AkebpTx3a0KdVDHUPy26FGAMNaxYThJe8py1hxYWpcyfOVR uHZY3KB2232ShjXLfUr6+p1qATRZmo58RHLdpjxhf69Wah4rMX4vqNBQJI2slJQHKxmY l18rBLzS9Xp5jiRuQlQC3PxqbQlPhmTwcf3T2ZMyPbKcTLeBL0HrN4/N92shrPTOYYnc 0CeOcuAA6lBQDl+Q56st9gOfmEIsTUKEMNqXfwOZiAV0ufMb+m6jieCtQ829RgfZpf5U hZsI+H5TORsG36FTrdXOCKZUuHDLkN3PMqIuzIy+AiQNwzNPPmX25EhgGKzOtM289zVj Ny9g== X-Gm-Message-State: ALKqPwfWihyGluNNkZA8ipq0OT7jH0D/ebPJFVnCEjAuxJHbnmB/rAQp qNO4OyUuhY+ivPnooOjbNbc= X-Received: by 2002:a19:db9b:: with SMTP id t27-v6mr22595493lfi.64.1526830662505; Sun, 20 May 2018 08:37:42 -0700 (PDT) Received: from z50.localnet (apn-31-0-34-132.dynamic.gprs.plus.pl. [31.0.34.132]) by smtp.gmail.com with ESMTPSA id k76-v6sm2077445lje.13.2018.05.20.08.37.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 20 May 2018 08:37:41 -0700 (PDT) From: Janusz Krzysztofik To: Andy Shevchenko Cc: Tony Lindgren , Dmitry Torokhov , Boris Brezillon , Tomi Valkeinen , Mark Brown , Aaro Koskinen , Richard Weinberger , Peter Ujfalusi , Jarkko Nikula , Liam Girdwood , linux-arm Mailing List , Linux OMAP Mailing List , Linux Kernel Mailing List , linux-input , "open list:MEMORY TECHNOLOGY..." , linux-fbdev@vger.kernel.org, ALSA Development Mailing List Subject: Re: [PATCH 5/6] mtd: rawnand: ams-delta: use GPIO lookup table Date: Sun, 20 May 2018 17:37:44 +0200 Message-ID: <3505791.x6nWYTo8eb@z50> In-Reply-To: References: <20180518210954.29044-1-jmkrzyszt@gmail.com> <5456625.lDWjtgZygK@z50> 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 Sunday, May 20, 2018 4:44:31 PM CEST Andy Shevchenko wrote: > On Sun, May 20, 2018 at 12:55 AM, Janusz Krzysztofik > > wrote: > > On Saturday, May 19, 2018 8:00:38 PM CEST Andy Shevchenko wrote: > >> On Sat, May 19, 2018 at 2:15 AM, Janusz Krzysztofik > > > > wrote: > >> NULL check in practice discards the _optional part of gpiod_get(). So, > >> either you use non-optional variant and decide how to handle an > >> errors, or user _optional w/o NULL check. > > > > OK, I'm going to use something like the below while submitting v2: > > > > - gpiod_rdy = devm_gpiod_get_optional(&pdev->dev, "rdy", GPIOD_IN); > > - if (!IS_ERR_OR_NULL(gpiod_rdy)) { > > - this->dev_ready = ams_delta_nand_ready; > > - } else { > > - this->dev_ready = NULL; > > - pr_notice("Couldn't request gpio for Delta NAND > > ready.\n"); > > + priv->gpiod_rdy = devm_gpiod_get_optional(&pdev->dev, "rdy", > > + GPIOD_IN); > > + if (IS_ERR(priv->gpiod_rdy)) { > > + err = PTR_ERR(priv->gpiod_nwp); > > + dev_warn(&pdev->dev, "RDY GPIO request failed (%d)\n", > > err); + goto err_gpiod; > > > > } > > > > + if (priv->gpiod_rdy) > > + this->dev_ready = ams_delta_nand_ready; > > This makes sense. > > Though, I completely dislike "rdy" name of GPIO. Where is it documented? No documentation files for Amstrad Delta nor for its NAND driver specifically exist under Documentation/. However, there exist some for generic GPIO NAND driver where the pin name "rdy" is used explicitly: Documentation/driver-api/gpio/drivers-on-gpio.rst Documentation/devicetree/bindings/mtd/gpio-control-nand.txt You can find that mnemonic used across drivers/mtd/nand/, standalone or as a suffix, including the Amstrad Delta NAND driver before the change discussed. To be honest, I don't like it much either, but I'm just using it instead of inventing something new. Thanks, Janusz