Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp977828pxj; Fri, 4 Jun 2021 03:05:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz70ZqwDAmAy+wVlv4TY15ApDBdjhed54wX9BPYey8X6idzeVSURFPTsmRilm1mH9oYQf3H X-Received: by 2002:a05:6402:1a4b:: with SMTP id bf11mr3832523edb.286.1622801150653; Fri, 04 Jun 2021 03:05:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622801150; cv=none; d=google.com; s=arc-20160816; b=hHDNmHcjCRKcUepcu+2qHXPNT2s7/qmIZQXO66TFvFEL5Fqq3nYZzMaOWSnyfVIh00 pG00ndVV3BNazzq43F0yuF9KzkBgD3wjB1HKomC+8rqaTqZZUWR9oMDCHrh6/Ghnmn+S tcDxH6qUBHH23pX4tvZRj+XFSJJBUvUzU/t5nrC9JSvxUyAbsY6Awu/C5mGhgjtb6QFK aYmCW2Nuu637WfJmOjVZooDYvnd73vahwSe1dY2+PNP3cvL7CA4ydi8ZTppLHeXN4LCl Slw7LM1yOkvRnjgGYnDt7TTlm6736PBWOxutmjy2O2daNOIb+oC35YhX4P5CY3l5tKp1 Ey4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=YkS4sNM+ctsrAic8C8mVED//V6I0yEE4C5cW8CX1yvk=; b=PpmZnIIvpK0dNg6q+8DASxsrbEdUb3QmxNH660V+yJw9wEu2s7x593rQWEsw9HhxK8 3WZwU3X5AjRtAcWNcQ0q0RO9Z2gBv/iEI1+RR8/bNRdVA0ek4j32V6y5JZZZgt15gyG/ XdHLeeToTcOpYoRCLOeavdlYuXQoktGcNug7zu7mUZGFpWuE5EGpnKdO4Hdv4g/KI1Po 4g23x1xjG0cwODoQLPVo1Y5dIt1bo5lgK+jwn3eN7lpUfbx32X+Y3tofZCBcHUBXgaSO JSCaJmR/okHdiCulU7ztFlKzKuU2jLtOjje7qaqUEkIVNE3WXlcOPA8hBwT7sh7eO2Mu bHkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=TjerMxkz; 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 z7si4760492edc.522.2021.06.04.03.05.26; Fri, 04 Jun 2021 03:05:50 -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=@walle.cc header.s=mail2016061301 header.b=TjerMxkz; 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 S229975AbhFDKE7 (ORCPT + 99 others); Fri, 4 Jun 2021 06:04:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230321AbhFDKEw (ORCPT ); Fri, 4 Jun 2021 06:04:52 -0400 Received: from ssl.serverraum.org (ssl.serverraum.org [IPv6:2a01:4f8:151:8464::1:2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77BBDC06174A for ; Fri, 4 Jun 2021 03:03:06 -0700 (PDT) Received: from mwalle01.fritz.box (ip4d17858c.dynamic.kabel-deutschland.de [77.23.133.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id C94032224B; Fri, 4 Jun 2021 12:03:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1622800983; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YkS4sNM+ctsrAic8C8mVED//V6I0yEE4C5cW8CX1yvk=; b=TjerMxkzcjlY+5tlkl190n/f1EsxkfgFeN8joPJ1kKnXlxaN3/WblyOruNxUkJKC4P9tRW jc9yH/nv3EQmUl6x+N3ubxDTtNDTDcPclQQ0ZfZ15q+UDZ/Gc6tfKKcDpKGtpuvyNytEsQ 2KGTK1Zi8jmIXJsEUJmOLDH37H6goJQ= From: Michael Walle To: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Tudor Ambarus , Michael Walle , Pratyush Yadav , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra Subject: [PATCH v5 1/5] mtd: spi-nor: otp: fix access to security registers in 4 byte mode Date: Fri, 4 Jun 2021 12:02:48 +0200 Message-Id: <20210604100252.9975-2-michael@walle.cc> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210604100252.9975-1-michael@walle.cc> References: <20210604100252.9975-1-michael@walle.cc> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The security registers either take a 3 byte or a 4 byte address offset, depending on the address mode of the flash. Thus just leave the nor->addr_width as is. Fixes: cad3193fe9d1 ("mtd: spi-nor: implement OTP support for Winbond and similar flashes") Signed-off-by: Michael Walle Acked-by: Pratyush Yadav Reviewed-by: Tudor Ambarus --- drivers/mtd/spi-nor/otp.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/mtd/spi-nor/otp.c b/drivers/mtd/spi-nor/otp.c index 61036c716abb..91a4c510ed51 100644 --- a/drivers/mtd/spi-nor/otp.c +++ b/drivers/mtd/spi-nor/otp.c @@ -40,7 +40,6 @@ int spi_nor_otp_read_secr(struct spi_nor *nor, loff_t addr, size_t len, u8 *buf) rdesc = nor->dirmap.rdesc; nor->read_opcode = SPINOR_OP_RSECR; - nor->addr_width = 3; nor->read_dummy = 8; nor->read_proto = SNOR_PROTO_1_1_1; nor->dirmap.rdesc = NULL; @@ -84,7 +83,6 @@ int spi_nor_otp_write_secr(struct spi_nor *nor, loff_t addr, size_t len, wdesc = nor->dirmap.wdesc; nor->program_opcode = SPINOR_OP_PSECR; - nor->addr_width = 3; nor->write_proto = SNOR_PROTO_1_1_1; nor->dirmap.wdesc = NULL; -- 2.20.1