Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp40339imm; Tue, 17 Jul 2018 13:32:31 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfh/aLe97tHNl0Y5ZwdCIuC/TbdJa5TZuVnhqcU1gxQE7XtXv7eLA36j7uE2wuvaHIhVjZg X-Received: by 2002:a17:902:8f83:: with SMTP id z3-v6mr3007105plo.111.1531859551000; Tue, 17 Jul 2018 13:32:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531859550; cv=none; d=google.com; s=arc-20160816; b=zuVCB1SP6Gg+P2mrKB5levXohDG0fX67kJRM4pCqJjG3nWPvHT0zBggSKXsWyTYNXc i8xkzQG3nkMU+8dGbgrcrw/ZYD4q5IjLObFpCGzdGMh9LWO7HiC1G0GGvJZMVAiNREUd CVhnm99hwSG2FKgdcpmeUjSbhdAGESRJbHUlUxuPzwB8MaPoYAD2lnB4VD4CXj1cl1a+ 0ux7z9i/Ccglb7xmqUIzGYIR1Y5A6JtHQkbp6wK23vJKu1pEDBLIVY2xn7ZZ2um2F5CH FydRIrQDar2iQ7JH8G1zdOyHV/kbGhAedZoNcqtB7ie96aX3bNhnSvWTBzoEXo/seNSB Kc2g== 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:subject:cc:to:from:date :arc-authentication-results; bh=pPOPfVrwvV4MPbK1QzFqW1pRIOIC0axT89C2mbLSCks=; b=I48jD4zweGHuHo+NUDuZ7PnG2aas4zfdTwlmjOYAiu3LSZdo3XzEV2CRE0W8gYeX8L V1Vt08w1gxhTJIi6w+KDJGq7UlAhADjDkMbtcYhOghpLlbYarjOvpRM+evCUqccKWSu9 +2Z5p1loPjxQHmJhl27J3Q+kMq0ANnmYOOnspvtfqv//FJr/6mrabQzydidEQ7v5qbAH 972RoOasH5jIeEZ2Ii1rlnfhnB2FYIZwbKVdW+Kp++ye8YCW6QOvzdPBwtlE2awNlXaz omgp6ii3Nk4EWYfSbgw2wVWDoEyoIsSCoo5fSyNC3iVafxw+4i9dK1w3sS6YAiWGVZRR 6r7w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l61-v6si1526675plb.507.2018.07.17.13.32.14; Tue, 17 Jul 2018 13:32:30 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729965AbeGQVFw (ORCPT + 99 others); Tue, 17 Jul 2018 17:05:52 -0400 Received: from mail.bootlin.com ([62.4.15.54]:55788 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729657AbeGQVFv (ORCPT ); Tue, 17 Jul 2018 17:05:51 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id E4B05207AB; Tue, 17 Jul 2018 22:31:29 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from bbrezillon (91-160-177-164.subs.proxad.net [91.160.177.164]) by mail.bootlin.com (Postfix) with ESMTPSA id 7401A206F6; Tue, 17 Jul 2018 22:31:29 +0200 (CEST) Date: Tue, 17 Jul 2018 22:31:29 +0200 From: Boris Brezillon To: Janusz Krzysztofik , Tony Lindgren Cc: Miquel Raynal , Richard Weinberger , David Woodhouse , Brian Norris , Marek Vasut , Masahiro Yamada , Krzysztof Kozlowski , Shawn Guo , Shreeya Patel , Arvind Yadav , linux-mtd@lists.infradead.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, Andy Shevchenko Subject: Re: [PATCH RESEND v3] mtd: rawnand: ams-delta: use GPIO lookup table Message-ID: <20180717223129.5e999c50@bbrezillon> In-Reply-To: <20180717170552.17735-1-jmkrzyszt@gmail.com> References: <20180709193850.20191-1-jmkrzyszt@gmail.com> <20180717170552.17735-1-jmkrzyszt@gmail.com> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org +Tony On Tue, 17 Jul 2018 19:05:52 +0200 Janusz Krzysztofik wrote: > Now as Amstrad Delta board - the only user of this driver - provides > GPIO lookup tables, switch from GPIO numbers to GPIO descriptors and > use the table to locate required GPIO pins. > > Declare static variables for storing GPIO descriptors and replace > gpio_ function calls with their gpiod_ equivalents. > > Pin naming used by the driver should be followed while respective GPIO > lookup table is initialized by a board init code. > > Signed-off-by: Janusz Krzysztofik Acked-by: Boris Brezillon Just a minor comment below (nothing important, just a coding style preference). Also, if it goes through the omap tree (I guess it will target 4.20), I'll need an immutable tag, because I have changes touching this driver in the pipe (that's more a request for Tony). > @@ -230,9 +205,42 @@ static int ams_delta_init(struct platform_device *pdev) > platform_set_drvdata(pdev, io_base); > > /* Set chip enabled, but */ > - err = gpio_request_array(_mandatory_gpio, ARRAY_SIZE(_mandatory_gpio)); > - if (err) > - goto out_gpio; > + gpiod_nwp = devm_gpiod_get(&pdev->dev, "nwp", GPIOD_OUT_HIGH); > + if (IS_ERR(gpiod_nwp)) { > + err = PTR_ERR(gpiod_nwp); > + dev_err(&pdev->dev, "NWP GPIO request failed (%d)\n", err); > + goto out_mtd; > + } Can you add a blank line after each if (IS_ERR(gpiod_nwp)) { } block. > + gpiod_nce = devm_gpiod_get(&pdev->dev, "nce", GPIOD_OUT_HIGH); > + if (IS_ERR(gpiod_nce)) { > + err = PTR_ERR(gpiod_nce); > + dev_err(&pdev->dev, "NCE GPIO request failed (%d)\n", err); > + goto out_mtd; > + } > + gpiod_nre = devm_gpiod_get(&pdev->dev, "nre", GPIOD_OUT_HIGH); > + if (IS_ERR(gpiod_nre)) { > + err = PTR_ERR(gpiod_nre); > + dev_err(&pdev->dev, "NRE GPIO request failed (%d)\n", err); > + goto out_mtd; > + } > + gpiod_nwe = devm_gpiod_get(&pdev->dev, "nwe", GPIOD_OUT_HIGH); > + if (IS_ERR(gpiod_nwe)) { > + err = PTR_ERR(gpiod_nwe); > + dev_err(&pdev->dev, "NWE GPIO request failed (%d)\n", err); > + goto out_mtd; > + } > + gpiod_ale = devm_gpiod_get(&pdev->dev, "ale", GPIOD_OUT_LOW); > + if (IS_ERR(gpiod_ale)) { > + err = PTR_ERR(gpiod_ale); > + dev_err(&pdev->dev, "ALE GPIO request failed (%d)\n", err); > + goto out_mtd; > + } > + gpiod_cle = devm_gpiod_get(&pdev->dev, "cle", GPIOD_OUT_LOW); > + if (IS_ERR(gpiod_cle)) { > + err = PTR_ERR(gpiod_cle); > + dev_err(&pdev->dev, "CLE GPIO request failed (%d)\n", err); > + goto out_mtd; > + } > > /* Scan to find existence of the device */ > err = nand_scan(ams_delta_mtd, 1);