kernel: update spi-nor in 4.9 to spi-nor tree version (next branch)
[openwrt/openwrt.git] / target / linux / generic / patches-4.9 / 062-v4.11-0002-mtd-spi-nor-improve-macronix_quad_enable.patch
1 From 1e99d0d51ec97bf48edd277658004ce030543d98 Mon Sep 17 00:00:00 2001
2 From: Cyrille Pitchen <cyrille.pitchen@atmel.com>
3 Date: Tue, 6 Dec 2016 17:01:41 +0100
4 Subject: [PATCH] mtd: spi-nor: improve macronix_quad_enable()
5
6 The patch checks whether the Quad Enable bit is already set in the Status
7 Register. If so, the function exits immediately with a successful return
8 code.
9
10 Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
11 Reviewed-by: Jagan Teki <jagan@openedev.com>
12 Acked-by: Marek Vasut <marek.vasut@gmail.com>
13 ---
14 drivers/mtd/spi-nor/spi-nor.c | 3 +++
15 1 file changed, 3 insertions(+)
16
17 --- a/drivers/mtd/spi-nor/spi-nor.c
18 +++ b/drivers/mtd/spi-nor/spi-nor.c
19 @@ -1305,6 +1305,9 @@ static int macronix_quad_enable(struct s
20 val = read_sr(nor);
21 if (val < 0)
22 return val;
23 + if (val & SR_QUAD_EN_MX)
24 + return 0;
25 +
26 write_enable(nor);
27
28 write_sr(nor, val | SR_QUAD_EN_MX);