Skip to content

Commit 6825e5a

Browse files
committed
Merge tag 'fixes-for-5.3-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux
Pull MTD fix from Richard Weinberger: "A single fix for MTD to correctly set the spi-nor WP pin" * tag 'fixes-for-5.3-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux: mtd: spi-nor: Fix the disabling of write protection at init
2 parents 3039fad + 834de5c commit 6825e5a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/mtd/spi-nor/spi-nor.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3780,8 +3780,6 @@ static int spi_nor_init_params(struct spi_nor *nor,
37803780
default:
37813781
/* Kept only for backward compatibility purpose. */
37823782
params->quad_enable = spansion_quad_enable;
3783-
if (nor->clear_sr_bp)
3784-
nor->clear_sr_bp = spi_nor_spansion_clear_sr_bp;
37853783
break;
37863784
}
37873785

@@ -4035,6 +4033,9 @@ static int spi_nor_init(struct spi_nor *nor)
40354033
int err;
40364034

40374035
if (nor->clear_sr_bp) {
4036+
if (nor->quad_enable == spansion_quad_enable)
4037+
nor->clear_sr_bp = spi_nor_spansion_clear_sr_bp;
4038+
40384039
err = nor->clear_sr_bp(nor);
40394040
if (err) {
40404041
dev_err(nor->dev,

0 commit comments

Comments
 (0)