Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp3213752ima; Tue, 23 Oct 2018 02:09:02 -0700 (PDT) X-Google-Smtp-Source: ACcGV60tEtAU77e9f2MPhCoRFIGEwB5b8PWTSl1n2qoZJT1UqEGEprh/XY76RKUa/sOd1vnp3Dtd X-Received: by 2002:a62:dd01:: with SMTP id w1-v6mr48619503pff.129.1540285742627; Tue, 23 Oct 2018 02:09:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540285742; cv=none; d=google.com; s=arc-20160816; b=CeY/KBXms0wRkX2vTXG3uPHsvJuMFKfT0H0vh+qbj1SR492pA8PkmrPhWkyVC2irLa fN3RdP2QL8+t0ik5lJIr89UmrDjNgV7tZ0olKixCYEgdNwyeAI+hnwkU4YQalelLRT/N UEoB+lwJs/Z/T2Z1VRc6fc7QuHy4n9whKSEWlLVdDzI+zspL1stVVtLxWwOrytSCxlio 3ASyyIgtwZrOcKSy9FtVkEgdJCtrkEWls0YPwALlG4/uTRDm7fDFv011OnB7CdNzU8dP T2JkN1JwD8am4AsBpeaG97nahXz9csAe4lSuSuYsplLEBDmAYTUW6DBK8UEbq5jRIFEO MqKQ== 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=p/JNQ8QHwEo6Gvyg7wY/PxpXlubgKq4SA9D/Dm2pn5o=; b=eneBkjOuvHQfEfeVetZt/sHQWE1+AzKBluszZAnko5gcKLKZ6QKWJUVeBkGsJDDqs3 evA/SwwBVomVBZqHfbVrYuiDk1yEYgtu3nu7dbFI20/6sw27hMVNR68ayDGSFuAX6LmF pu9EeUf6pGiKWdcaIflCkAXs/SRwBjz4azbDPR9cwez6GwMMCDuOPT0x8Ka9CR83/dEP 2sMlbwq4cFUr3Ea9kpjAJXyh39VF+Frafwf/A4C61jpjYqetj7nKvdwH698aMEMHq+M0 gs6ZQDs+3KArPwk67Jd8N7KMwrAua+5MI/8EhhgCmrL965mWFdzbQbwLi0qdqvqJjuwd 033Q== 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 m17-v6si750538pgj.155.2018.10.23.02.08.45; Tue, 23 Oct 2018 02:09:02 -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 S1728346AbeJWR3Q (ORCPT + 99 others); Tue, 23 Oct 2018 13:29:16 -0400 Received: from mail.bootlin.com ([62.4.15.54]:40821 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727978AbeJWR3P (ORCPT ); Tue, 23 Oct 2018 13:29:15 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id BE2B6208C7; Tue, 23 Oct 2018 11:06:44 +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 (aaubervilliers-681-1-25-52.w90-88.abo.wanadoo.fr [90.88.145.52]) by mail.bootlin.com (Postfix) with ESMTPSA id 5E57020794; Tue, 23 Oct 2018 11:06:34 +0200 (CEST) Date: Tue, 23 Oct 2018 11:06:34 +0200 From: Boris Brezillon To: Yogesh Narayan Gaur Cc: "linux-mtd@lists.infradead.org" , "marek.vasut@gmail.com" , "broonie@kernel.org" , "linux-spi@vger.kernel.org" , "devicetree@vger.kernel.org" , "robh@kernel.org" , "mark.rutland@arm.com" , "shawnguo@kernel.org" , "linux-arm-kernel@lists.infradead.org" , "computersforpeace@gmail.com" , "frieder.schrempf@exceet.de" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH RESEND v4 1/5] spi: spi-mem: Add driver for NXP FlexSPI controller Message-ID: <20181023110634.26ff2629@bbrezillon> In-Reply-To: <1540284888-32307-2-git-send-email-yogeshnarayan.gaur@nxp.com> References: <1540284888-32307-1-git-send-email-yogeshnarayan.gaur@nxp.com> <1540284888-32307-2-git-send-email-yogeshnarayan.gaur@nxp.com> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; 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 On Tue, 23 Oct 2018 08:56:46 +0000 Yogesh Narayan Gaur wrote: > +struct nxp_fspi { > + void __iomem *iobase; > + void __iomem *ahb_addr; > + u32 memmap_phy; > + u32 memmap_phy_size; > + struct clk *clk, *clk_en; > + struct device *dev; > + struct completion c; > + const struct nxp_fspi_devtype_data *devtype_data; > + struct mutex lock; > + struct pm_qos_request pm_qos_req; > + int selected; > + void (*write)(u32 val, void __iomem *addr); > + u32 (*read)(void __iomem *addr); I think I already commented on this aspect, and I keep thinking having a function pointer is overkill here. Just declare 2 functions and do the f->devtype_data->little_endian check in there: static u32 fspi_readl(struct nxp_fspi *f, void __iomem *addr) { if (f->devtype_data->little_endian) return ioread32(addr); return ioread32be(addr); } static void fspi_writel(struct nxp_fspi *f, u32 val, void __iomem *addr) { if (f->devtype_data->little_endian) iowrite32(val, addr); iowrite32be(val, addr); }