From: Marek Vasut <marek.vasut@gmail.com>
To: Cyrille Pitchen <cyrille.pitchen@atmel.com>
Cc: computersforpeace@gmail.com, boris.brezillon@free-electrons.com,
richard@nod.at, linux-mtd@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] mtd: spi-nor: improve macronix_quad_enable()
Date: Tue, 6 Dec 2016 20:01:03 +0100 [thread overview]
Message-ID: <5962912d-b5de-f0d0-077b-af3b9ff2a77c@gmail.com> (raw)
In-Reply-To: <5b7ad2367d9b6a4e3a766ce6cadf16c313a03a26.1481039788.git.cyrille.pitchen@atmel.com>
On 12/06/2016 05:01 PM, Cyrille Pitchen wrote:
> 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.
Performance optimization I presume ?
Acked-by: Marek Vasut <marek.vasut@gmail.com>
> Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
> Reviewed-by: Jagan Teki <jagan@openedev.com>
> ---
> drivers/mtd/spi-nor/spi-nor.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c
> index da7cd69d4857..1fd32b991eb7 100644
> --- a/drivers/mtd/spi-nor/spi-nor.c
> +++ b/drivers/mtd/spi-nor/spi-nor.c
> @@ -1216,6 +1216,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);
>
--
Best regards,
Marek Vasut
next prev parent reply other threads:[~2016-12-06 19:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-06 16:01 [PATCH 1/1] mtd: spi-nor: improve macronix_quad_enable() Cyrille Pitchen
2016-12-06 19:01 ` Marek Vasut [this message]
2016-12-06 23:05 ` Cyrille Pitchen
2016-12-06 23:46 ` Marek Vasut
2016-12-13 16:35 ` Cyrille Pitchen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5962912d-b5de-f0d0-077b-af3b9ff2a77c@gmail.com \
--to=marek.vasut@gmail.com \
--cc=boris.brezillon@free-electrons.com \
--cc=computersforpeace@gmail.com \
--cc=cyrille.pitchen@atmel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=richard@nod.at \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).