Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1326066ybh; Thu, 23 Jul 2020 06:17:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyyIhi/iYIICUVY4Oft3iCjzpICQIOsdsNHQY+Na88mWJ1mHKHq7ySzAU3y+Ut4qTJjkQTu X-Received: by 2002:a17:906:4b59:: with SMTP id j25mr4235200ejv.301.1595510235574; Thu, 23 Jul 2020 06:17:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595510235; cv=none; d=google.com; s=arc-20160816; b=CB00HvwVcnFd9fq4A2d8Kht0bdBAN3zOmrCEz4jznEIHO0UzCGexUBKQdQqEglju7K 97IB/QrURpVJmmnOWUP1w7K15rRg62zGi6oUVEKC8Q6lG5PlhEIlLE2WqPjzW2/n18Kd 1QE8kg7i/pvNfac2Q0ktr9PG9EOhureHZSbd9hr6doLk9RIDUq371yzdTsv0BV3Zk/7D Fsl2b8mkol8CLEQIjqwTBLYM9avR3cNFfIApialZRjZzjovwfaXzw9JCMbofvsyW3Zc3 Dny/WDbE5XsuxaXosA4oyeANXNmWZbQPXcZXSfkz+kgJIvoZlmG5oDVhOSN5mI91aap8 aSMQ== 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:date:subject:cc:to:from; bh=ZzZZ9KERW9H/NDXMjCbmaECylt1rh0SWbPDW9SIxQPM=; b=zTjE0da40SiyUhjPZD6YhiblT7rggeyp2C6SWlMA0PO7EpXJtntnonIrrsn4/fOpup ku4lk7T2XlBgOKd5zIxd2NOUmoam/+ym7oj092mah2yHAT/l77YmQ0xlxfNMGdnG4L16 oo3GhYjpyXFUqbL8Vs6Cjixv3k2MvCmcTbX8162UG0pUOvL6AQ3PrUU5ntIC4IepLCOR ItfO/G3SShCIH7nt98eTe41L9Shif9aDmupxEhP95D4KHKQZg1qFpDz9iGROPEHjQkNW UH2NdrtfxqwMQShBm8/NsIEs0l9d9paw9WEGVug5QmpdGm7nkChMQpRDnMnfltuFtme7 MKwg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id re8si1979312ejb.627.2020.07.23.06.16.52; Thu, 23 Jul 2020 06:17:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729095AbgGWNNQ (ORCPT + 99 others); Thu, 23 Jul 2020 09:13:16 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:44115 "EHLO relay5-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726521AbgGWNNP (ORCPT ); Thu, 23 Jul 2020 09:13:15 -0400 X-Originating-IP: 42.109.196.68 Received: from localhost.localdomain (unknown [42.109.196.68]) (Authenticated sender: me@yadavpratyush.com) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id E9E451C0006; Thu, 23 Jul 2020 13:13:10 +0000 (UTC) From: Pratyush Yadav To: Tudor Ambarus , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Sekhar Nori , Boris Brezillon , Pratyush Yadav , Pratyush Yadav Subject: [PATCH v11 12/14] mtd: spi-nor: core: expose spi_nor_default_setup() in core.h Date: Thu, 23 Jul 2020 18:42:01 +0530 Message-Id: <20200723131203.40916-13-me@yadavpratyush.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200723131203.40916-1-me@yadavpratyush.com> References: <20200723131203.40916-1-me@yadavpratyush.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pratyush Yadav Flashes might want to add a custom setup hook to configure the flash in the proper mode for operation. But after that, they would still want to run the default setup hook because it selects the read, program, and erase operations. Since there is little point in repeating all that code, expose the spi_nor_default_setup() in core.h to manufacturer-specific files. Signed-off-by: Pratyush Yadav --- drivers/mtd/spi-nor/core.c | 4 ++-- drivers/mtd/spi-nor/core.h | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c index a263196d970f..5ebe0aed0871 100644 --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c @@ -2740,8 +2740,8 @@ static int spi_nor_select_erase(struct spi_nor *nor) return 0; } -static int spi_nor_default_setup(struct spi_nor *nor, - const struct spi_nor_hwcaps *hwcaps) +int spi_nor_default_setup(struct spi_nor *nor, + const struct spi_nor_hwcaps *hwcaps) { struct spi_nor_flash_parameter *params = nor->params; u32 ignored_mask, shared_mask; diff --git a/drivers/mtd/spi-nor/core.h b/drivers/mtd/spi-nor/core.h index ec54ce6c5403..24cff27c51aa 100644 --- a/drivers/mtd/spi-nor/core.h +++ b/drivers/mtd/spi-nor/core.h @@ -453,6 +453,9 @@ int spi_nor_post_bfpt_fixups(struct spi_nor *nor, const struct sfdp_bfpt *bfpt, struct spi_nor_flash_parameter *params); +int spi_nor_default_setup(struct spi_nor *nor, + const struct spi_nor_hwcaps *hwcaps); + static struct spi_nor __maybe_unused *mtd_to_spi_nor(struct mtd_info *mtd) { return mtd->priv; -- 2.27.0