diff options
author | Cyrille Pitchen <cyrille.pitchen@atmel.com> | 2016-12-06 17:01:41 +0100 |
---|---|---|
committer | Cyrille Pitchen <cyrille.pitchen@atmel.com> | 2017-02-10 13:54:52 +0100 |
commit | 32c90f1682a01ff9e1c2fa83c18a15e35f7563ce (patch) | |
tree | b1455a51c470b16f8fa97b8ccfaa8acf61c7a015 /drivers/mtd | |
parent | e99ca98f1d7190c16601b00d0c96212d7c00577d (diff) | |
download | op-kernel-dev-32c90f1682a01ff9e1c2fa83c18a15e35f7563ce.zip op-kernel-dev-32c90f1682a01ff9e1c2fa83c18a15e35f7563ce.tar.gz |
mtd: spi-nor: improve macronix_quad_enable()
The patch checks whether the Quad Enable bit is already set in the Status
Register. If so, the function exits immediately with a successful return
code.
Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
Acked-by: Marek Vasut <marek.vasut@gmail.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/spi-nor/spi-nor.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c index be1d41d..4e35917 100644 --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c @@ -1305,6 +1305,9 @@ static int macronix_quad_enable(struct spi_nor *nor) val = read_sr(nor); if (val < 0) return val; + if (val & SR_QUAD_EN_MX) + return 0; + write_enable(nor); write_sr(nor, val | SR_QUAD_EN_MX); |