From patchwork Wed Oct 3 14:40:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boris Brezillon X-Patchwork-Id: 978410 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ets3m4/f"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="Lg/IKq0X"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42QKtP5l9Fz9s7W for ; Thu, 4 Oct 2018 01:38:37 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=2/55ydXgVMBGPGXHrICEjU086mTaLP2Wy/nkTdFxxUU=; b=ets3m4/f/B21bfCPO/YUTJKGBR ySOurxA5YwAwxS9i6ugHvxkjqp0fviJIXN7Zuj+ixhlj+5RaGl7v5UOFaoS9Ixh1RLSMNsJCys5rR YcVpcNXss6tT+B5F9FY5dX18Kj3T2Irc1lM63t9sUxK/fG3Nt/8oCsa7bqbG3c4xlGK+7wKZndO6y ZyIjCswW9F3ZRqrQB26NIbOuXkG5xLXSf3pbTJdJYrPfENseYL2zOD8v96HhyhpT7Cv4fRMJda2EX UplmC66hwtNo/AKlP2hD8ETsPaCvmjABbZU9/HQ5cySQKGiGQgESV8gBbuRQyTBtLUOuITusIi0LH BFpn8xfQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g7jEG-0001XS-Ph; Wed, 03 Oct 2018 15:38:24 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g7j2e-0004qU-Us for linux-mtd@bombadil.infradead.org; Wed, 03 Oct 2018 15:26:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Lp4hNJULhkGdRgkcTOVRe9xrRpmQUx/E+mUM6NVC6fU=; b=Lg/IKq0XPejyaEjc1Ch99Eaua UAtmELaYIbp9t0NpxBhnhpc1DIf5++YHH5LbVefDoWLvi4csxtnOPVQb8YFaL89bFRFk1WwbRFkQq aIko9teJ/mW1Ck2Dfi6Uunnp+uEjdtqKCpg5biTm2OpBnGPGpzIKdggvrv1KBc9xozqR4tHH3HIVE lKF1EY4biKKslORNekvKMrtW6qzK/Z1TX3AI5sJUvCFcrtMf7vH2QduaFHBbh2tJuWc0OfqoW3zok GR4YYIHHU3sBofMcQO2yQJWj6HIsIs82usW/cLD1h4CUOADrY24BPCtg7/XTKeGw+wtC24BvbAZdp xq8RDOmPQ==; Received: from mail.bootlin.com ([62.4.15.54]) by merlin.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g7iKi-0002SL-Hm for linux-mtd@lists.infradead.org; Wed, 03 Oct 2018 14:41:01 +0000 Received: by mail.bootlin.com (Postfix, from userid 110) id 14928207F3; Wed, 3 Oct 2018 16:40:45 +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.fritz.box (AAubervilliers-681-1-24-95.w90-88.abo.wanadoo.fr [90.88.144.95]) by mail.bootlin.com (Postfix) with ESMTPSA id BF7DB20733; Wed, 3 Oct 2018 16:40:44 +0200 (CEST) From: Boris Brezillon To: David Woodhouse , Brian Norris , Boris Brezillon , Marek Vasut , Richard Weinberger , linux-mtd@lists.infradead.org Subject: [PATCH 4/8] mtd: spi-nor: Stop passing info to set_4byte() Date: Wed, 3 Oct 2018 16:40:39 +0200 Message-Id: <20181003144043.21529-5-boris.brezillon@bootlin.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20181003144043.21529-1-boris.brezillon@bootlin.com> References: <20181003144043.21529-1-boris.brezillon@bootlin.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181003_104100_730693_F17A5A1E X-CRM114-Status: GOOD ( 13.07 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.1 on merlin.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [62.4.15.54 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Julien Su , Cyrille Pitchen , Mason Yang , Tudor Ambarus , zhengxunli@mxic.com.tw MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org info can be extracted from nor->info, no need to pass it as an argument. Signed-off-by: Boris Brezillon --- drivers/mtd/spi-nor/spi-nor.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c index c321d39aa812..c68e8ccfb357 100644 --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c @@ -274,14 +274,13 @@ static void spi_nor_set_4byte_opcodes(struct spi_nor *nor, } /* Enable/disable 4-byte addressing mode. */ -static int set_4byte(struct spi_nor *nor, const struct flash_info *info, - int enable) +static int set_4byte(struct spi_nor *nor, int enable) { int status; bool need_wren = false; u8 cmd; - switch (JEDEC_MFR(info)) { + switch (JEDEC_MFR(nor->info)) { case SNOR_MFR_MICRON: /* Some Micron need WREN command; all will accept it */ need_wren = true; @@ -296,7 +295,7 @@ static int set_4byte(struct spi_nor *nor, const struct flash_info *info, write_disable(nor); if (!status && !enable && - JEDEC_MFR(info) == SNOR_MFR_WINBOND) { + JEDEC_MFR(nor->info) == SNOR_MFR_WINBOND) { /* * On Winbond W25Q256FV, leaving 4byte mode causes * the Extended Address Register to be set to 1, so all @@ -3555,7 +3554,7 @@ static int spi_nor_init(struct spi_nor *nor) */ WARN_ONCE(nor->flags & SNOR_F_BROKEN_RESET, "enabling reset hack; may not recover from unexpected reboots\n"); - set_4byte(nor, nor->info, 1); + set_4byte(nor, 1); } return 0; @@ -3580,7 +3579,7 @@ void spi_nor_restore(struct spi_nor *nor) if ((nor->addr_width == 4) && !(nor->info->flags & SPI_NOR_4B_OPCODES) && (nor->flags & SNOR_F_BROKEN_RESET)) - set_4byte(nor, nor->info, 0); + set_4byte(nor, 0); } EXPORT_SYMBOL_GPL(spi_nor_restore);