Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1587698imm; Fri, 12 Oct 2018 23:06:24 -0700 (PDT) X-Google-Smtp-Source: ACcGV60eodKxE4PaimAKJjARBXCTfli1WcfK9tL5CIAvOr8HJA3naHvcZsa3oOaEA3juUWHZ4u3t X-Received: by 2002:a62:2fc1:: with SMTP id v184-v6mr9076516pfv.115.1539410784317; Fri, 12 Oct 2018 23:06:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539410784; cv=none; d=google.com; s=arc-20160816; b=b33iy7zNNJTmxMswdXAa99vXhyOetgHX93UU6/hwHApUqOJ9d2RDIF/9F91dwJ/pXr JPseSou0nOwEnvn3z8TEx038WjhUvsug0NN3xLhwFSMj4UPYppz2NXbMBC15jtzVhTHL ejdnJz3GPYTHz2WEh/hvzEvGZ0YCuNVfhkePZ1voWbwtzzLNDtoYQdEv8FfeSf3pmAL/ 14AGuWtwIuzyyUS4XDZCeUeQJ12AvvA4fEDRbE1cEzeEXveUMgu/PBdslk3JD+U0/tva 01Hx30T520SVEQ2kr/lPCx3c8s5WvnK1s7icsxeCE+OpsGKsPQAmNqoxSdS3FoKV0MQ8 aUNg== 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; bh=ieNsphqAMASWxu2NP5gYGWDVP4xsOgkY3UcsppXrbWY=; b=ANe/hKfgHDhxOKbsVUqXwn08KSj99sP8sYu4F/eQ/HOs2m865KUbzePSymaB6v4fMK NjO2ARoFXps7/l04rkWfZl4Wv+umrFwnZF4zXvxyeTFtL1383Ujf5G5i1almyPLi/5MJ U9q0Mo6zElJ8eziBVisFg91tuev3dbC7URpH5p1FxxFBIiBup++sFh0OHQJ+X7pw3YDw JxouNc7EUd8tuRydShaVjEtuQIa+OhwwhWZAP/ghWOgBtx8mjQsmpsI29cuXT2DnSaML 2hrkbpo2R0/M0RDRrG9cun0Ao4wK1ZYP0Wjo1RigVYT12yHT3lN7SKMFca9ZdWKCdEeY cZTA== 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 p9-v6si195960pfe.76.2018.10.12.23.06.07; Fri, 12 Oct 2018 23:06:24 -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 S1726312AbeJMNlh (ORCPT + 99 others); Sat, 13 Oct 2018 09:41:37 -0400 Received: from mail.bootlin.com ([62.4.15.54]:35366 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726097AbeJMNlg (ORCPT ); Sat, 13 Oct 2018 09:41:36 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 65747207A3; Sat, 13 Oct 2018 08:05:42 +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 (unknown [91.160.177.164]) by mail.bootlin.com (Postfix) with ESMTPSA id 1D41520717; Sat, 13 Oct 2018 08:05:42 +0200 (CEST) Date: Sat, 13 Oct 2018 08:05:42 +0200 From: Boris Brezillon To: Janusz Krzysztofik Cc: Miquel Raynal , Richard Weinberger , David Woodhouse , Brian Norris , Marek Vasut , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/2] mtd: rawnand: ams-delta: Use ->exec_op() Message-ID: <20181013080542.2ae9b199@bbrezillon> In-Reply-To: <20181012204101.26274-2-jmkrzyszt@gmail.com> References: <20181003120028.9257-1-jmkrzyszt@gmail.com> <20181012204101.26274-1-jmkrzyszt@gmail.com> <20181012204101.26274-2-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 Hi Janusz, On Fri, 12 Oct 2018 22:41:01 +0200 Janusz Krzysztofik wrote: > Replace legacy callbacks with ->select_chip() and ->exec_op(). > > In order to remove any references to legacy structure members, use of > .IO_ADDR_R/W has been replaced wit runtime calculations based on ^ with > priv->io_base. Can we do that in 2 steps? 1/ Stop using .IO_ADDR_R/W 2/ Convert the driver to ->exec_op() > > Suggested-by: Boris Brezillon > Signed-off-by: Janusz Krzysztofik > --- [...] > -static int ams_delta_nand_ready(struct nand_chip *this) > +static int ams_delta_exec_op(struct nand_chip *this, > + const struct nand_operation *op, bool check_only) > { > struct ams_delta_nand *priv = nand_get_controller_data(this); > + const struct nand_op_instr *instr; > + int ret = 0; > + You should have: if (check_only) return 0; Other than that, the conversion looks good, so you can add Reviewed-by: Boris Brezillon once you've addressed my comments. Regards, Boris > + for (instr = op->instrs; instr < op->instrs + op->ninstrs; instr++) { > + > + switch (instr->type) { > + case NAND_OP_CMD_INSTR: > + gpiod_set_value(priv->gpiod_cle, 1); > + ams_delta_write_buf(priv, &instr->ctx.cmd.opcode, 1); > + gpiod_set_value(priv->gpiod_cle, 0); > + break; > + > + case NAND_OP_ADDR_INSTR: > + gpiod_set_value(priv->gpiod_ale, 1); > + ams_delta_write_buf(priv, instr->ctx.addr.addrs, > + instr->ctx.addr.naddrs); > + gpiod_set_value(priv->gpiod_ale, 0); > + break; > + > + case NAND_OP_DATA_IN_INSTR: > + ams_delta_read_buf(priv, instr->ctx.data.buf.in, > + instr->ctx.data.len); > + break; > + > + case NAND_OP_DATA_OUT_INSTR: > + ams_delta_write_buf(priv, instr->ctx.data.buf.out, > + instr->ctx.data.len); > + break; > + > + case NAND_OP_WAITRDY_INSTR: > + ret = priv->gpiod_rdy ? > + nand_gpio_waitrdy(this, priv->gpiod_rdy, > + instr->ctx.waitrdy.timeout_ms) : > + nand_soft_waitrdy(this, > + instr->ctx.waitrdy.timeout_ms); > + break; > + } > + > + if (ret) > + break; > + } > > - return gpiod_get_value(priv->gpiod_rdy); > + return ret; > }