linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] gpio: uniphier: Misc fixes
@ 2021-09-16 11:19 Kunihiko Hayashi
  2021-09-16 11:19 ` [PATCH 1/3] gpio: uniphier: Fix void functions to remove return value Kunihiko Hayashi
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Kunihiko Hayashi @ 2021-09-16 11:19 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Masami Hiramatsu
  Cc: linux-gpio, linux-arm-kernel, linux-kernel, Kunihiko Hayashi

This patch series includes fixes and changes for UniPhier GPIO driver.

Patch 1 is to remove the return value of each function according to
the return type of irq_chip callback functions.

Patch 2 is to replace direct access to IRQ hardware number with
helper functions.

Patch 3 is to replace direct access to private data from IRQ data
with helper functions.

Kunihiko Hayashi (3):
  gpio: uniphier: Fix void functions to remove return value
  gpio: uniphier: Use helper function to get IRQ hardware number
  gpio: uniphier: Use helper functions to get private data from IRQ data

 drivers/gpio/gpio-uniphier.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/3] gpio: uniphier: Fix void functions to remove return value
  2021-09-16 11:19 [PATCH 0/3] gpio: uniphier: Misc fixes Kunihiko Hayashi
@ 2021-09-16 11:19 ` Kunihiko Hayashi
  2021-09-16 11:19 ` [PATCH 2/3] gpio: uniphier: Use helper function to get IRQ hardware number Kunihiko Hayashi
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Kunihiko Hayashi @ 2021-09-16 11:19 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Masami Hiramatsu
  Cc: linux-gpio, linux-arm-kernel, linux-kernel, Kunihiko Hayashi

The return type of irq_chip.irq_mask() and irq_chip.irq_unmask() should
be void.

Fixes: dbe776c2ca54 ("gpio: uniphier: add UniPhier GPIO controller driver")
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
 drivers/gpio/gpio-uniphier.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpio/gpio-uniphier.c b/drivers/gpio/gpio-uniphier.c
index f99f3c1..39dca14 100644
--- a/drivers/gpio/gpio-uniphier.c
+++ b/drivers/gpio/gpio-uniphier.c
@@ -184,7 +184,7 @@ static void uniphier_gpio_irq_mask(struct irq_data *data)
 
 	uniphier_gpio_reg_update(priv, UNIPHIER_GPIO_IRQ_EN, mask, 0);
 
-	return irq_chip_mask_parent(data);
+	irq_chip_mask_parent(data);
 }
 
 static void uniphier_gpio_irq_unmask(struct irq_data *data)
@@ -194,7 +194,7 @@ static void uniphier_gpio_irq_unmask(struct irq_data *data)
 
 	uniphier_gpio_reg_update(priv, UNIPHIER_GPIO_IRQ_EN, mask, mask);
 
-	return irq_chip_unmask_parent(data);
+	irq_chip_unmask_parent(data);
 }
 
 static int uniphier_gpio_irq_set_type(struct irq_data *data, unsigned int type)
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/3] gpio: uniphier: Use helper function to get IRQ hardware number
  2021-09-16 11:19 [PATCH 0/3] gpio: uniphier: Misc fixes Kunihiko Hayashi
  2021-09-16 11:19 ` [PATCH 1/3] gpio: uniphier: Fix void functions to remove return value Kunihiko Hayashi
