Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp5073091imm; Fri, 18 May 2018 16:15:52 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpY89681uNbvIeLGEU7RxQwC4iV6fLEmEDFiPeuHJGm/+moboIhRQEPNAEjaybso4lOI3mf X-Received: by 2002:a63:6c04:: with SMTP id h4-v6mr9024362pgc.220.1526685352212; Fri, 18 May 2018 16:15:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526685352; cv=none; d=google.com; s=arc-20160816; b=KuhAbAatTSERvpV7oGxOCiMYa4SzBNt/ErceEW5tKBkORmi6mhwjV+GnjocTk0wkuI TCH/CAwvzJ/iXWPegH5OUMJCRP96yp42keAtFxIOpvuWMyjtnM5w2j9RXqIPSauUK79u l1qNkbMDQR2okuiGc1LumFzpbGK8FLElswlAF8boX7vlRja3G00SwYc4LeJMUga+E8pu xoHVmLElxwas+vngaCzB5LyKSaZTe3WK+lV2W9zAX8YZw4Z5ly5Q2Z3vuRivlYXGlI69 BiN8+xGeZfUmPl4lpdYPwEETggoLjHXzO6yAyjoYO/rgX04j/IuaI/Gib6WvP6ok4Dbw uSgg== 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=hKC8nxn1k+mmST5/WiZ81N0yZnuvoFuJPle0YuMxOdw=; b=qBoGuucrbp3CJWSxVHZkdbopZIJEkf+fd+/F4DaGXlAprbANX2sN+604s2nx83JAik Qt1GtBmMGeti6HuMTS3iCAzK1f5LUZj1xXAFtdLotyCznQEcrX1Mw2AwB1y8vSPoi8sR H5dhAkLrNyrMgSD6ibDJGrrvl7NP34Ti9ZNzw+TMLeMeSK4ec5DZDew1ZbbxcX/GEd2i HKb3XL2j/fqatK6e9gn6aSQiDaFOLcF+m5tQKQ7KdtgwbNw1KvMvtTulFR+fffZOZALN 91qusoUOVuOzBx3AsqNaYGKtLtOEWDadkPte4lmY+lJN2MM1EQHvjYJ6fR9MaXAIl5S8 AUgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=e2xaw7rB; 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 z7-v6si6604387pgv.614.2018.05.18.16.15.37; Fri, 18 May 2018 16:15:52 -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=e2xaw7rB; 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 S1752128AbeERXP3 (ORCPT + 99 others); Fri, 18 May 2018 19:15:29 -0400 Received: from mail-lf0-f68.google.com ([209.85.215.68]:42368 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751700AbeERXPZ (ORCPT ); Fri, 18 May 2018 19:15:25 -0400 Received: by mail-lf0-f68.google.com with SMTP id b18-v6so16191655lfa.9; Fri, 18 May 2018 16:15:23 -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=hKC8nxn1k+mmST5/WiZ81N0yZnuvoFuJPle0YuMxOdw=; b=e2xaw7rBnrkxhC7EBkynf0KMlzUl/gU5YpAnPrJ4v/jLUMNPttZ/c6Hy6y8B8Ervfz gro4zhH1MUQDGXSEzm9fxrUyvLsgKzo6+3kScqoGoRQ68Eeov6jUW6DMKUdZUi8pzrck tQL+KVWfLrHuVfPOI63TdxH/U4B1kihwITJJpL96U8OQ0j85fiAY4mk+Yb9Ks4zXvfQM 2T8rVLmct0XXQ40VHukxHtzjboOqVJKgKiXkWCIVCLVAX3M0F75Cdk/pjwwqxQBnu2Ge o8ph1OhArrAdcYW8tTLH/H535FaKY58o1KydeYy/zrLKtdI4IDzofRLWqRndTCLDEZOK VgvQ== 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=hKC8nxn1k+mmST5/WiZ81N0yZnuvoFuJPle0YuMxOdw=; b=dZMod1P5Nocq+MCI3DRIKpEMFpB/Ab81tNme/yckLg+MKdFR37n/ozHU3SI+TSGdNG E2ajWxVrqUwLu0YcakrgxrObLlaMKZaQQSQCBaNXovjLrC+L/YnUGa79IyhQV8JA1hVK ip0abSOcJu6fMenfsSDNw2tqzSh2yzKCFzwwYIWArqbk8SWqU8tj/w8mCViNzmQ+Rubp /Bt6vYTP2DRjrSnOkbvdQmhrxJa+ou/5JWg7vnZr8DZE7Hbj+sWmYCEanPrtcA5L+VLl l/brUBUKr0oKoXxBsKXrn8aRXTsen/JWnlktGaM8kac0PUutPFlyPN8Y/2dvkfkgt8U5 XF4A== X-Gm-Message-State: ALKqPwf9rj9u+ifuz8e51X6zedaxhyBwT96sKIEXrDeTmIVCxeC+c88a qZD4ih/Ywf3R8pd7R9rq0Zg= X-Received: by 2002:a19:18e9:: with SMTP id 102-v6mr20463444lfy.10.1526685323172; Fri, 18 May 2018 16:15:23 -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 i6-v6sm275161lfc.12.2018.05.18.16.15.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 May 2018 16:15:22 -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: Sat, 19 May 2018 01:15:30 +0200 Message-ID: <3427199.r4OBoDP6Xz@z50> In-Reply-To: References: <20180518210954.29044-1-jmkrzyszt@gmail.com> <20180518210954.29044-5-jmkrzyszt@gmail.com> 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 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. > > this->dev_ready = ams_delta_nand_ready; > > > > } else { > > > > this->dev_ready = NULL; > > pr_notice("Couldn't request gpio for Delta NAND > > ready.\n"); > > dev_notice() ? Sure, but maybe in a separate patch? That's not a new code just being added but an existing one, not the merit of the change. > > } > > > > +err_gpiod: > > + if (err == -ENODEV || err == -ENOENT) > > + err = -EPROBE_DEFER; > > Hmm... Amstrad Delta uses gpio-mmio driver. Unfortunatelty that driver is not availble before device init phase, unlike other crucial GPIO drivers which are initialized earlier, e.g. during the postcore or at latetst the subsys phase. Hence, devices which depend on GPIO pins provided by gpio-mmio must either be declared late or fail softly so they get another chance of being probed succesfully. I thought of replacing the gpio-mmio platform driver with bgpio functions it exports but for now I haven't implemented it, not even shared the idea. Does it really hurt to return -EPROBE_DEFER if a GPIO pin can't be obtained? Thanks, Janusz