Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2872139imu; Fri, 18 Jan 2019 00:27:15 -0800 (PST) X-Google-Smtp-Source: ALg8bN5i7woEF8k7HX17Jge+nNoJdTVN+aeRrLGGTwknyIx3r7C4Z1mo6Ao3VeiOrkVujFRKtBxB X-Received: by 2002:a17:902:aa8c:: with SMTP id d12mr18542814plr.25.1547800035766; Fri, 18 Jan 2019 00:27:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547800035; cv=none; d=google.com; s=arc-20160816; b=0Du53hqVSzAunfvmrLj833WbLnd96EchfIxqcLUa8A/rQTlBdO724lxcO7vvokrEJH JZeS5u5RUYCQ0g+4aN5guHahwC8yEPYQ8Hm4FrRxO0yvGq3Ti/YaUljir8W+0m0QG6hg 5f/zQBScYpLE91i5aMkmr3tphx/gfqFYbxSalzDHdOkCXjOXHmd9GbHkNqK68qihZg+y MfkEHRHTRsJRFE8vNaJDkcflikTLpnaEj0dC09/atmkv+i26+LQKRhyp5tmbKkAXxjGY r10xrX+SKILXdkXWfCiRN4WySli4YE9a9WmF583IVklvBeNeSjGqxggbK0Hns+URbx1x q1dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=Xfqq3e6qu7bc6iU64I4bUHm0HZdRoiEGbOYPlLEwVsg=; b=x1x8cqMj0oF+e3p8oByOoY9pkY96H0FUWTzI56jDgLvElNbkQ1Mk/luPWV3zcXhaV7 gV3Z4nhce68M32+eudjaU568Fa//YkSCwlyvNMsLYHjRkuH5luziGyJeePfDdfvpMtm8 XoqHCNv0DJtlwBwum0CzpXJnH6D/Zpg6orhI0jJtlOdAGwYaZisNSjzM8aDyuSEvKKSK uyZTR4xcv85gFkgCV5YUOY1Sb4YfkryQ4TdYbWtTPMHHIvjTfpKabVSQECaqL22UBwck ApsEqlRnxFeungdO0t+3SQly565GqmXj9puF8OKtV9TMVHS6LeW6QVsZmzjPaVjBqkV3 KaoQ== 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 g21si3703302plo.435.2019.01.18.00.26.57; Fri, 18 Jan 2019 00:27:15 -0800 (PST) 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 S1727472AbfARIZk (ORCPT + 99 others); Fri, 18 Jan 2019 03:25:40 -0500 Received: from mail-vs1-f65.google.com ([209.85.217.65]:33654 "EHLO mail-vs1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726309AbfARIZk (ORCPT ); Fri, 18 Jan 2019 03:25:40 -0500 Received: by mail-vs1-f65.google.com with SMTP id p74so7957192vsc.0; Fri, 18 Jan 2019 00:25:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Xfqq3e6qu7bc6iU64I4bUHm0HZdRoiEGbOYPlLEwVsg=; b=GFgZOpGVdKlJjVWyb7WtzyRIBNpd5uZAIzvn8y2UDNM1HXxhaPQk3x98qu1sscXl6A Pu9RuHNFP8SNHJohFVwzILkaF24r1nzwLiTKaDmGH7Ot3B8x+noM6+i/Z5/5ff8GcEzp AjU+MJ4C+plYVkALg5Rkb6G1OKaU7ziP+dSSN1cOA8zE9x/V5Bj0SmgO9yMMfKLhRtPR eVlTzkDYef7xqKT6HFbqyi6ubFl2QH9S4oKTaj7FhWSY3+mIHSaWTCEfyRHZkcau8yaO DYc8fVRPP2ys7LXTGtXhKpATQE9tYAc7ELe6qAIx68nXJ1G2wA81dMdntY7M2wN9zN0d f67Q== X-Gm-Message-State: AJcUukfmuCYSOVvrLAgt3ctDClTbxfXn1CqbS2bD8lAsGo2T4DcRpSne Qq0un/QCgvTSN09QbR/kVW16mFkPDSgfe2vgbi5VRg== X-Received: by 2002:a67:b60d:: with SMTP id d13mr7493738vsm.152.1547799938802; Fri, 18 Jan 2019 00:25:38 -0800 (PST) MIME-Version: 1.0 References: <1547790855-22120-1-git-send-email-masonccyang@mxic.com.tw> <1547790855-22120-2-git-send-email-masonccyang@mxic.com.tw> In-Reply-To: <1547790855-22120-2-git-send-email-masonccyang@mxic.com.tw> From: Geert Uytterhoeven Date: Fri, 18 Jan 2019 09:25:26 +0100 Message-ID: Subject: Re: [PATCH v6 1/2] spi: Add Renesas R-Car Gen3 RPC-IF SPI controller driver To: Mason Yang Cc: Mark Brown , Marek Vasut , Linux Kernel Mailing List , linux-spi , Boris Brezillon , Linux-Renesas , Geert Uytterhoeven , Sergei Shtylyov , juliensu@mxic.com.tw, Simon Horman , zhengxunli@mxic.com.tw Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Mason, On Fri, Jan 18, 2019 at 6:55 AM Mason Yang wrote: > Add a driver for Renesas R-Car Gen3 RPC-IF SPI controller. > > Signed-off-by: Mason Yang > Signed-off-by: Sergei Shtylyov Thanks for the update! > --- /dev/null > +++ b/drivers/spi/spi-renesas-rpc.c > @@ -0,0 +1,800 @@ > +static int rpc_spi_xfer_message(struct rpc_spi *rpc, > + struct spi_transfer *t) As "t" is not an arbitrary transfer, but the last transfer containing the actual data, I'd call it "last", or "data_xfer". > +{ > + int ret; > + > + ret = rpc_spi_set_freq(rpc, t->speed_hz); > + if (ret) > + return ret; > + > + ret = rpc_spi_io_xfer(rpc, > + rpc->xfer_dir == SPI_MEM_DATA_OUT ? > + t->tx_buf : NULL, > + rpc->xfer_dir == SPI_MEM_DATA_IN ? > + t->rx_buf : NULL); > + > + return ret; > +} > + > +static int rpc_spi_transfer_one_message(struct spi_controller *ctlr, > + struct spi_message *msg) > +{ > + struct rpc_spi *rpc = spi_controller_get_devdata(ctlr); > + struct spi_transfer *t; Likewise. > + int ret; > + > + rpc_spi_transfer_setup(rpc, msg); > + > + t = list_last_entry(&msg->transfers, struct spi_transfer, > + transfer_list); > + > + ret = rpc_spi_xfer_message(rpc, t); As this function is small, perhaps just inline it here? IMHO that makes the flow clearer. > + if (ret) > + goto out; > + > + msg->status = 0; > + msg->actual_length = rpc->totalxferlen; > +out: > + spi_finalize_current_message(ctlr); > + return 0; > +} The rest looks good to me, thanks! Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds