All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergio Paracuellos <sergio.paracuellos@gmail.com>
To: gregkh@linuxfoundation.org
Cc: neil@brown.name, driverdev-devel@linuxdriverproject.org
Subject: [PATCH] staging: mt7621-gpio: retrieve correct pointers in interrupt related functions
Date: Sun, 20 May 2018 10:06:02 +0200	[thread overview]
Message-ID: <1526803562-8369-1-git-send-email-sergio.paracuellos@gmail.com> (raw)
In-Reply-To: <87tvr31d19.fsf@notabene.neil.brown.name>

The data passed between irq related functions and the ones which have
been retrieved where different. Also first data haven't properly
set on irq_domain_add_linear call where it was passing NULL instead.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Reviewed-by: NeilBrown <neil@brown.name>
Tested-by: NeilBrown <neil@brown.name>
---
 drivers/staging/mt7621-gpio/gpio-mt7621.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/mt7621-gpio/gpio-mt7621.c b/drivers/staging/mt7621-gpio/gpio-mt7621.c
index 650286df..077a7c2 100644
--- a/drivers/staging/mt7621-gpio/gpio-mt7621.c
+++ b/drivers/staging/mt7621-gpio/gpio-mt7621.c
@@ -201,8 +201,7 @@ mediatek_gpio_bank_probe(struct platform_device *pdev, struct device_node *bank)
 static void
 mediatek_gpio_irq_handler(struct irq_desc *desc)
 {
-	struct gpio_chip *gc = irq_desc_get_handler_data(desc);
-	struct mtk_data *gpio_data = gpiochip_get_data(gc);
+	struct mtk_data *gpio_data = irq_desc_get_handler_data(desc);
 	int i;
 
 	for (i = 0; i < MTK_MAX_BANK; i++) {
@@ -228,8 +227,7 @@ mediatek_gpio_irq_handler(struct irq_desc *desc)
 static void
 mediatek_gpio_irq_unmask(struct irq_data *d)
 {
-	struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
-	struct mtk_data *gpio_data = gpiochip_get_data(gc);
+	struct mtk_data *gpio_data = irq_data_get_irq_chip_data(d);
 	int pin = d->hwirq;
 	int bank = pin / 32;
 	struct mtk_gc *rg = gpio_data->gc_map[bank];
@@ -251,8 +249,7 @@ mediatek_gpio_irq_unmask(struct irq_data *d)
 static void
 mediatek_gpio_irq_mask(struct irq_data *d)
 {
-	struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
-	struct mtk_data *gpio_data = gpiochip_get_data(gc);
+	struct mtk_data *gpio_data = irq_data_get_irq_chip_data(d);
 	int pin = d->hwirq;
 	int bank = pin / 32;
 	struct mtk_gc *rg = gpio_data->gc_map[bank];
@@ -274,8 +271,7 @@ mediatek_gpio_irq_mask(struct irq_data *d)
 static int
 mediatek_gpio_irq_type(struct irq_data *d, unsigned int type)
 {
-	struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
-	struct mtk_data *gpio_data = gpiochip_get_data(gc);
+	struct mtk_data *gpio_data = irq_data_get_irq_chip_data(d);
 	int pin = d->hwirq;
 	int bank = pin / 32;
 	struct mtk_gc *rg = gpio_data->gc_map[bank];
@@ -352,7 +348,7 @@ mediatek_gpio_probe(struct platform_device *pdev)
 	if (gpio_data->gpio_irq) {
 		gpio_data->gpio_irq_domain = irq_domain_add_linear(np,
 			MTK_MAX_BANK * MTK_BANK_WIDTH,
-			&irq_domain_ops, NULL);
+			&irq_domain_ops, gpio_data);
 		if (!gpio_data->gpio_irq_domain)
 			dev_err(&pdev->dev, "irq_domain_add_linear failed\n");
 	}
-- 
2.7.4

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

  parent reply	other threads:[~2018-05-20  8:06 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-16  9:11 [PATCH v3 00/11] staging: mt7621-gpio: use mediatek as binding instead of custom mtk Sergio Paracuellos
2018-05-16  9:11 ` [PATCH v3 01/11] staging: mt7621-gpio: dt-bindings: add documentation for mt7621-gpio Sergio Paracuellos
2018-05-16  9:11 ` [PATCH v3 02/11] staging: mt7621-gpio: update TODO file Sergio Paracuellos
2018-05-16  9:11 ` [PATCH v3 03/11] staging: mt7621-dts: update gpios related entries to use 'mediatek' Sergio Paracuellos
2018-05-16  9:11 ` [PATCH v3 04/11] staging: mt7621-gpio: replace 'mtk' to use correct one 'mediatek' Sergio Paracuellos
2018-05-16  9:11 ` [PATCH v3 05/11] staging: mt7621-gpio: avoid use of globals and use platform_data instead Sergio Paracuellos
2018-05-19 10:51   ` NeilBrown
2018-05-19 11:18     ` Sergio Paracuellos
2018-05-19 22:44       ` NeilBrown
2018-05-20  8:02         ` Sergio Paracuellos
2018-05-20  8:06         ` Sergio Paracuellos [this message]
2018-05-20  9:53           ` [PATCH] staging: mt7621-gpio: retrieve correct pointers in interrupt related functions NeilBrown
2018-05-20 10:18             ` Sergio Paracuellos
2018-05-20 11:21               ` NeilBrown
2018-05-20 14:20                 ` Sergio Paracuellos
2018-05-20 12:38               ` Greg KH
2018-05-20 12:39                 ` Greg KH
2018-05-20 13:01                   ` Sergio Paracuellos
2018-05-20 11:02             ` [PATCH v5 00/10] staging: mt7621-gpio: use mediatek as binding instead of custom mtk Sergio Paracuellos
2018-05-20 11:02               ` [PATCH v5 01/10] staging: mt7621-gpio: dt-bindings: add documentation for mt7621-gpio Sergio Paracuellos
2018-05-20 11:02               ` [PATCH v5 02/10] staging: mt7621-dts: update gpios related entries to use 'mediatek' Sergio Paracuellos
2018-05-20 11:02               ` [PATCH v5 03/10] staging: mt7621-gpio: replace 'mtk' to use correct one 'mediatek' Sergio Paracuellos
2018-05-20 11:02               ` [PATCH v5 04/10] staging: mt7621-gpio: avoid use of globals and use platform_data instead Sergio Paracuellos
2018-05-20 11:02               ` [PATCH v5 05/10] staging: mt7621-dts: add interrupt device tree nodes for the gpio controller Sergio Paracuellos
2018-05-20 11:02               ` [PATCH v5 06/10] staging: mt7621-gpio: dt-bindings: add interrupt nodes to bindings doc Sergio Paracuellos
2018-05-20 11:02               ` [PATCH v5 07/10] staging: mt7621-gpio: avoid devm_kzalloc() hidden inside declarations and refactor function a bit Sergio Paracuellos
2018-05-20 11:02               ` [PATCH v5 08/10] staging: mt7621-gpio: use ternary operator in return in mediatek_gpio_get_direction Sergio Paracuellos
2018-05-20 11:02               ` [PATCH v5 09/10] staging: mt7621-gpio: use MTK_BANK_WIDTH instead of magic number Sergio Paracuellos
2018-05-20 11:03               ` [PATCH v5 10/10] staging: mt7621-gpio: update TODO file Sergio Paracuellos
2018-05-16  9:11 ` [PATCH v3 06/11] staging: mt7621-dts: add interrupt device tree nodes for the gpio controller Sergio Paracuellos
2018-05-16  9:11 ` [PATCH v3 07/11] staging: mt7621-gpio: dt-bindings: add interrupt nodes to bindings doc Sergio Paracuellos
2018-05-16  9:11 ` [PATCH v3 08/11] staging: mt7621-gpio: avoid devm_kzalloc() hidden inside declarations and refactor function a bit Sergio Paracuellos
2018-05-16  9:11 ` [PATCH v3 09/11] staging: mt7621-gpio: use ternary operator in return in mediatek_gpio_get_direction Sergio Paracuellos
2018-05-16  9:11 ` [PATCH v3 10/11] staging: mt7621-gpio: use MTK_BANK_WIDTH instead of magic number Sergio Paracuellos
2018-05-16  9:11 ` [PATCH v3 11/11] staging: mt7621-gpio: update TODO list Sergio Paracuellos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1526803562-8369-1-git-send-email-sergio.paracuellos@gmail.com \
    --to=sergio.paracuellos@gmail.com \
    --cc=driverdev-devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=neil@brown.name \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.