Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp6892262imm; Sun, 20 May 2018 13:08:55 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqaTMaiLXaQVS/zLZ06Fk3QZBhhuiOjXtGoEkAcmgKyy9vsejvxZxMZUFxwursMAMyinDC7 X-Received: by 2002:a62:1549:: with SMTP id 70-v6mr17432559pfv.91.1526846935167; Sun, 20 May 2018 13:08:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526846935; cv=none; d=google.com; s=arc-20160816; b=S64538SYQOs9koDTRYD40/wnF9yQQPBYWzpr21q937qnHBW5OHPT3bIzX87nZK4kil YOGsUMsQOixom3cHHQlpljgCR0uzi4iKdQxCawAeMnMZ5kjB+oOgejxsQHppgTPRoWiz DoTSZMnB/Bq/PyM7dMGqTJuRLSfqJ67SeLrfo2iaPPtNbM7BOW0vUK9/NIrCiaaFUIYP DURpWty1cyTm0RW5qszMxGSBwp16nPzCmWhaDTp+SiVQ2iLwDXPvLhC45HGn+vnajXQk +aRpyPLhZ2aSfYu5kW4w/lqml17Y/g4TlCrLp5+wYtr0sCFac5fkJ2w3CePGEiCs/XJo e/ZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=Z0pOdSFkdENtAiADhHmIFTrUyBrC8DStqnmjKWoAywM=; b=U4KUbiaMj5MoOc91akylStd5uBHw0CmI8yv60aNcGMUaELUfZH1gufucnXF5bR2wQL byjKR5gNZLRQlE6CZhC0Wigcla0h1NkVKx1ScQejKUJXHbEZcqPA8QBgDiIB9BRck56/ hFUGdz+f1HeIFW2uNF9fstiC5BWxHQvoYsNEgxDc5lXlWkErd0ConHKXn9ELEOjxg3LZ Numtk42EjMum31pW6D1pEfOsaMKUX+wIvai8scKqI3ALtG2j2geApQ2MuFFctnLfdYY+ zauT4W73PhlM8yr1rrRnRVs1gt1LTUKh126F5VRKxlEJuTLRJ9PdTCukjYTgsTAdwIPS 67/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=t1zYPvNm; 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 s22-v6si12989661plp.216.2018.05.20.13.08.41; Sun, 20 May 2018 13:08:55 -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=t1zYPvNm; 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 S1752532AbeETUI3 (ORCPT + 99 others); Sun, 20 May 2018 16:08:29 -0400 Received: from mail-pl0-f68.google.com ([209.85.160.68]:35625 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751556AbeETUI1 (ORCPT ); Sun, 20 May 2018 16:08:27 -0400 Received: by mail-pl0-f68.google.com with SMTP id i5-v6so7507517plt.2; Sun, 20 May 2018 13:08:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Z0pOdSFkdENtAiADhHmIFTrUyBrC8DStqnmjKWoAywM=; b=t1zYPvNm1gufZ68O6W/MHcIzxgNfo+MfFnU/tUNhx8arWgqBXwTVJP5ENIsChJYVoo TAESOFiA0HYmjSZqayXq5o+YeWsqhN9XikhYow2m8CBZDiaidRQkEebXNKUUBFQkWkp6 008fqBuKhbrgZFWQJo0CCkLzQQLMwM/pFlzKzNy7PSS19zuyWjrifs58KDkwwCRAN/kG Hw6pyNoZa4YOJS3eGiy2tan/+ImL7PaTRJ9PnWSpOgtvzL1tgKYTZYqI9KfLMS9des7L PMwz3hFYA0b1COx0peA6eqPyLwbJO8bjcsNYC5nTHJwUdwV9nD+bmEAM5IQsfDrS9TqH G1bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Z0pOdSFkdENtAiADhHmIFTrUyBrC8DStqnmjKWoAywM=; b=f0NXYU9JASrxj9IX6z+Y+2d0uN72dn2ZNcFEm/keDZeDdDO56KON269GE8Dj6tFrED pg04TDm0H9fhYbLaB0FhuACmitgicwJdbqKytFvuw4ojyrGH7yC7qiH5RnmBAQlCu1Xj 4IDPUpZDJx3jeiV+umWMkjvy4N87K98qHyKsOf/i8MlOI6a1QPOniqxsQ4bhAs/qUE9u iCMTfNkdPF3d6ysu/b0HkuG3uDIwhJZXNUxSXXAxL6YAaWQnOGdM2fuzD9y0a3aehZfo V+WnLrlYtcElaKCjosuSOJ0ppFq8IH41U+H0fm6PrlRH7oqDKzD76sT9xXdorWRoGPvy 8OSA== X-Gm-Message-State: ALKqPwf8CR5iXMztGzL+cAI7Alx2SpcsCU5Bmz2bmQwWSVvgdB2Smbrs lLv8W9Bf0P9ZNHlQ+np/qqk= X-Received: by 2002:a17:902:7046:: with SMTP id h6-v6mr17868979plt.249.1526846906369; Sun, 20 May 2018 13:08:26 -0700 (PDT) Received: from dtor-ws ([2620:0:1000:1511:8de6:27a8:ed13:2ef5]) by smtp.gmail.com with ESMTPSA id k14-v6sm19897741pgr.15.2018.05.20.13.08.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 20 May 2018 13:08:25 -0700 (PDT) Date: Sun, 20 May 2018 13:08:22 -0700 From: Dmitry Torokhov To: Ladislav Michl Cc: Janusz Krzysztofik , Andy Shevchenko , linux-fbdev@vger.kernel.org, ALSA Development Mailing List , Aaro Koskinen , Tony Lindgren , Richard Weinberger , Mark Brown , Liam Girdwood , Linux Kernel Mailing List , Peter Ujfalusi , Boris Brezillon , Tomi Valkeinen , "open list:MEMORY TECHNOLOGY..." , linux-arm Mailing List , linux-input , Linux OMAP Mailing List , Jarkko Nikula Subject: Re: [alsa-devel] [PATCH 5/6] mtd: rawnand: ams-delta: use GPIO lookup table Message-ID: <20180520200822.GA119427@dtor-ws> References: <20180518210954.29044-1-jmkrzyszt@gmail.com> <3427199.r4OBoDP6Xz@z50> <5456625.lDWjtgZygK@z50> <20180520192705.GA12883@lenoch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180520192705.GA12883@lenoch> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, May 20, 2018 at 09:27:05PM +0200, Ladislav Michl wrote: > On Sat, May 19, 2018 at 11:55:51PM +0200, 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: > > > > On Friday, May 18, 2018 11:21:14 PM CEST Andy Shevchenko wrote: > > > >> On Sat, May 19, 2018 at 12:09 AM, Janusz Krzysztofik > > > >> > > > >> wrote: > > > >> > + gpiod_rdy = devm_gpiod_get_optional(&pdev->dev, "rdy", > > > >> > GPIOD_IN); > > > >> > + if (!IS_ERR_OR_NULL(gpiod_rdy)) { > > > >> > > > >> So, is it optional or not at the end? > > > >> If it is, why do we check for NULL? > > > > > > > > As far as I can understand, nand_chip->dev_ready() callback is optional. > > > > That's why I decided to use the _optional variant of devm_gpiod_get(). In > > > > case of ams-delta, the dev_ready() callback depends on availability of > > > > the 'rdy' GPIO pin. As a consequence, I'm checking for both NULL and ERR > > > > in order to decide if dev_ready() will be supported. > > > > > > > > I can pretty well replace it with the standard form and check for ERR only > > > > if the purpose of the _optional form is different. > > > > > > 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; > > Driver will just use worst case delay instead of RDY signal, so this > is perhaps too strict. I will work with degraded performance. If RDY signal is not available then the board should not define it. Degrading performance and having users wondering because RDY is sometimes not available is not great. Especially if we get -EPROBE_DEFER here. Thanks. -- Dmitry