@ 2021-09-16 11:19 ` Kunihiko Hayashi
  2021-09-16 11:19 ` [PATCH 3/3] gpio: uniphier: Use helper functions to get private data from IRQ data Kunihiko Hayashi
  2021-09-22  9:22 ` [PATCH 0/3] gpio: uniphier: Misc fixes Bartosz Golaszewski
  3 siblings, 0 replies; 5+ messages in thread
From: Kunihiko Hayashi @ 2021-09-16 11:19 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Masami Hiramatsu
  Cc: linux-gpio, linux-arm-kernel, linux-kernel, Kunihiko Hayashi

Use helper function to get IRQ hardware number instead of direct access.
No functional changes intended.

Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
 drivers/gpio/gpio-uniphier.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/gpio/gpio-uniphier.c b/drivers/gpio/gpio-uniphier.c
index 39dca14..dca96f5 100644
--- a/drivers/gpio/gpio-uniphier.c
+++ b/drivers/gpio/gpio-uniphier.c
@@ -180,7 +180,7 @@ static int uniphier_gpio_to_irq(struct gpio_chip *chip, unsigned int offset)
 static void uniphier_gpio_irq_mask(struct irq_data *data)
 {
 	struct uniphier_gpio_priv *priv = data->chip_data;
-	u32 mask = BIT(data->hwirq);
+	u32 mask = BIT(irqd_to_hwirq(data));
 
 	uniphier_gpio_reg_update(priv, UNIPHIER_GPIO_IRQ_EN, mask, 0);
 
@@ -190,7 +190,7 @@ static void uniphier_gpio_irq_mask(struct irq_data *data)
 static void uniphier_gpio_irq_unmask(struct irq_data *data)
 {
 	struct uniphier_gpio_priv *priv = data->chip_data;
-	u32 mask = BIT(data->hwirq);
+	u32 mask = BIT(irqd_to_hwirq(data));
 
 	uniphier_gpio_reg_update(priv, UNIPHIER_GPIO_IRQ_EN, mask, mask);
 
@@ -200,7 +200,7 @@ static void uniphier_gpio_irq_unmask(struct irq_data *data)
 static int uniphier_gpio_irq_set_type(struct irq_data *data, unsigned int type)
 {
 	struct uniphier_gpio_priv *priv = data->chip_data;
-	u32 mask = BIT(data->hwirq);
+	u32 mask = BIT(irqd_to_hwirq(data));
 	u32 val = 0;
 
 	if (type == IRQ_TYPE_EDGE_BOTH) {
@@ -297,7 +297,8 @@ static int uniphier_gpio_irq_domain_activate(struct irq_domain *domain,
 	struct uniphier_gpio_priv *priv = domain->host_data;
 	struct gpio_chip *chip = &priv->chip;
 
-	return gpiochip_lock_as_irq(chip, data->hwirq + UNIPHIER_GPIO_IRQ_OFFSET);
+	return gpiochip_lock_as_irq(chip,
+			irqd_to_hwirq(data) + UNIPHIER_GPIO_IRQ_OFFSET);
 }
 
 static void uniphier_gpio_irq_domain_deactivate(struct irq_domain *domain,
@@ -306,7 +307,8 @@ static void uniphier_gpio_irq_domain_deactivate(struct irq_domain *domain,
 	struct uniphier_gpio_priv *priv = domain->host_data;
 	struct gpio_chip *chip = &priv->chip;
 
-	gpiochip_unlock_as_irq(chip, data->hwirq + UNIPHIER_GPIO_IRQ_OFFSET);
+	gpiochip_unlock_as_irq(chip,
+			irqd_to_hwirq(data) + UNIPHIER_GPIO_IRQ_OFFSET);
 }
 
 static const struct irq_domain_ops uniphier_gpio_irq_domain_ops = {
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/3] gpio: uniphier: Use helper functions to get private data from IRQ data
  2021-09-16 11:19 [PATCH 0/3] gpio: uniphier: Misc fixes Kunihiko Hayashi
  2021-09-16 11:19 ` [PATCH 1/3] gpio: uniphier: Fix void functions to remove return value Kunihiko Hayashi
  2021-09-16 11:19 ` [PATCH 2/3] gpio: uniphier: Use helper function to get IRQ hardware number Kunihiko Hayashi
@ 2021-09-16 11:19 ` Kunihiko Hayashi
  2021-09-22  9:22 ` [PATCH 0/3] gpio: uniphier: Misc fixes Bartosz Golaszewski
  3 siblings, 0 replies; 5+ messages in thread
From: Kunihiko Hayashi @ 2021-09-16 11:19 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Masami Hiramatsu
  Cc: linux-gpio, linux-arm-kernel, linux-kernel, Kunihiko Hayashi

Use helper functions to get private data from IRQ data instead of direct
access. No functional changes intended.

Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
 drivers/gpio/gpio-uniphier.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpio/gpio-uniphier.c b/drivers/gpio/gpio-uniphier.c
index dca96f5..19ce667 100644
--- a/drivers/gpio/gpio-uniphier.c
+++ b/drivers/gpio/gpio-uniphier.c
@@ -179,7 +179,7 @@ static int uniphier_gpio_to_irq(struct gpio_chip *chip, unsigned int offset)
 
 static void uniphier_gpio_irq_mask(struct irq_data *data)
 {
-	struct uniphier_gpio_priv *priv = data->chip_data;
+	struct uniphier_gpio_priv *priv = irq_data_get_irq_chip_data(data);
 	u32 mask = BIT(irqd_to_hwirq(data));
 
 	uniphier_gpio_reg_update(priv, UNIPHIER_GPIO_IRQ_EN, mask, 0);
@@ -189,7 +189,7 @@ static void uniphier_gpio_irq_mask(struct irq_data *data)
 
 static void uniphier_gpio_irq_unmask(struct irq_data *data)
 {
-	struct uniphier_gpio_priv *priv = data->chip_data;
+	struct uniphier_gpio_priv *priv = irq_data_get_irq_chip_data(data);
 	u32 mask = BIT(irqd_to_hwirq(data));
 
 	uniphier_gpio_reg_update(priv, UNIPHIER_GPIO_IRQ_EN, mask, mask);
@@ -199,7 +199,7 @@ static void uniphier_gpio_irq_unmask(struct irq_data *data)
 
 static int uniphier_gpio_irq_set_type(struct irq_data *data, unsigned int type)
 {
-	struct uniphier_gpio_priv *priv = data->chip_data;
+	struct uniphier_gpio_priv *priv = irq_data_get_irq_chip_data(data);
 	u32 mask = BIT(irqd_to_hwirq(data));
 	u32 val = 0;
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/3] gpio: uniphier: Misc fixes
  2021-09-16 11:19 [PATCH 0/3] gpio: uniphier: Misc fixes Kunihiko Hayashi
                   ` (2 preceding siblings ...)
  2021-09-16 11:19 ` [PATCH 3/3] gpio: uniphier: Use helper functions to get private data from IRQ data Kunihiko Hayashi
@ 2021-09-22  9:22 ` Bartosz Golaszewski
  3 siblings, 0 replies; 5+ messages in thread
