Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1701807 > unrolled thread
| Started by | Bartosz Golaszewski <brgl@bgdev.pl> |
|---|---|
| First post | 2017-08-02 10:00 +0200 |
| Last post | 2017-08-02 13:40 +0200 |
| Articles | 15 — 4 participants |
Back to article view | Back to linux.kernel
[PATCH 0/6] gpio: use devres for irq generic chip Bartosz Golaszewski <brgl@bgdev.pl> - 2017-08-02 10:00 +0200
[PATCH 1/6] gpio: sta2x11: use devres for irq generic chip Bartosz Golaszewski <brgl@bgdev.pl> - 2017-08-02 10:00 +0200
Re: [PATCH 1/6] gpio: sta2x11: use devres for irq generic chip Linus Walleij <linus.walleij@linaro.org> - 2017-08-02 13:40 +0200
[PATCH 5/6] gpio: mxs: use devres for irq generic chip Bartosz Golaszewski <brgl@bgdev.pl> - 2017-08-02 10:00 +0200
[PATCH 4/6] gpio: mxc: use devres for irq generic chip Bartosz Golaszewski <brgl@bgdev.pl> - 2017-08-02 10:00 +0200
Re: [PATCH 4/6] gpio: mxc: use devres for irq generic chip Bartosz Golaszewski <brgl@bgdev.pl> - 2017-08-02 10:30 +0200
Re: [PATCH 4/6] gpio: mxc: use devres for irq generic chip Alexander Stein <alexander.stein@systec-electronic.com> - 2017-08-02 10:30 +0200
Re: [PATCH 4/6] gpio: mxc: use devres for irq generic chip Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-08-02 10:40 +0200
Re: [PATCH 4/6] gpio: mxc: use devres for irq generic chip Linus Walleij <linus.walleij@linaro.org> - 2017-08-02 13:50 +0200
Re: [PATCH 4/6] gpio: mxc: use devres for irq generic chip Bartosz Golaszewski <brgl@bgdev.pl> - 2017-08-02 14:00 +0200
[PATCH 3/6] gpio: pch: use devres for irq generic chip Bartosz Golaszewski <brgl@bgdev.pl> - 2017-08-02 10:00 +0200
Re: [PATCH 3/6] gpio: pch: use devres for irq generic chip Linus Walleij <linus.walleij@linaro.org> - 2017-08-02 13:40 +0200
[PATCH 6/6] gpio: sodaville: use devres for irq generic chip Bartosz Golaszewski <brgl@bgdev.pl> - 2017-08-02 10:00 +0200
[PATCH 2/6] gpio: ml-ioh: use devres for irq generic chip Bartosz Golaszewski <brgl@bgdev.pl> - 2017-08-02 10:00 +0200
Re: [PATCH 2/6] gpio: ml-ioh: use devres for irq generic chip Linus Walleij <linus.walleij@linaro.org> - 2017-08-02 13:40 +0200
| From | Bartosz Golaszewski <brgl@bgdev.pl> |
|---|---|
| Date | 2017-08-02 10:00 +0200 |
| Subject | [PATCH 0/6] gpio: use devres for irq generic chip |
| Message-ID | <u9WJr-70R-5@gated-at.bofh.it> |
We now provide resource managed versions of irq_alloc_generic_chip() and irq_setup_generic_chip(). Use them in all relevant gpio drivers. Bartosz Golaszewski (6): gpio: sta2x11: use devres for irq generic chip gpio: ml-ioh: use devres for irq generic chip gpio: pch: use devres for irq generic chip gpio: mxc: use devres for irq generic chip gpio: mxs: use devres for irq generic chip gpio: sodaville: use devres for irq generic chip drivers/gpio/gpio-ml-ioh.c | 12 +++++++----- drivers/gpio/gpio-mxc.c | 15 ++++++++++----- drivers/gpio/gpio-mxs.c | 14 +++++++++----- drivers/gpio/gpio-pch.c | 12 +++++++----- drivers/gpio/gpio-sodaville.c | 15 ++++++++++----- drivers/gpio/gpio-sta2x11.c | 13 +++++++++---- 6 files changed, 52 insertions(+), 29 deletions(-) -- 2.13.2
[toc] | [next] | [standalone]
| From | Bartosz Golaszewski <brgl@bgdev.pl> |
|---|---|
| Date | 2017-08-02 10:00 +0200 |
| Subject | [PATCH 1/6] gpio: sta2x11: use devres for irq generic chip |
| Message-ID | <u9WJs-70R-17@gated-at.bofh.it> |
| In reply to | #1701807 |
Use resource managed variants of irq_alloc_generic_chip() and
irq_setup_generic_chip().
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
---
drivers/gpio/gpio-sta2x11.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/gpio/gpio-sta2x11.c b/drivers/gpio/gpio-sta2x11.c
index 9e705162da8d..a16c1c4f92a7 100644
--- a/drivers/gpio/gpio-sta2x11.c
+++ b/drivers/gpio/gpio-sta2x11.c
@@ -324,9 +324,11 @@ static int gsta_alloc_irq_chip(struct gsta_gpio *chip)
{
struct irq_chip_generic *gc;
struct irq_chip_type *ct;
+ int rv;
- gc = irq_alloc_generic_chip(KBUILD_MODNAME, 1, chip->irq_base,
- chip->reg_base, handle_simple_irq);
+ gc = devm_irq_alloc_generic_chip(chip->dev, KBUILD_MODNAME, 1,
+ chip->irq_base,
+ chip->reg_base, handle_simple_irq);
if (!gc)
return -ENOMEM;
@@ -338,8 +340,11 @@ static int gsta_alloc_irq_chip(struct gsta_gpio *chip)
ct->chip.irq_enable = gsta_irq_enable;
/* FIXME: this makes at most 32 interrupts. Request 0 by now */
- irq_setup_generic_chip(gc, 0 /* IRQ_MSK(GSTA_GPIO_PER_BLOCK) */, 0,
- IRQ_NOREQUEST | IRQ_NOPROBE, 0);
+ rv = devm_irq_setup_generic_chip(chip->dev, gc,
+ 0 /* IRQ_MSK(GSTA_GPIO_PER_BLOCK) */,
+ 0, IRQ_NOREQUEST | IRQ_NOPROBE, 0);
+ if (rv)
+ return rv;
/* Set up all all 128 interrupts: code from setup_generic_chip */
{
--
2.13.2
[toc] | [prev] | [next] | [standalone]
| From | Linus Walleij <linus.walleij@linaro.org> |
|---|---|
| Date | 2017-08-02 13:40 +0200 |
| Subject | Re: [PATCH 1/6] gpio: sta2x11: use devres for irq generic chip |
| Message-ID | <ua0al-Og-7@gated-at.bofh.it> |
| In reply to | #1701810 |
On Wed, Aug 2, 2017 at 9:51 AM, Bartosz Golaszewski <brgl@bgdev.pl> wrote: > Use resource managed variants of irq_alloc_generic_chip() and > irq_setup_generic_chip(). > > Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl> Patch applied. Yours, Linus Walleij
[toc] | [prev] | [next] | [standalone]
| From | Bartosz Golaszewski <brgl@bgdev.pl> |
|---|---|
| Date | 2017-08-02 10:00 +0200 |
| Subject | [PATCH 5/6] gpio: mxs: use devres for irq generic chip |
| Message-ID | <u9WJs-70R-15@gated-at.bofh.it> |
| In reply to | #1701807 |
Use resource managed variants of irq_alloc_generic_chip() and
irq_setup_generic_chip().
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
---
drivers/gpio/gpio-mxs.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/drivers/gpio/gpio-mxs.c b/drivers/gpio/gpio-mxs.c
index 6ae583f36733..f7c645f7dae5 100644
--- a/drivers/gpio/gpio-mxs.c
+++ b/drivers/gpio/gpio-mxs.c
@@ -66,6 +66,7 @@ struct mxs_gpio_port {
int irq;
struct irq_domain *domain;
struct gpio_chip gc;
+ struct device *dev;
enum mxs_gpio_id devid;
u32 both_edges;
};
@@ -209,9 +210,10 @@ static int mxs_gpio_init_gc(struct mxs_gpio_port *port, int irq_base)
{
struct irq_chip_generic *gc;
struct irq_chip_type *ct;
+ int rv;
- gc = irq_alloc_generic_chip("gpio-mxs", 2, irq_base,
- port->base, handle_level_irq);
+ gc = devm_irq_alloc_generic_chip(port->dev, "gpio-mxs", 2, irq_base,
+ port->base, handle_level_irq);
if (!gc)
return -ENOMEM;
@@ -242,10 +244,11 @@ static int mxs_gpio_init_gc(struct mxs_gpio_port *port, int irq_base)
ct->regs.disable = PINCTRL_IRQEN(port) + MXS_CLR;
ct->handler = handle_level_irq;
- irq_setup_generic_chip(gc, IRQ_MSK(32), IRQ_GC_INIT_NESTED_LOCK,
- IRQ_NOREQUEST, 0);
+ rv = devm_irq_setup_generic_chip(port->dev, gc, IRQ_MSK(32),
+ IRQ_GC_INIT_NESTED_LOCK,
+ IRQ_NOREQUEST, 0);
- return 0;
+ return rv;
}
static int mxs_gpio_to_irq(struct gpio_chip *gc, unsigned offset)
@@ -304,6 +307,7 @@ static int mxs_gpio_probe(struct platform_device *pdev)
if (port->id < 0)
return port->id;
port->devid = (enum mxs_gpio_id) of_id->data;
+ port->dev = &pdev->dev;
port->irq = platform_get_irq(pdev, 0);
if (port->irq < 0)
return port->irq;
--
2.13.2
[toc] | [prev] | [next] | [standalone]
| From | Bartosz Golaszewski <brgl@bgdev.pl> |
|---|---|
| Date | 2017-08-02 10:00 +0200 |
| Subject | [PATCH 4/6] gpio: mxc: use devres for irq generic chip |
| Message-ID | <u9WJs-70R-29@gated-at.bofh.it> |
| In reply to | #1701807 |
Use resource managed variants of irq_alloc_generic_chip() and
irq_setup_generic_chip().
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
---
drivers/gpio/gpio-mxc.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c
index 3abea3f0b307..d5f3db49f48e 100644
--- a/drivers/gpio/gpio-mxc.c
+++ b/drivers/gpio/gpio-mxc.c
@@ -66,6 +66,7 @@ struct mxc_gpio_port {
int irq_high;
struct irq_domain *domain;
struct gpio_chip gc;
+ struct device *dev;
u32 both_edges;
};
@@ -344,9 +345,10 @@ static int mxc_gpio_init_gc(struct mxc_gpio_port *port, int irq_base)
{
struct irq_chip_generic *gc;
struct irq_chip_type *ct;
+ int rv;
- gc = irq_alloc_generic_chip("gpio-mxc", 1, irq_base,
- port->base, handle_level_irq);
+ gc = devm_irq_alloc_generic_chip(port->dev, "gpio-mxc", 1, irq_base,
+ port->base, handle_level_irq);
if (!gc)
return -ENOMEM;
gc->private = port;
@@ -361,10 +363,11 @@ static int mxc_gpio_init_gc(struct mxc_gpio_port *port, int irq_base)
ct->regs.ack = GPIO_ISR;
ct->regs.mask = GPIO_IMR;
- irq_setup_generic_chip(gc, IRQ_MSK(32), IRQ_GC_INIT_NESTED_LOCK,
- IRQ_NOREQUEST, 0);
+ rv = devm_irq_setup_generic_chip(port->dev, gc, IRQ_MSK(32),
+ IRQ_GC_INIT_NESTED_LOCK,
+ IRQ_NOREQUEST, 0);
- return 0;
+ return rv;
}
static void mxc_gpio_get_hw(struct platform_device *pdev)
@@ -418,6 +421,8 @@ static int mxc_gpio_probe(struct platform_device *pdev)
if (!port)
return -ENOMEM;
+ port->dev = &pdev->dev;
+
iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
port->base = devm_ioremap_resource(&pdev->dev, iores);
if (IS_ERR(port->base))
--
2.13.2
[toc] | [prev] | [next] | [standalone]
| From | Bartosz Golaszewski <brgl@bgdev.pl> |
|---|---|
| Date | 2017-08-02 10:30 +0200 |
| Subject | Re: [PATCH 4/6] gpio: mxc: use devres for irq generic chip |
| Message-ID | <u9Xcu-7q1-23@gated-at.bofh.it> |
| In reply to | #1701815 |
2017-08-02 10:09 GMT+02:00 Alexander Stein <alexander.stein@systec-electronic.com>: > Hi, > > On Wednesday 02 August 2017 09:51:24, Bartosz Golaszewski wrote: >> Use resource managed variants of irq_alloc_generic_chip() and >> irq_setup_generic_chip(). > > Is this really useful for drivers which can only be built-in? This is probably > valid for the other drives as well. > > Best regards, > Alexander > gpio-pch and gpio-ml-ioh are loadable and they leak the resources allocated with these routines. Other drivers affected by this series already use other devm_*() functions and these changes just make them more consistent. Thanks, Bartosz
[toc] | [prev] | [next] | [standalone]
| From | Alexander Stein <alexander.stein@systec-electronic.com> |
|---|---|
| Date | 2017-08-02 10:30 +0200 |
| Subject | Re: [PATCH 4/6] gpio: mxc: use devres for irq generic chip |
| Message-ID | <u9Xcu-7q1-25@gated-at.bofh.it> |
| In reply to | #1701815 |
Hi, On Wednesday 02 August 2017 09:51:24, Bartosz Golaszewski wrote: > Use resource managed variants of irq_alloc_generic_chip() and > irq_setup_generic_chip(). Is this really useful for drivers which can only be built-in? This is probably valid for the other drives as well. Best regards, Alexander
[toc] | [prev] | [next] | [standalone]
| From | Andy Shevchenko <andy.shevchenko@gmail.com> |
|---|---|
| Date | 2017-08-02 10:40 +0200 |
| Subject | Re: [PATCH 4/6] gpio: mxc: use devres for irq generic chip |
| Message-ID | <u9Xma-7tc-5@gated-at.bofh.it> |
| In reply to | #1701866 |
On Wed, Aug 2, 2017 at 11:09 AM, Alexander Stein <alexander.stein@systec-electronic.com> wrote: > On Wednesday 02 August 2017 09:51:24, Bartosz Golaszewski wrote: >> Use resource managed variants of irq_alloc_generic_chip() and >> irq_setup_generic_chip(). > > Is this really useful for drivers which can only be built-in? But you still can unbind the driver and its ->remove() will be called (in case of no remove, devres still on the table), right? -- With Best Regards, Andy Shevchenko
[toc] | [prev] | [next] | [standalone]
| From | Linus Walleij <linus.walleij@linaro.org> |
|---|---|
| Date | 2017-08-02 13:50 +0200 |
| Subject | Re: [PATCH 4/6] gpio: mxc: use devres for irq generic chip |
| Message-ID | <ua0k2-RL-31@gated-at.bofh.it> |
| In reply to | #1701871 |
On Wed, Aug 2, 2017 at 10:32 AM, Andy Shevchenko <andy.shevchenko@gmail.com> wrote: > On Wed, Aug 2, 2017 at 11:09 AM, Alexander Stein > <alexander.stein@systec-electronic.com> wrote: >> On Wednesday 02 August 2017 09:51:24, Bartosz Golaszewski wrote: >>> Use resource managed variants of irq_alloc_generic_chip() and >>> irq_setup_generic_chip(). >> >> Is this really useful for drivers which can only be built-in? > > But you still can unbind the driver and its ->remove() will be called > (in case of no remove, devres still on the table), right? Maybe the patches need to be combines with a .suppress_bind_attrs = true in the driver struct? I backed out the patches I applied, I thought the series were older, sorry stressed at work today. Yours, Linus Walleij
[toc] | [prev] | [next] | [standalone]
| From | Bartosz Golaszewski <brgl@bgdev.pl> |
|---|---|
| Date | 2017-08-02 14:00 +0200 |
| Subject | Re: [PATCH 4/6] gpio: mxc: use devres for irq generic chip |
| Message-ID | <ua0tI-Vn-37@gated-at.bofh.it> |
| In reply to | #1702042 |
2017-08-02 13:41 GMT+02:00 Linus Walleij <linus.walleij@linaro.org>: > On Wed, Aug 2, 2017 at 10:32 AM, Andy Shevchenko > <andy.shevchenko@gmail.com> wrote: >> On Wed, Aug 2, 2017 at 11:09 AM, Alexander Stein >> <alexander.stein@systec-electronic.com> wrote: >>> On Wednesday 02 August 2017 09:51:24, Bartosz Golaszewski wrote: >>>> Use resource managed variants of irq_alloc_generic_chip() and >>>> irq_setup_generic_chip(). >>> >>> Is this really useful for drivers which can only be built-in? >> >> But you still can unbind the driver and its ->remove() will be called >> (in case of no remove, devres still on the table), right? > > Maybe the patches need to be combines with a > .suppress_bind_attrs = true in the driver struct? > > I backed out the patches I applied, I thought the series were older, > sorry stressed at work today. > gpio-sodaville sets .supress_bind_attrs to true. Other built-in drivers need updates for that, but I think this could go in a separate series as using devres doesn't affect the bind/unbind functionality/issue. Thanks, Bartosz
[toc] | [prev] | [next] | [standalone]
| From | Bartosz Golaszewski <brgl@bgdev.pl> |
|---|---|
| Date | 2017-08-02 10:00 +0200 |
| Subject | [PATCH 3/6] gpio: pch: use devres for irq generic chip |
| Message-ID | <u9WJs-70R-31@gated-at.bofh.it> |
| In reply to | #1701807 |
Use resource managed variants of irq_alloc_generic_chip() and
irq_setup_generic_chip().
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
---
drivers/gpio/gpio-pch.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/gpio/gpio-pch.c b/drivers/gpio/gpio-pch.c
index f6600f8ada52..68c6d0c5a6d1 100644
--- a/drivers/gpio/gpio-pch.c
+++ b/drivers/gpio/gpio-pch.c
@@ -337,9 +337,10 @@ static int pch_gpio_alloc_generic_chip(struct pch_gpio *chip,
{
struct irq_chip_generic *gc;
struct irq_chip_type *ct;
+ int rv;
- gc = irq_alloc_generic_chip("pch_gpio", 1, irq_start, chip->base,
- handle_simple_irq);
+ gc = devm_irq_alloc_generic_chip(chip->dev, "pch_gpio", 1, irq_start,
+ chip->base, handle_simple_irq);
if (!gc)
return -ENOMEM;
@@ -351,10 +352,11 @@ static int pch_gpio_alloc_generic_chip(struct pch_gpio *chip,
ct->chip.irq_unmask = pch_irq_unmask;
ct->chip.irq_set_type = pch_irq_type;
- irq_setup_generic_chip(gc, IRQ_MSK(num), IRQ_GC_INIT_MASK_CACHE,
- IRQ_NOREQUEST | IRQ_NOPROBE, 0);
+ rv = devm_irq_setup_generic_chip(chip->dev, gc, IRQ_MSK(num),
+ IRQ_GC_INIT_MASK_CACHE,
+ IRQ_NOREQUEST | IRQ_NOPROBE, 0);
- return 0;
+ return rv;
}
static int pch_gpio_probe(struct pci_dev *pdev,
--
2.13.2
[toc] | [prev] | [next] | [standalone]
| From | Linus Walleij <linus.walleij@linaro.org> |
|---|---|
| Date | 2017-08-02 13:40 +0200 |
| Subject | Re: [PATCH 3/6] gpio: pch: use devres for irq generic chip |
| Message-ID | <ua0al-Og-9@gated-at.bofh.it> |
| In reply to | #1701816 |
On Wed, Aug 2, 2017 at 9:51 AM, Bartosz Golaszewski <brgl@bgdev.pl> wrote: > Use resource managed variants of irq_alloc_generic_chip() and > irq_setup_generic_chip(). > > Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl> Patch applied. Yours, Linus Walleij
[toc] | [prev] | [next] | [standalone]
| From | Bartosz Golaszewski <brgl@bgdev.pl> |
|---|---|
| Date | 2017-08-02 10:00 +0200 |
| Subject | [PATCH 6/6] gpio: sodaville: use devres for irq generic chip |
| Message-ID | <u9WJs-70R-33@gated-at.bofh.it> |
| In reply to | #1701807 |
Use resource managed variants of irq_alloc_generic_chip() and
irq_setup_generic_chip().
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
---
drivers/gpio/gpio-sodaville.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/drivers/gpio/gpio-sodaville.c b/drivers/gpio/gpio-sodaville.c
index f60da83349ef..20a39f5ac361 100644
--- a/drivers/gpio/gpio-sodaville.c
+++ b/drivers/gpio/gpio-sodaville.c
@@ -155,8 +155,9 @@ static int sdv_register_irqsupport(struct sdv_gpio_chip_data *sd,
* we unmask & ACK the IRQ before the source of the interrupt is gone
* then the interrupt is active again.
*/
- sd->gc = irq_alloc_generic_chip("sdv-gpio", 1, sd->irq_base,
- sd->gpio_pub_base, handle_fasteoi_irq);
+ sd->gc = devm_irq_alloc_generic_chip(&pdev->dev, "sdv-gpio", 1,
+ sd->irq_base, sd->gpio_pub_base,
+ handle_fasteoi_irq);
if (!sd->gc)
return -ENOMEM;
@@ -170,9 +171,13 @@ static int sdv_register_irqsupport(struct sdv_gpio_chip_data *sd,
ct->chip.irq_eoi = irq_gc_eoi;
ct->chip.irq_set_type = sdv_gpio_pub_set_type;
- irq_setup_generic_chip(sd->gc, IRQ_MSK(SDV_NUM_PUB_GPIOS),
- IRQ_GC_INIT_MASK_CACHE, IRQ_NOREQUEST,
- IRQ_LEVEL | IRQ_NOPROBE);
+ ret = devm_irq_setup_generic_chip(&pdev->dev, sd->gc,
+ IRQ_MSK(SDV_NUM_PUB_GPIOS),
+ IRQ_GC_INIT_MASK_CACHE,
+ IRQ_NOREQUEST,
+ IRQ_LEVEL | IRQ_NOPROBE);
+ if (ret)
+ return ret;
sd->id = irq_domain_add_legacy(pdev->dev.of_node, SDV_NUM_PUB_GPIOS,
sd->irq_base, 0, &irq_domain_sdv_ops, sd);
--
2.13.2
[toc] | [prev] | [next] | [standalone]
| From | Bartosz Golaszewski <brgl@bgdev.pl> |
|---|---|
| Date | 2017-08-02 10:00 +0200 |
| Subject | [PATCH 2/6] gpio: ml-ioh: use devres for irq generic chip |
| Message-ID | <u9WJt-70R-39@gated-at.bofh.it> |
| In reply to | #1701807 |
Use resource managed variants of irq_alloc_generic_chip() and
irq_setup_generic_chip().
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
---
drivers/gpio/gpio-ml-ioh.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/gpio/gpio-ml-ioh.c b/drivers/gpio/gpio-ml-ioh.c
index 74fdce096c26..4b80e996d976 100644
--- a/drivers/gpio/gpio-ml-ioh.c
+++ b/drivers/gpio/gpio-ml-ioh.c
@@ -391,9 +391,10 @@ static int ioh_gpio_alloc_generic_chip(struct ioh_gpio *chip,
{
struct irq_chip_generic *gc;
struct irq_chip_type *ct;
+ int rv;
- gc = irq_alloc_generic_chip("ioh_gpio", 1, irq_start, chip->base,
- handle_simple_irq);
+ gc = devm_irq_alloc_generic_chip(chip->dev, "ioh_gpio", 1, irq_start,
+ chip->base, handle_simple_irq);
if (!gc)
return -ENOMEM;
@@ -406,10 +407,11 @@ static int ioh_gpio_alloc_generic_chip(struct ioh_gpio *chip,
ct->chip.irq_disable = ioh_irq_disable;
ct->chip.irq_enable = ioh_irq_enable;
- irq_setup_generic_chip(gc, IRQ_MSK(num), IRQ_GC_INIT_MASK_CACHE,
- IRQ_NOREQUEST | IRQ_NOPROBE, 0);
+ rv = devm_irq_setup_generic_chip(chip->dev, gc, IRQ_MSK(num),
+ IRQ_GC_INIT_MASK_CACHE,
+ IRQ_NOREQUEST | IRQ_NOPROBE, 0);
- return 0;
+ return rv;
}
static int ioh_gpio_probe(struct pci_dev *pdev,
--
2.13.2
[toc] | [prev] | [next] | [standalone]
| From | Linus Walleij <linus.walleij@linaro.org> |
|---|---|
| Date | 2017-08-02 13:40 +0200 |
| Subject | Re: [PATCH 2/6] gpio: ml-ioh: use devres for irq generic chip |
| Message-ID | <ua0al-Og-1@gated-at.bofh.it> |
| In reply to | #1701819 |
On Wed, Aug 2, 2017 at 9:51 AM, Bartosz Golaszewski <brgl@bgdev.pl> wrote: > Use resource managed variants of irq_alloc_generic_chip() and > irq_setup_generic_chip(). > > Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl> Patch applied. Yours, Linus Walleij
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web