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 2/8] staging: wilc1000: remove use of MAX_NUN_INT_THRPT_ENH2 macro
Date: Fri, 14 Feb 2020 11:52:16 +0000 [thread overview]
Message-ID: <20200214172250.13026-3-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 MAX_NUM_INT existing macro to handle the maximum supported
interrupts count and removed MAX_NUN_INT_THRPT_ENH2 macro.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
---
drivers/staging/wilc1000/sdio.c | 20 +++-----------------
drivers/staging/wilc1000/wlan.h | 2 +-
2 files changed, 4 insertions(+), 18 deletions(-)
diff --git a/drivers/staging/wilc1000/sdio.c b/drivers/staging/wilc1000/sdio.c
index ca99335687c4..77ef84f9cc37 100644
--- a/drivers/staging/wilc1000/sdio.c
+++ b/drivers/staging/wilc1000/sdio.c
@@ -27,8 +27,6 @@ struct wilc_sdio {
bool irq_gpio;
u32 block_size;
int nint;
-/* Max num interrupts allowed in registers 0xf7, 0xf8 */
-#define MAX_NUN_INT_THRPT_ENH2 (5)
int has_thrpt_enh3;
};
@@ -818,8 +816,6 @@ static int wilc_sdio_read_int(struct wilc *wilc, u32 *int_status)
tmp |= INT_3;
if (cmd.data & BIT(5))
tmp |= INT_4;
- if (cmd.data & BIT(6))
- tmp |= INT_5;
for (i = sdio_priv->nint; i < MAX_NUM_INT; i++) {
if ((tmp >> (IRG_FLAGS_OFFSET + i)) & 0x1) {
dev_err(&func->dev,
@@ -854,16 +850,11 @@ static int wilc_sdio_clear_int_ext(struct wilc *wilc, u32 val)
int vmm_ctl;
if (sdio_priv->has_thrpt_enh3) {
- u32 reg;
+ u32 reg = 0;
- if (sdio_priv->irq_gpio) {
- u32 flags;
+ if (sdio_priv->irq_gpio)
+ reg = val & (BIT(MAX_NUM_INT) - 1);
- flags = val & (BIT(MAX_NUN_INT_THRPT_ENH2) - 1);
- reg = flags;
- } else {
- reg = 0;
- }
/* select VMM table 0 */
if (val & SEL_VMM_TBL0)
reg |= BIT(5);
@@ -975,11 +966,6 @@ static int wilc_sdio_sync_ext(struct wilc *wilc, int nint)
dev_err(&func->dev, "Too many interrupts (%d)...\n", nint);
return -EINVAL;
}
- if (nint > MAX_NUN_INT_THRPT_ENH2) {
- dev_err(&func->dev,
- "Cannot support more than 5 interrupts when has_thrpt_enh2=1.\n");
- return -EINVAL;
- }
sdio_priv->nint = nint;
diff --git a/drivers/staging/wilc1000/wlan.h b/drivers/staging/wilc1000/wlan.h
index d3e822c374eb..876b02e93a81 100644
--- a/drivers/staging/wilc1000/wlan.h
+++ b/drivers/staging/wilc1000/wlan.h
@@ -175,7 +175,7 @@
#define INT_3 BIT(IRG_FLAGS_OFFSET + 3)
#define INT_4 BIT(IRG_FLAGS_OFFSET + 4)
#define INT_5 BIT(IRG_FLAGS_OFFSET + 5)
-#define MAX_NUM_INT 6
+#define MAX_NUM_INT 5
/*******************************************/
/* E0 and later Interrupt flags. */
--
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 ` Ajay.Kathat [this message]
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 ` [PATCH 7/8] staging: wilc1000: use short name for hif local variable in chip_wakeup() Ajay.Kathat
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-3-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).