From: Bartosz Golaszewski @ 2021-09-22  9:22 UTC (permalink / raw)
  To: Kunihiko Hayashi
  Cc: Linus Walleij, Masami Hiramatsu, linux-gpio, arm-soc, LKML

On Thu, Sep 16, 2021 at 1:19 PM Kunihiko Hayashi
<hayashi.kunihiko@socionext.com> wrote:
>
> This patch series includes fixes and changes for UniPhier GPIO driver.
>
> Patch 1 is to remove the return value of each function according to
> the return type of irq_chip callback functions.
>
> Patch 2 is to replace direct access to IRQ hardware number with
> helper functions.
>
> Patch 3 is to replace direct access to private data from IRQ data
> with helper functions.
>
> Kunihiko Hayashi (3):
>   gpio: uniphier: Fix void functions to remove return value
>   gpio: uniphier: Use helper function to get IRQ hardware number
>   gpio: uniphier: Use helper functions to get private data from IRQ data
>
>  drivers/gpio/gpio-uniphier.c | 22 ++++++++++++----------
>  1 file changed, 12 insertions(+), 10 deletions(-)
>
> --
> 2.7.4
>

All three applied. Thanks!

Bartosz

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-09-22  9:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-16 11:19 [PATCH 0/3] gpio: uniphier: Misc fixes Kunihiko Hayashi
2021-09-16 11:19 ` [PATCH 1/3] gpio: uniphier: Fix void functions to remove return value Kunihiko Hayashi
2021-09-16 11:19 ` [PATCH 2/3] gpio: uniphier: Use helper function to get IRQ hardware number Kunihiko Hayashi
2021-09-16 11:19 ` [PATCH 3/3] gpio: uniphier: Use helper functions to get private data from IRQ data Kunihiko Hayashi
2021-09-22  9:22 ` [PATCH 0/3] gpio: uniphier: Misc fixes Bartosz Golaszewski

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).