Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp1680925ima; Sat, 2 Feb 2019 05:33:00 -0800 (PST) X-Google-Smtp-Source: ALg8bN4YD6Typ4rwSMjHmfF3szj8r1SOHuqxPAy1jh4ESmgvT5PhGLw+UDkoSwRDRB2hRpkS6qZh X-Received: by 2002:a17:902:7588:: with SMTP id j8mr44555790pll.215.1549114380157; Sat, 02 Feb 2019 05:33:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549114380; cv=none; d=google.com; s=arc-20160816; b=lu+MEr0aB9Rv83kmXocYC2VREycGHCu3spV2dV84nayzwZ/g998M1oyccV++w1wiEm Lb312w2n8bxmbQtTdMGR14Rd7CMtVTFlIAweefz7FxJSPxWuxaB5gEypqBleLZQOME/P X0qLBO89d7Gs8N9XAkqEPCNDq5Q3zEpGUFTLPkspTrxYCQ5x4bkJez0ueE6iOHQbymFN Y2i9B09Zdl1iIVrB+HTSaj7ZUArx0R9zLr1lRd6CTVOikKdQa50BXp4tH6ZI7yzWJBBo lsOkxJat8JJACNJs5F74kUzOdoAw8yXROUv6/ZkqJGsOoMStXGngvSTzIlbSSwPLxC1P /zmA== 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 :dkim-signature; bh=LJw97lXteKlRRw1J4lowB249KYht1LSgwmr53Nm1xms=; b=ysb0KQTmXpntg6TVgusNS87Q9h+ReoD99z8H1RvS7byZxuLxOZkZXOOGDbWGHjbgJj vpVxgAMCYlFh3LGL7d6Xo12NwCb2pwhi5KM1+E2AdzL3lQ+4JlLKZYKEjAuUZS+Y/dKR a/zKvE0EZcYarA8RefL5N11IuZKUolOEQgpBUkT9nhHfmQffT4vWRKWne6Qzo1MJciDb BhCVv81pdI+Yfo2UE6qjj/rT98x+D9HKIfkxdlyUxVBBckW4mjAhtiPPao6vvJt24xMv kiscK/a3b8kEIQIPRjIZhVhVrznY3pofHuwqumpVp4UzKCC7Vh4LthX98acApno00oFt 7hjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GhmfSMSF; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w1si1973910pgi.66.2019.02.02.05.32.44; Sat, 02 Feb 2019 05:33:00 -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; dkim=pass header.i=@kernel.org header.s=default header.b=GhmfSMSF; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728215AbfBBNbG (ORCPT + 99 others); Sat, 2 Feb 2019 08:31:06 -0500 Received: from mail.kernel.org ([198.145.29.99]:42282 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727961AbfBBNbG (ORCPT ); Sat, 2 Feb 2019 08:31:06 -0500 Received: from bbrezillon (91-160-177-164.subs.proxad.net [91.160.177.164]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7188320869; Sat, 2 Feb 2019 13:31:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549114265; bh=1gY2hOeLHhSzQ5G894my2ziGlBHN6TYeMJr5fQWQMg4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=GhmfSMSFU83ARO6wJmCvItpVnqdbGiZmxSzmVotq2qAG87o2Z8m/J5f2yvi8+C3Kz tqr6dkqHJ9JQd1Njq5XTNPBnAbGyQp2B4TWC0TSiB3vaNNpLaSj6oaol4i31hMcNuZ Ycar7kFJCA6WwkirF5nNUcEc7Mnzf0Iuxd7CC83U= Date: Sat, 2 Feb 2019 14:30:54 +0100 From: Boris Brezillon To: Cc: , , , , , , , , , , , , Subject: Re: [PATCH v3 13/13] spi: atmel-quadspi: add support for sam9x60 qspi controller Message-ID: <20190202143054.4db7c465@bbrezillon> In-Reply-To: <57d4d4b2-e765-1255-0b89-a4fd61f6c1e0@microchip.com> References: <20190202040653.1217-1-tudor.ambarus@microchip.com> <20190202040653.1217-14-tudor.ambarus@microchip.com> <20190202082910.0e60a757@bbrezillon> <57d4d4b2-e765-1255-0b89-a4fd61f6c1e0@microchip.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 Sat, 2 Feb 2019 08:58:25 +0000 wrote: > >> @@ -117,6 +120,7 @@ > >> #define QSPI_IFR_CRM BIT(14) > >> #define QSPI_IFR_NBDUM_MASK GENMASK(20, 16) > >> #define QSPI_IFR_NBDUM(n) (((n) << 16) & QSPI_IFR_NBDUM_MASK) > >> +#define QSPI_IFR_APBTFRTYP_READ BIT(24) > > > > Maybe add a comment saying it's only available on SAM9X60 or prefix it > > with SAM9X60. > > I'll add a comment. The macro name is more generic how it is now and can be used > by future versions of the IP. Hypothetically speaking, if we rename it to > QSPI_IFR_SAM9x60_TFSFR_READ and other sam9x will come out, then I'll have to > rename this macro again, to make it more generic. Okay. > >> +static int atmel_qspi_set_cfg(struct atmel_qspi *aq, > >> + const struct spi_mem_op *op, > >> + struct atmel_qspi_cfg *cfg) > >> +{ > >> + void __iomem *base = aq->regs; > >> + int ret; > >> + > >> + /* Set the QSPI controller in Serial Memory Mode */ > >> + if (aq->smm != QSPI_MR_SMM) { > >> + writel_relaxed(QSPI_MR_SMM, base + QSPI_MR); > > > > aq->reqs + > > > > and you can get rid of base. > > I will wait your reasons on this, see 3/13 ad->regs is only dereferenced once in this function, so there's even less reasons to add a local var.