mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 07:03:09 -04:00
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>
This commit is contained in:
parent
e99ca98f1d
commit
32c90f1682
1 changed files with 3 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue