From: Dan Carpenter <dan.carpenter@oracle.com>
To: Liang Yang <liang.yang@amlogic.com>
Cc: Boris Brezillon <bbrezillon@kernel.org>,
Richard Weinberger <richard@nod.at>,
kernel-janitors@vger.kernel.org,
Marek Vasut <marek.vasut@gmail.com>,
linux-mtd@lists.infradead.org,
Kevin Hilman <khilman@baylibre.com>,
Miquel Raynal <miquel.raynal@bootlin.com>,
linux-amlogic@lists.infradead.org,
Brian Norris <computersforpeace@gmail.com>,
David Woodhouse <dwmw2@infradead.org>
Subject: [PATCH 3/3] mtd: rawnand: meson: remove unnecessary condition in meson_nfc_select_chip()
Date: Fri, 01 Feb 2019 08:30:54 +0000 [thread overview]
Message-ID: <20190201083053.GE8459@kadam> (raw)
If chip is negative then we return at the very start of the function.
Removing the check lets us pull everything in one indent level.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/mtd/nand/raw/meson_nand.c | 28 ++++++++++++----------------
1 file changed, 12 insertions(+), 16 deletions(-)
diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c
index 0d93d0b9c1af..105d12103ca6 100644
--- a/drivers/mtd/nand/raw/meson_nand.c
+++ b/drivers/mtd/nand/raw/meson_nand.c
@@ -234,23 +234,19 @@ static void meson_nfc_select_chip(struct nand_chip *nand, int chip)
nfc->timing.tadl = meson_chip->tadl;
nfc->timing.tbers_max = meson_chip->tbers_max;
- if (chip >= 0) {
- if (nfc->clk_rate != meson_chip->clk_rate) {
- ret = clk_set_rate(nfc->device_clk,
- meson_chip->clk_rate);
- if (ret) {
- dev_err(nfc->dev, "failed to set clock rate\n");
- return;
- }
- nfc->clk_rate = meson_chip->clk_rate;
- }
- if (nfc->bus_timing != meson_chip->bus_timing) {
- value = (NFC_CLK_CYCLE - 1)
- | (meson_chip->bus_timing << 5);
- writel(value, nfc->reg_base + NFC_REG_CFG);
- writel((1 << 31), nfc->reg_base + NFC_REG_CMD);
- nfc->bus_timing = meson_chip->bus_timing;
+ if (nfc->clk_rate != meson_chip->clk_rate) {
+ ret = clk_set_rate(nfc->device_clk, meson_chip->clk_rate);
+ if (ret) {
+ dev_err(nfc->dev, "failed to set clock rate\n");
+ return;
}
+ nfc->clk_rate = meson_chip->clk_rate;
+ }
+ if (nfc->bus_timing != meson_chip->bus_timing) {
+ value = (NFC_CLK_CYCLE - 1) | (meson_chip->bus_timing << 5);
+ writel(value, nfc->reg_base + NFC_REG_CFG);
+ writel((1 << 31), nfc->reg_base + NFC_REG_CMD);
+ nfc->bus_timing = meson_chip->bus_timing;
}
}
--
2.17.1
next reply other threads:[~2019-02-01 8:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-01 8:30 Dan Carpenter [this message]
2019-02-02 3:01 ` [PATCH 3/3] mtd: rawnand: meson: remove unnecessary condition in meson_nfc_select_chip() Liang Yang
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=20190201083053.GE8459@kadam \
--to=dan.carpenter@oracle.com \
--cc=bbrezillon@kernel.org \
--cc=computersforpeace@gmail.com \
--cc=dwmw2@infradead.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=khilman@baylibre.com \
--cc=liang.yang@amlogic.com \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-mtd@lists.infradead.org \
--cc=marek.vasut@gmail.com \
--cc=miquel.raynal@bootlin.com \
--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