aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/pinctrl-apple-gpio.c
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@nvidia.com>2021-12-14 20:18:48 -0400
committerJason Gunthorpe <jgg@nvidia.com>2021-12-14 20:18:48 -0400
commit4922f0920966c28d674b03479cdcb7f3939bfbbd (patch)
tree6a8b3972ff853fc0addcfab662d33354124f7fdb /drivers/pinctrl/pinctrl-apple-gpio.c
parentRDMA/cma: Let cma_resolve_ib_dev() continue search even after empty entry (diff)
parentLinux 5.16-rc5 (diff)
downloadlinux-dev-4922f0920966c28d674b03479cdcb7f3939bfbbd.tar.xz
linux-dev-4922f0920966c28d674b03479cdcb7f3939bfbbd.zip
Merge tag 'v5.16-rc5' into rdma.git for-next
Required due to dependencies in following patches. Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'drivers/pinctrl/pinctrl-apple-gpio.c')
-rw-r--r--drivers/pinctrl/pinctrl-apple-gpio.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/pinctrl/pinctrl-apple-gpio.c b/drivers/pinctrl/pinctrl-apple-gpio.c
index 0cc346bfc4c3..a7861079a650 100644
--- a/drivers/pinctrl/pinctrl-apple-gpio.c
+++ b/drivers/pinctrl/pinctrl-apple-gpio.c
@@ -258,7 +258,7 @@ static void apple_gpio_irq_ack(struct irq_data *data)
pctl->base + REG_IRQ(irqgrp, data->hwirq));
}
-static int apple_gpio_irq_type(unsigned int type)
+static unsigned int apple_gpio_irq_type(unsigned int type)
{
switch (type & IRQ_TYPE_SENSE_MASK) {
case IRQ_TYPE_EDGE_RISING:
@@ -272,7 +272,7 @@ static int apple_gpio_irq_type(unsigned int type)
case IRQ_TYPE_LEVEL_LOW:
return REG_GPIOx_IN_IRQ_LO;
default:
- return -EINVAL;
+ return REG_GPIOx_IN_IRQ_OFF;
}
}
@@ -288,7 +288,7 @@ static void apple_gpio_irq_unmask(struct irq_data *data)
{
struct apple_gpio_pinctrl *pctl =
gpiochip_get_data(irq_data_get_irq_chip_data(data));
- int irqtype = apple_gpio_irq_type(irqd_get_trigger_type(data));
+ unsigned int irqtype = apple_gpio_irq_type(irqd_get_trigger_type(data));
apple_gpio_set_reg(pctl, data->hwirq, REG_GPIOx_MODE,
FIELD_PREP(REG_GPIOx_MODE, irqtype));
@@ -313,10 +313,10 @@ static int apple_gpio_irq_set_type(struct irq_data *data,
{
struct apple_gpio_pinctrl *pctl =
gpiochip_get_data(irq_data_get_irq_chip_data(data));
- int irqtype = apple_gpio_irq_type(type);
+ unsigned int irqtype = apple_gpio_irq_type(type);
- if (irqtype < 0)
- return irqtype;
+ if (irqtype == REG_GPIOx_IN_IRQ_OFF)
+ return -EINVAL;
apple_gpio_set_reg(pctl, data->hwirq, REG_GPIOx_MODE,
FIELD_PREP(REG_GPIOx_MODE, irqtype));