diff mbox series

[v1,1/3] gpio: pca953x: Request IRQ after all initialisation done

Message ID 20200728125504.27786-1-andriy.shevchenko@linux.intel.com
State New
Headers show
Series [v1,1/3] gpio: pca953x: Request IRQ after all initialisation done | expand

Commit Message

Andy Shevchenko July 28, 2020, 12:55 p.m. UTC
There is logically better to request IRQ when we initialise all structures.
Align the driver with the rest on the same matter.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpio/gpio-pca953x.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

Comments

Linus Walleij Aug. 3, 2020, 11:26 p.m. UTC | #1
On Tue, Jul 28, 2020 at 2:55 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:

> There is logically better to request IRQ when we initialise all structures.
> Align the driver with the rest on the same matter.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

I just applied these three (despite 2 & 3 hitting Intel drivers) since
we are in the
merge window and it needs to be in good shape for the merge.

Thanks!
Linus Walleij
Andy Shevchenko Aug. 4, 2020, 9:12 a.m. UTC | #2
On Tue, Aug 04, 2020 at 01:26:12AM +0200, Linus Walleij wrote:
> On Tue, Jul 28, 2020 at 2:55 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> 
> > There is logically better to request IRQ when we initialise all structures.
> > Align the driver with the rest on the same matter.

> I just applied these three
> (despite 2 & 3 hitting Intel drivers) since
> we are in the
> merge window and it needs to be in good shape for the merge.

That's exactly my understanding how it has to be proceeded.
Thanks!
diff mbox series

Patch

diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index ab22152bf3e8..bd2e96c34f82 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -865,17 +865,7 @@  static int pca953x_irq_setup(struct pca953x_chip *chip, int irq_base)
 	bitmap_and(chip->irq_stat, irq_stat, reg_direction, chip->gpio_chip.ngpio);
 	mutex_init(&chip->irq_lock);
 
-	ret = devm_request_threaded_irq(&client->dev, client->irq,
-					NULL, pca953x_irq_handler,
-					IRQF_ONESHOT | IRQF_SHARED,
-					dev_name(&client->dev), chip);
-	if (ret) {
-		dev_err(&client->dev, "failed to request irq %d\n",
-			client->irq);
-		return ret;
-	}
-
-	irq_chip->name = dev_name(&chip->client->dev);
+	irq_chip->name = dev_name(&client->dev);
 	irq_chip->irq_mask = pca953x_irq_mask;
 	irq_chip->irq_unmask = pca953x_irq_unmask;
 	irq_chip->irq_set_wake = pca953x_irq_set_wake;
@@ -895,6 +885,16 @@  static int pca953x_irq_setup(struct pca953x_chip *chip, int irq_base)
 	girq->threaded = true;
 	girq->first = irq_base; /* FIXME: get rid of this */
 
+	ret = devm_request_threaded_irq(&client->dev, client->irq,
+					NULL, pca953x_irq_handler,
+					IRQF_ONESHOT | IRQF_SHARED,
+					dev_name(&client->dev), chip);
+	if (ret) {
+		dev_err(&client->dev, "failed to request irq %d\n",
+			client->irq);
+		return ret;
+	}
+
 	return 0;
 }