Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp3555714ybk; Tue, 19 May 2020 07:31:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJCzEnWesl/4En0L3XRDWIyoMURBXJvUhcJCpsBYk3WUpjdlZ198+jCSSIdT95QqQwHWmx X-Received: by 2002:a50:e08c:: with SMTP id f12mr6454687edl.233.1589898685962; Tue, 19 May 2020 07:31:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589898685; cv=none; d=google.com; s=arc-20160816; b=w3nRxWfsXKX6XysOSNxvpBI2hG0BWkQtSwfuUrGJZvoWxYwt1VfohaP3Dt5hm7gLrr Q7QhSnGAU7CuqybzEvGIqw2VTLOEne4xsXswCDsbJpRiABnkgNkkEjwkXLNu1lZ84WY/ 1CJzpHz1L94shA/El8p2U+1SN1vDWuHuRUqEDJEtE/ZC7yJytcxyWbmuhO/KMIGek+3c hEWfBuOx6h40SfBsh6jKqUv1/YGVSRr/XUgst7awIAGQq/7BZT0LhWdqOPwUWzVCLPCo 4DUE/kCs8hAkmfssEsrmQzpdUMZBxtr2E7sRIK/gHiEOIMl3j145m8d8fdU5ZLkIJfCE qZ/w== 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 :dkim-signature; bh=GBF2MWapCKmZFTAre7roOt4HKKaEU6l6dFGpC8mxpeo=; b=ole1ElencvtfxJDspkKvs36JhMc63mgF4NL0lVdJGuJZ4xDJwefM2sgmz6xuZqoBz9 DcFJobruTSiF0kwUHaC8ocjczFPZiWmJJZd7O1yzrx6KcWfYbMliQaii1Nys24Cb2wLb NX8fI5fsPiYUtkgFlC57tAVy6BORySYD6GMuN691E8Gjz/G+jDKNZo5FZSFpjsJjE0uS T7qrJ7wd0n6+g0HJkkqWjQn/q8HL+XDFO2qOHQdkoLPNn5nsR3y6dO8WO4TjmqImFcRW tR4ILUAEPxy7Ghtero24u7iCNloroN9RHD9WJ3neNOg+mSyoWl5sDWELIb7yAly0XII9 +Nnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=IP7Kgoj4; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l18si8243152ejb.405.2020.05.19.07.31.02; Tue, 19 May 2020 07:31:25 -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; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=IP7Kgoj4; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729307AbgESO22 (ORCPT + 99 others); Tue, 19 May 2020 10:28:28 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:59240 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729057AbgESO21 (ORCPT ); Tue, 19 May 2020 10:28:27 -0400 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 04JESDYb075544; Tue, 19 May 2020 09:28:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1589898493; bh=GBF2MWapCKmZFTAre7roOt4HKKaEU6l6dFGpC8mxpeo=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=IP7Kgoj47QSdSBs5qKbe+yhOsEq82Hi0aOJA+IN68QqA4xzZ71au8jAntXEoOP7Jc s34/7fuGVtVAcvaKaJGeu6jjG8i8pN3WzI1Y18dyNd09br4rVITXp69sOaEC02bo8M vFq7InLp0fk4uxZH4FawkU+F8HztoiZ5Ao5i1M0Q= Received: from DFLE115.ent.ti.com (dfle115.ent.ti.com [10.64.6.36]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 04JESDWW071117 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 19 May 2020 09:28:13 -0500 Received: from DFLE104.ent.ti.com (10.64.6.25) by DFLE115.ent.ti.com (10.64.6.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Tue, 19 May 2020 09:28:13 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Tue, 19 May 2020 09:28:13 -0500 Received: from pratyush-OptiPlex-790.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 04JEQgjZ008313; Tue, 19 May 2020 09:28:08 -0500 From: Pratyush Yadav To: Tudor Ambarus , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Mark Brown , Nicolas Ferre , Alexandre Belloni , Ludovic Desroches , Matthias Brugger , , , , , CC: Pratyush Yadav , Sekhar Nori , Boris Brezillon , Mason Yang Subject: [PATCH v5 17/19] mtd: spi-nor: core: expose spi_nor_default_setup() in core.h Date: Tue, 19 May 2020 19:56:39 +0530 Message-ID: <20200519142642.24131-18-p.yadav@ti.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200519142642.24131-1-p.yadav@ti.com> References: <20200519142642.24131-1-p.yadav@ti.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 63ab588299f4..30d9149fd17b 100644 --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c @@ -2790,8 +2790,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 79ce952c0539..d37a9b1d111f 100644 --- a/drivers/mtd/spi-nor/core.h +++ b/drivers/mtd/spi-nor/core.h @@ -452,6 +452,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.26.2