2019-08-29 18:36:03

by Lina Iyer

[permalink] [raw]
Subject: [PATCH RFC 09/14] drivers: pinctrl: msm: fix use of deprecated gpiolib APIs

Replace gpiochip_irqchip_add() and gpiochip_set_chained_irqchip() calls
by populating the gpio_irq_chip data structures instead.

Signed-off-by: Lina Iyer <[email protected]>
---
drivers/pinctrl/qcom/pinctrl-msm.c | 28 +++++++++++++---------------
1 file changed, 13 insertions(+), 15 deletions(-)

diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c
index 7f35c196bb3e..76e8528e4d0a 100644
--- a/drivers/pinctrl/qcom/pinctrl-msm.c
+++ b/drivers/pinctrl/qcom/pinctrl-msm.c
@@ -1027,7 +1027,19 @@ static int msm_gpio_init(struct msm_pinctrl *pctrl)
pctrl->irq_chip.irq_request_resources = msm_gpio_irq_reqres;
pctrl->irq_chip.irq_release_resources = msm_gpio_irq_relres;

- ret = gpiochip_add_data(&pctrl->chip, pctrl);
+ chip->irq.chip = &pctrl->irq_chip;
+ chip->irq.default_type = IRQ_TYPE_NONE;
+ chip->irq.handler = handle_bad_irq;
+ chip->irq.fwnode = pctrl->dev->fwnode;
+ chip->irq.parent_handler = msm_gpio_irq_handler;
+ chip->irq.num_parents = 1;
+ chip->irq.parents = devm_kcalloc(pctrl->dev, 1,
+ sizeof(*chip->irq.parents),
+ GFP_KERNEL);
+ if (!chip->irq.parents)
+ return -ENOMEM;
+
+ ret = devm_gpiochip_add_data(pctrl->dev, chip, pctrl);
if (ret) {
dev_err(pctrl->dev, "Failed register gpiochip\n");
return ret;
@@ -1053,20 +1065,6 @@ static int msm_gpio_init(struct msm_pinctrl *pctrl)
}
}

- ret = gpiochip_irqchip_add(chip,
- &pctrl->irq_chip,
- 0,
- handle_edge_irq,
- IRQ_TYPE_NONE);
- if (ret) {
- dev_err(pctrl->dev, "Failed to add irqchip to gpiochip\n");
- gpiochip_remove(&pctrl->chip);
- return -ENOSYS;
- }
-
- gpiochip_set_chained_irqchip(chip, &pctrl->irq_chip, pctrl->irq,
- msm_gpio_irq_handler);
-
return 0;
}

--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


2019-09-06 10:05:54

by Stephen Boyd

[permalink] [raw]
Subject: Re: [PATCH RFC 09/14] drivers: pinctrl: msm: fix use of deprecated gpiolib APIs

The subject is misleading. It's not fixing anything, just moving away
from deprecated to "supported" APIs.

Quoting Lina Iyer (2019-08-29 11:11:58)
> Replace gpiochip_irqchip_add() and gpiochip_set_chained_irqchip() calls
> by populating the gpio_irq_chip data structures instead.
>
> Signed-off-by: Lina Iyer <[email protected]>

2019-09-11 10:22:25

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH RFC 09/14] drivers: pinctrl: msm: fix use of deprecated gpiolib APIs

On Thu, Aug 29, 2019 at 7:35 PM Lina Iyer <[email protected]> wrote:

> Replace gpiochip_irqchip_add() and gpiochip_set_chained_irqchip() calls
> by populating the gpio_irq_chip data structures instead.
>
> Signed-off-by: Lina Iyer <[email protected]>

This is mostly fixed upstream I think, but:

> + chip->irq.fwnode = pctrl->dev->fwnode;

This fwnode assignment is missing though.

Sorry for the constant churn and required rebasing...

Yours,
Linus Walleij

2019-09-11 16:19:20

by Lina Iyer

[permalink] [raw]
Subject: Re: [PATCH RFC 09/14] drivers: pinctrl: msm: fix use of deprecated gpiolib APIs

On Wed, Sep 11 2019 at 04:19 -0600, Linus Walleij wrote:
>On Thu, Aug 29, 2019 at 7:35 PM Lina Iyer <[email protected]> wrote:
>
>> Replace gpiochip_irqchip_add() and gpiochip_set_chained_irqchip() calls
>> by populating the gpio_irq_chip data structures instead.
>>
>> Signed-off-by: Lina Iyer <[email protected]>
>
>This is mostly fixed upstream I think, but:
>
>> + chip->irq.fwnode = pctrl->dev->fwnode;
>
>This fwnode assignment is missing though.
>
>Sorry for the constant churn and required rebasing...
>
Not a problem. Will rebase.