From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 52CFB3E8688 for ; Fri, 3 Jul 2026 14:30:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783089029; cv=none; b=V7TAGnQnrw0Y8bc76eJ+bdDb2ERYp8uvZ8ekaqBWGyE/sE+4x3b2W3fOHf4jbPMRR3XZR2yZGItE16/wRVWgUVN3BoLKZbLEK22I0TYy+igmIKMApW6ITNMd6ajsYrQLPDDVNpd5C2/cWh5dWHx7J98zBhF+jMjVa2fM+Mxrj+A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783089029; c=relaxed/simple; bh=q1IPA/smJdSFQ83eVN5QVIzPPC7nUiopCl5yUn6Se9c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=E4NBl7uHV9q0Pg2h/ibPT5gy9P5eeV/Gubnl+W3z6+DEfLotYHFY3lidNH4d8FX0JxhBL4ECd0XRWioDnEzs6LmYQa0oYA56AQ8fZ6d0aQjARXY+AKYS/zXJWolrqznW2lgHXekfkakx0MdesDf7UKYM6h1Bn7qZ2a8jaXEpnAg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HhEK+Ds/; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HhEK+Ds/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C11B01F000E9; Fri, 3 Jul 2026 14:30:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1783089027; bh=2tBIpzrA2mgPVackQiqt2YipbpdW03n68DVd0kQkAho=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=HhEK+Ds/B7KF49mTU59VK6Q/LG2AXRFARX1bbgsREHHRjE9rjbrNNYzx2aXDuXw4o weUZbdT4oukmaWdATunIOGYCZak7l5621NtbOQEDQJJsgH8qjBr1i6XeTj8a6ra0Bh u4B5uijo+kDkq2wA8QSfCFPvDtuyZeIXBYoXxpNrh3WckRiF2G29zgzwm2U5yCJBWc FdVJm4y231EjsVFk7rhMOvMLuGI5c8H48+jxpgIu6Y4sRuX4B0FkoQFxJpSKPZWfqd Fcp5G36ERgColU480gS+x8VdU3V4PdqDklzBt/HRIjdGfqc3mBNyFlryWjw8ovwWDp SfTG7wEefHqVQ== From: Michael Walle To: Pratyush Yadav , Michael Walle , Takahiro Kuwano , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Tudor Ambarus Cc: linux-mtd@lists.infradead.org, Cheng Ming Lin , linux-kernel@vger.kernel.org Subject: [PATCH v1 2/8] mtd: spi-nor: don't clear the SNOR_F_4B_OPCODES flag on failure Date: Fri, 3 Jul 2026 16:29:13 +0200 Message-ID: <20260703143003.1809579-3-mwalle@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260703143003.1809579-1-mwalle@kernel.org> References: <20260703143003.1809579-1-mwalle@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This was introduced in commit 548ed6847f530 ("mtd: spi-nor: Add the SNOR_F_4B_OPCODES flag"). It looks like it was the rollback mechanism if parsing the SFDP failed, but was setting that flag first. Nowadays, that flag can only be set if spi_nor_parse_4bait() was successful. IOW, the flags won't be left in an undefined state if parsing SFDP fails. Remove the unneeded code to be able to rework spi_nor_init_params(). Signed-off-by: Michael Walle Reviewed-by: Miquel Raynal Reviewed-by: Tudor Ambarus --- drivers/mtd/spi-nor/core.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c index 4046e137531f..fbf8c2d9c6b5 100644 --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c @@ -3066,10 +3066,8 @@ static void spi_nor_sfdp_init_params_deprecated(struct spi_nor *nor) memcpy(&sfdp_params, nor->params, sizeof(sfdp_params)); - if (spi_nor_parse_sfdp(nor)) { + if (spi_nor_parse_sfdp(nor)) memcpy(nor->params, &sfdp_params, sizeof(*nor->params)); - nor->flags &= ~SNOR_F_4B_OPCODES; - } } /** -- 2.47.3