From: Abanoub Sameh <abanoubsameh8@gmail.com>
To: andy.shevchenko@gmail.com
Cc: linus.walleij@linaro.org, linux-gpio@vger.kernel.org,
linux-kernel@vger.kernel.org,
Abanoub Sameh <abanoubsameh@protonmail.com>
Subject: [PATCH 5/7] gpio: fixed coding style issues in gpio-msic.c
Date: Tue, 21 Jul 2020 11:35:20 +0200 [thread overview]
Message-ID: <20200721093522.2309530-5-abanoubsameh@protonmail.com> (raw)
In-Reply-To: <20200721093522.2309530-1-abanoubsameh@protonmail.com>
Signed-off-by: Abanoub Sameh <abanoubsameh@protonmail.com>
---
drivers/gpio/gpio-msic.c | 31 +++++++++++++++++--------------
1 file changed, 17 insertions(+), 14 deletions(-)
diff --git a/drivers/gpio/gpio-msic.c b/drivers/gpio/gpio-msic.c
index 7e3c96e4ab2c..37664e7b3ddd 100644
--- a/drivers/gpio/gpio-msic.c
+++ b/drivers/gpio/gpio-msic.c
@@ -43,9 +43,9 @@ struct msic_gpio {
struct mutex buslock;
struct gpio_chip chip;
int irq;
- unsigned irq_base;
+ unsigned int irq_base;
unsigned long trig_change_mask;
- unsigned trig_type;
+ unsigned int trig_type;
};
/*
@@ -58,7 +58,7 @@ struct msic_gpio {
* GPIO1HV0..GPIO1HV3: high voltage, bank 1, gpio_base + 20
*/
-static int msic_gpio_to_ireg(unsigned offset)
+static int msic_gpio_to_ireg(unsigned int offset)
{
if (offset >= MSIC_NUM_GPIO)
return -EINVAL;
@@ -73,7 +73,7 @@ static int msic_gpio_to_ireg(unsigned offset)
return INTEL_MSIC_GPIO1HV0CTLI - offset + 20;
}
-static int msic_gpio_to_oreg(unsigned offset)
+static int msic_gpio_to_oreg(unsigned int offset)
{
if (offset >= MSIC_NUM_GPIO)
return -EINVAL;
@@ -88,7 +88,7 @@ static int msic_gpio_to_oreg(unsigned offset)
return INTEL_MSIC_GPIO1HV0CTLO - offset + 20;
}
-static int msic_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
+static int msic_gpio_direction_input(struct gpio_chip *chip, unsigned int offset)
{
int reg;
@@ -100,10 +100,10 @@ static int msic_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
}
static int msic_gpio_direction_output(struct gpio_chip *chip,
- unsigned offset, int value)
+ unsigned int offset, int value)
{
int reg;
- unsigned mask;
+ unsigned int mask;
value = (!!value) | MSIC_GPIO_DIR_OUT;
mask = MSIC_GPIO_DIR_MASK | MSIC_GPIO_DOUT_MASK;
@@ -115,7 +115,7 @@ static int msic_gpio_direction_output(struct gpio_chip *chip,
return intel_msic_reg_update(reg, value, mask);
}
-static int msic_gpio_get(struct gpio_chip *chip, unsigned offset)
+static int msic_gpio_get(struct gpio_chip *chip, unsigned int offset)
{
u8 r;
int ret;
@@ -132,7 +132,7 @@ static int msic_gpio_get(struct gpio_chip *chip, unsigned offset)
return !!(r & MSIC_GPIO_DIN_MASK);
}
-static void msic_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
+static void msic_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)
{
int reg;
@@ -140,7 +140,7 @@ static void msic_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
if (reg < 0)
return;
- intel_msic_reg_update(reg, !!value , MSIC_GPIO_DOUT_MASK);
+ intel_msic_reg_update(reg, !!value, MSIC_GPIO_DOUT_MASK);
}
/*
@@ -148,7 +148,7 @@ static void msic_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
* irq_desc->lock held. We can not access the scu bus here, so we
* store the change and update in the bus_sync_unlock() function below
*/
-static int msic_irq_type(struct irq_data *data, unsigned type)
+static int msic_irq_type(struct irq_data *data, unsigned int type)
{
struct msic_gpio *mg = irq_data_get_irq_chip_data(data);
u32 gpio = data->irq - mg->irq_base;
@@ -163,15 +163,17 @@ static int msic_irq_type(struct irq_data *data, unsigned type)
return 0;
}
-static int msic_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
+static int msic_gpio_to_irq(struct gpio_chip *chip, unsigned int offset)
{
struct msic_gpio *mg = gpiochip_get_data(chip);
+
return mg->irq_base + offset;
}
static void msic_bus_lock(struct irq_data *data)
{
struct msic_gpio *mg = irq_data_get_irq_chip_data(data);
+
mutex_lock(&mg->buslock);
}
@@ -183,8 +185,9 @@ static void msic_bus_sync_unlock(struct irq_data *data)
u8 trig = 0;
/* We can only get one change at a time as the buslock covers the
- entire transaction. The irq_desc->lock is dropped before we are
- called but that is fine */
+ * entire transaction. The irq_desc->lock is dropped before we are
+ * called but that is fine
+ */
if (mg->trig_change_mask) {
offset = __ffs(mg->trig_change_mask);
--
2.28.0.rc0
next prev parent reply other threads:[~2020-07-21 9:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-21 9:35 [PATCH 1/7] gpio: fixed coding style issues in gpio-crystalcove.c Abanoub Sameh
2020-07-21 9:35 ` [PATCH 2/7] gpio: fixed coding style issues in gpio-ich.c Abanoub Sameh
2020-07-21 9:35 ` [PATCH 3/7] gpio: fixed coding style issues in gpio-intel-mid.c Abanoub Sameh
2020-07-21 9:35 ` [PATCH 4/7] gpio: fixed coding style issues in gpio-ml-ioh.c Abanoub Sameh
2020-07-21 9:35 ` Abanoub Sameh [this message]
2020-07-21 9:35 ` [PATCH 6/7] gpio: fixed coding style issues in gpio-pch.c Abanoub Sameh
2020-07-21 9:35 ` [PATCH 7/7] gpio: fixed coding style issues in gpio-sch.c Abanoub Sameh
2020-07-21 10:50 ` [PATCH 1/7] gpio: fixed coding style issues in gpio-crystalcove.c Andy Shevchenko
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=20200721093522.2309530-5-abanoubsameh@protonmail.com \
--to=abanoubsameh8@gmail.com \
--cc=abanoubsameh@protonmail.com \
--cc=andy.shevchenko@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@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).