Commit e1db0f55 authored by Kunihiko Hayashi's avatar Kunihiko Hayashi Committed by Bartosz Golaszewski

gpio: uniphier: Use helper function to get IRQ hardware number

Use helper function to get IRQ hardware number instead of direct access.
No functional changes intended.
Signed-off-by: default avatarKunihiko Hayashi <hayashi.kunihiko@socionext.com>
Signed-off-by: default avatarBartosz Golaszewski <brgl@bgdev.pl>
parent 3ea04656
...@@ -180,7 +180,7 @@ static int uniphier_gpio_to_irq(struct gpio_chip *chip, unsigned int offset) ...@@ -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) static void uniphier_gpio_irq_mask(struct irq_data *data)
{ {
struct uniphier_gpio_priv *priv = data->chip_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); 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) ...@@ -190,7 +190,7 @@ static void uniphier_gpio_irq_mask(struct irq_data *data)
static void uniphier_gpio_irq_unmask(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 = 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); 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) ...@@ -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) 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 = data->chip_data;
u32 mask = BIT(data->hwirq); u32 mask = BIT(irqd_to_hwirq(data));
u32 val = 0; u32 val = 0;
if (type == IRQ_TYPE_EDGE_BOTH) { if (type == IRQ_TYPE_EDGE_BOTH) {
...@@ -297,7 +297,8 @@ static int uniphier_gpio_irq_domain_activate(struct irq_domain *domain, ...@@ -297,7 +297,8 @@ static int uniphier_gpio_irq_domain_activate(struct irq_domain *domain,
struct uniphier_gpio_priv *priv = domain->host_data; struct uniphier_gpio_priv *priv = domain->host_data;
struct gpio_chip *chip = &priv->chip; 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, 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, ...@@ -306,7 +307,8 @@ static void uniphier_gpio_irq_domain_deactivate(struct irq_domain *domain,
struct uniphier_gpio_priv *priv = domain->host_data; struct uniphier_gpio_priv *priv = domain->host_data;
struct gpio_chip *chip = &priv->chip; 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 = { static const struct irq_domain_ops uniphier_gpio_irq_domain_ops = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment