Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6882365ybi; Wed, 31 Jul 2019 23:39:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqw1sj2Vn/Ld1R9+izFWPAGt9z2Qc5YMRZu5mxRjYp1Qhqb8wX3C2H1cLi96YB+PuEwZ/ecH X-Received: by 2002:a17:902:b696:: with SMTP id c22mr27878334pls.305.1564641541402; Wed, 31 Jul 2019 23:39:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564641541; cv=none; d=google.com; s=arc-20160816; b=xht5R70oGc5oxr5cjgJBfKvEAENTD0S3p+VKjKEplA0roU/0TSw5TRl2BOeqSQqIYa y5IwvwdHeZE8TQq4IkyDd3cJAvPj66u3uoSFQrShjpBvCE5VG0dx2Pe1XvpsWb1DWz9B UptsyOn9lR8hYuFOmcLVU9X6PaB2+S0wbzoO3qpIy5v5IdwG5Y/DBqba3gluXICA8mQg uAH6xvzGW8C2Ewo/ZKt/n+toQYAw4kc7nhjYatcEY3rJZ+PY/hVMjYxowr/ZVK2A+fjp T55ZL/HpYfN1laonZ8nB3WfQpCyu5zkrZKpCI93dqrpB/dr/xgO/7LhX2ajEdb/YwD4Y n4Yg== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=3ioP3RR6qiFfMIAeUzo/FEIF+wa88tm8q7b0/RSDzN4=; b=MkUS4S7ydZoZAWnptTYyAelDOH3PhtnWOrcdlU6j64zpOLDK2nACsRhh2/CLASseff yssdkEPMM67+BTMnwKoTA6wp7OrS3x7k47VySOeswVMR8zGJs97kLkX4xPveHbjfPkH9 hBaY84BS/MOspy1PEQFQL1TSpND552KOrncrbwVh5FsBFu32232D16K0PqCX/9FD12PL iFDlKTyU6MbkLQ9X/mdqsiPGd9r2dW6wbukoHt4WqpINCNOK0p5Sn0XgS/haUnx5LJt9 BVXFXMga04gzrXbzD5lWyv0Uef8pbrlkQ0WGiSd+kI1PmVeN7Q5XI97QrOc2vekbMyAZ ngUQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f89si3340320pje.50.2019.07.31.23.38.46; Wed, 31 Jul 2019 23:39:01 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729902AbfHAGg6 (ORCPT + 99 others); Thu, 1 Aug 2019 02:36:58 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:34050 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725804AbfHAGg5 (ORCPT ); Thu, 1 Aug 2019 02:36:57 -0400 Received: from localhost (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: bbrezillon) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id C699C28A446; Thu, 1 Aug 2019 07:36:55 +0100 (BST) Date: Thu, 1 Aug 2019 08:36:52 +0200 From: Boris Brezillon To: Cc: , , , , , , , Subject: Re: [PATCH 4/6] mtd: spi_nor: Add nor->setup() method Message-ID: <20190801083652.52bffef5@collabora.com> In-Reply-To: <20190731091145.27374-5-tudor.ambarus@microchip.com> References: <20190731091145.27374-1-tudor.ambarus@microchip.com> <20190731091145.27374-5-tudor.ambarus@microchip.com> Organization: Collabora X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-redhat-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 Wed, 31 Jul 2019 09:12:14 +0000 wrote: > static inline bool spi_nor_protocol_is_dtr(enum spi_nor_protocol proto) > { > return !!(proto & SNOR_PROTO_IS_DTR); > @@ -384,6 +522,7 @@ struct flash_info; > * useful when pagesize is not a power-of-2 > * @disable_write_protection: [FLASH-SPECIFIC] disable write protection during > * power-up > + * @setup: [FLASH-SPECIFIC] configure the spi-nor memory Might be worth giving a example of the type of configuration that can be done here. The patch looks good otherwise. Reviewed-by: Boris Brezillon > * completely locked Looks like this 'completely locked' is a leftover from a previous move (lock functions were move to a separate _ops struct IIRC). Can you fix that? > * @priv: the private data > */ > @@ -427,6 +566,9 @@ struct spi_nor { > int (*set_4byte)(struct spi_nor *nor, bool enable); > u32 (*convert_addr)(struct spi_nor *nor, u32 addr); > int (*disable_write_protection)(struct spi_nor *nor); > + int (*setup)(struct spi_nor *nor, > + const struct spi_nor_flash_parameter *params, > + const struct spi_nor_hwcaps *hwcaps); > > const struct spi_nor_locking_ops *locking_ops; > > @@ -486,81 +628,6 @@ static inline struct device_node *spi_nor_get_flash_node(struct spi_nor *nor) > } >