From: <Ajay.Kathat@microchip.com>
To: <linux-wireless@vger.kernel.org>
Cc: devel@driverdev.osuosl.org, gregkh@linuxfoundation.org,
johannes@sipsolutions.net, Ajay.Kathat@microchip.com,
Adham.Abozaeid@microchip.com
Subject: [PATCH 7/8] staging: wilc1000: use short name for hif local variable in chip_wakeup()
Date: Fri, 14 Feb 2020 11:52:22 +0000 [thread overview]
Message-ID: <20200214172250.13026-8-ajay.kathat@microchip.com> (raw)
In-Reply-To: <20200214172250.13026-1-ajay.kathat@microchip.com>
From: Ajay Singh <ajay.kathat@microchip.com>
Make use of a shorter name for 'hif' variable to avoid possible 80
character checkpatch warning while the replacing hardcoded value with
macros in chip_wakeup().
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
---
drivers/staging/wilc1000/wlan.c | 35 +++++++++++++++------------------
1 file changed, 16 insertions(+), 19 deletions(-)
diff --git a/drivers/staging/wilc1000/wlan.c b/drivers/staging/wilc1000/wlan.c
index db4ef175ccee..31f424efe01d 100644
--- a/drivers/staging/wilc1000/wlan.c
+++ b/drivers/staging/wilc1000/wlan.c
@@ -403,37 +403,34 @@ EXPORT_SYMBOL_GPL(chip_allow_sleep);
void chip_wakeup(struct wilc *wilc)
{
u32 reg, clk_status_reg;
+ const struct wilc_hif_func *h = wilc->hif_func;
- if ((wilc->io_type & 0x1) == WILC_HIF_SPI) {
+ if (wilc->io_type == WILC_HIF_SPI) {
do {
- wilc->hif_func->hif_read_reg(wilc, 1, ®);
- wilc->hif_func->hif_write_reg(wilc, 1, reg | BIT(1));
- wilc->hif_func->hif_write_reg(wilc, 1, reg & ~BIT(1));
+ h->hif_read_reg(wilc, 1, ®);
+ h->hif_write_reg(wilc, 1, reg | BIT(1));
+ h->hif_write_reg(wilc, 1, reg & ~BIT(1));
do {
usleep_range(2000, 2500);
wilc_get_chipid(wilc, true);
} while (wilc_get_chipid(wilc, true) == 0);
} while (wilc_get_chipid(wilc, true) == 0);
- } else if ((wilc->io_type & 0x1) == WILC_HIF_SDIO) {
- wilc->hif_func->hif_write_reg(wilc, 0xfa, 1);
+ } else if (wilc->io_type == WILC_HIF_SDIO) {
+ h->hif_write_reg(wilc, 0xfa, 1);
usleep_range(200, 400);
- wilc->hif_func->hif_read_reg(wilc, 0xf0, ®);
+ h->hif_read_reg(wilc, 0xf0, ®);
do {
- wilc->hif_func->hif_write_reg(wilc, 0xf0,
- reg | BIT(0));
- wilc->hif_func->hif_read_reg(wilc, 0xf1,
- &clk_status_reg);
+ h->hif_write_reg(wilc, 0xf0, reg | BIT(0));
+ h->hif_read_reg(wilc, 0xf1, &clk_status_reg);
while ((clk_status_reg & 0x1) == 0) {
usleep_range(2000, 2500);
- wilc->hif_func->hif_read_reg(wilc, 0xf1,
- &clk_status_reg);
+ h->hif_read_reg(wilc, 0xf1, &clk_status_reg);
}
if ((clk_status_reg & 0x1) == 0) {
- wilc->hif_func->hif_write_reg(wilc, 0xf0,
- reg & (~BIT(0)));
+ h->hif_write_reg(wilc, 0xf0, reg & (~BIT(0)));
}
} while ((clk_status_reg & 0x1) == 0);
}
@@ -442,13 +439,13 @@ void chip_wakeup(struct wilc *wilc)
if (wilc_get_chipid(wilc, false) < 0x1002b0) {
u32 val32;
- wilc->hif_func->hif_read_reg(wilc, 0x1e1c, &val32);
+ h->hif_read_reg(wilc, 0x1e1c, &val32);
val32 |= BIT(6);
- wilc->hif_func->hif_write_reg(wilc, 0x1e1c, val32);
+ h->hif_write_reg(wilc, 0x1e1c, val32);
- wilc->hif_func->hif_read_reg(wilc, 0x1e9c, &val32);
+ h->hif_read_reg(wilc, 0x1e9c, &val32);
val32 |= BIT(6);
- wilc->hif_func->hif_write_reg(wilc, 0x1e9c, val32);
+ h->hif_write_reg(wilc, 0x1e9c, val32);
}
}
wilc->chip_ps_state = WILC_CHIP_WAKEDUP;
--
2.24.0
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
next prev parent reply other threads:[~2020-02-14 11:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-14 11:52 [PATCH 0/8] staging: wilc1000: remove magic values and handle review comments Ajay.Kathat
2020-02-14 11:52 ` [PATCH 1/8] staging: wilc1000: make use of FIELD_GET/_PREP macro Ajay.Kathat
2020-02-14 11:52 ` [PATCH 2/8] staging: wilc1000: remove use of MAX_NUN_INT_THRPT_ENH2 macro Ajay.Kathat
2020-02-14 11:52 ` [PATCH 3/8] staging: wilc1000: refactor interrupt handling for sdio Ajay.Kathat
2020-02-14 11:52 ` [PATCH 4/8] staging: wilc1000: make use of ALIGN macro Ajay.Kathat
2020-02-14 11:52 ` [PATCH 5/8] staging: wilc1000: use commmon function to set SDIO block size Ajay.Kathat
2020-02-14 11:52 ` [PATCH 6/8] staging: wilc1000: define macros for different register address for SDIO Ajay.Kathat
2020-02-14 11:52 ` Ajay.Kathat [this message]
2020-02-14 11:52 ` [PATCH 8/8] staging: wilc1000: define macros to replace magic number values Ajay.Kathat
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=20200214172250.13026-8-ajay.kathat@microchip.com \
--to=ajay.kathat@microchip.com \
--cc=Adham.Abozaeid@microchip.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
/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).