linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/3] gpio: xgene-sb: Drop redundant OF_GPIO dependency
@ 2020-05-12 18:27 Andy Shevchenko
  2020-05-12 18:27 ` [PATCH v1 2/3] gpio: xgene-sb: Allow driver to be built with COMPILE_TEST Andy Shevchenko
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Andy Shevchenko @ 2020-05-12 18:27 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, linux-gpio; +Cc: Andy Shevchenko

There is nothing in the driver requires OF_GPIO. Moreover, driver
supports ACPI and OF_GPIO may be a quite overhead on such configurations.

Drop dependency for good and replace of_gpio.h to of.h since we have
one function to be defined from there.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpio/Kconfig         | 2 +-
 drivers/gpio/gpio-xgene-sb.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index 8ef2179fb9991b..739f179e28b184 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -638,7 +638,7 @@ config GPIO_XGENE
 
 config GPIO_XGENE_SB
 	tristate "APM X-Gene GPIO standby controller support"
-	depends on ARCH_XGENE && OF_GPIO
+	depends on ARCH_XGENE
 	select GPIO_GENERIC
 	select GPIOLIB_IRQCHIP
 	select IRQ_DOMAIN_HIERARCHY
diff --git a/drivers/gpio/gpio-xgene-sb.c b/drivers/gpio/gpio-xgene-sb.c
index b45bfa9baa26c5..203a268dd09c52 100644
--- a/drivers/gpio/gpio-xgene-sb.c
+++ b/drivers/gpio/gpio-xgene-sb.c
@@ -10,8 +10,8 @@
 
 #include <linux/module.h>
 #include <linux/io.h>
+#include <linux/of.h>
 #include <linux/platform_device.h>
-#include <linux/of_gpio.h>
 #include <linux/gpio/driver.h>
 #include <linux/acpi.h>
 
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v1 2/3] gpio: xgene-sb: Allow driver to be built with COMPILE_TEST
  2020-05-12 18:27 [PATCH v1 1/3] gpio: xgene-sb: Drop redundant OF_GPIO dependency Andy Shevchenko
@ 2020-05-12 18:27 ` Andy Shevchenko
  2020-05-18  7:17   ` Linus Walleij
  2020-05-12 18:27 ` [PATCH v1 3/3] gpio: xgene-sb: Drop extra check to call acpi_gpiochip_request_interrupts() Andy Shevchenko
  2020-05-18  7:17 ` [PATCH v1 1/3] gpio: xgene-sb: Drop redundant OF_GPIO dependency Linus Walleij
  2 siblings, 1 reply; 6+ messages in thread
From: Andy Shevchenko @ 2020-05-12 18:27 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, linux-gpio; +Cc: Andy Shevchenko

Allow driver to be built with COMPILE_TEST for better test coverage.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpio/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index 739f179e28b184..8fc7893fba2b94 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -638,7 +638,7 @@ config GPIO_XGENE
 
 config GPIO_XGENE_SB
 	tristate "APM X-Gene GPIO standby controller support"
-	depends on ARCH_XGENE
+	depends on (ARCH_XGENE || COMPILE_TEST)
 	select GPIO_GENERIC
 	select GPIOLIB_IRQCHIP
 	select IRQ_DOMAIN_HIERARCHY
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v1 3/3] gpio: xgene-sb: Drop extra check to call acpi_gpiochip_request_interrupts()
  2020-05-12 18:27 [PATCH v1 1/3] gpio: xgene-sb: Drop redundant OF_GPIO dependency Andy Shevchenko
  2020-05-12 18:27 ` [PATCH v1 2/3] gpio: xgene-sb: Allow driver to be built with COMPILE_TEST Andy Shevchenko
@ 2020-05-12 18:27 ` Andy Shevchenko
  2020-05-18  7:18   ` Linus Walleij
  2020-05-18  7:17 ` [PATCH v1 1/3] gpio: xgene-sb: Drop redundant OF_GPIO dependency Linus Walleij
  2 siblings, 1 reply; 6+ messages in thread
From: Andy Shevchenko @ 2020-05-12 18:27 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, linux-gpio; +Cc: Andy Shevchenko

There is no need to have an additional check to call
acpi_gpiochip_request_interrupts(). Even without any interrupts available
the registered ACPI Event handlers can be useful for debugging purposes.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpio/gpio-xgene-sb.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/gpio/gpio-xgene-sb.c b/drivers/gpio/gpio-xgene-sb.c
index 203a268dd09c52..a809609ee9570d 100644
--- a/drivers/gpio/gpio-xgene-sb.c
+++ b/drivers/gpio/gpio-xgene-sb.c
@@ -290,10 +290,8 @@ static int xgene_gpio_sb_probe(struct platform_device *pdev)
 
 	dev_info(&pdev->dev, "X-Gene GPIO Standby driver registered\n");
 
-	if (priv->nirq > 0) {
-		/* Register interrupt handlers for gpio signaled acpi events */
-		acpi_gpiochip_request_interrupts(&priv->gc);
-	}
+	/* Register interrupt handlers for GPIO signaled ACPI Events */
+	acpi_gpiochip_request_interrupts(&priv->gc);
 
 	return ret;
 }
@@ -302,9 +300,7 @@ static int xgene_gpio_sb_remove(struct platform_device *pdev)
 {
 	struct xgene_gpio_sb *priv = platform_get_drvdata(pdev);
 
-	if (priv->nirq > 0) {
-		acpi_gpiochip_free_interrupts(&priv->gc);
-	}
+	acpi_gpiochip_free_interrupts(&priv->gc);
 
 	irq_domain_remove(priv->irq_domain);
 
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v1 1/3] gpio: xgene-sb: Drop redundant OF_GPIO dependency
  2020-05-12 18:27 [PATCH v1 1/3] gpio: xgene-sb: Drop redundant OF_GPIO dependency Andy Shevchenko
  2020-05-12 18:27 ` [PATCH v1 2/3] gpio: xgene-sb: Allow driver to be built with COMPILE_TEST Andy Shevchenko
  2020-05-12 18:27 ` [PATCH v1 3/3] gpio: xgene-sb: Drop extra check to call acpi_gpiochip_request_interrupts() Andy Shevchenko
@ 2020-05-18  7:17 ` Linus Walleij
  2 siblings, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2020-05-18  7:17 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: Bartosz Golaszewski, open list:GPIO SUBSYSTEM

On Tue, May 12, 2020 at 8:27 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:

> There is nothing in the driver requires OF_GPIO. Moreover, driver
> supports ACPI and OF_GPIO may be a quite overhead on such configurations.
>
> Drop dependency for good and replace of_gpio.h to of.h since we have
> one function to be defined from there.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Patch applied.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v1 2/3] gpio: xgene-sb: Allow driver to be built with COMPILE_TEST
  2020-05-12 18:27 ` [PATCH v1 2/3] gpio: xgene-sb: Allow driver to be built with COMPILE_TEST Andy Shevchenko
@ 2020-05-18  7:17   ` Linus Walleij
  0 siblings, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2020-05-18  7:17 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: Bartosz Golaszewski, open list:GPIO SUBSYSTEM

On Tue, May 12, 2020 at 8:27 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:

> Allow driver to be built with COMPILE_TEST for better test coverage.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Patch applied.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v1 3/3] gpio: xgene-sb: Drop extra check to call acpi_gpiochip_request_interrupts()
  2020-05-12 18:27 ` [PATCH v1 3/3] gpio: xgene-sb: Drop extra check to call acpi_gpiochip_request_interrupts() Andy Shevchenko
@ 2020-05-18  7:18   ` Linus Walleij
  0 siblings, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2020-05-18  7:18 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: Bartosz Golaszewski, open list:GPIO SUBSYSTEM

On Tue, May 12, 2020 at 8:27 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:

> There is no need to have an additional check to call
> acpi_gpiochip_request_interrupts(). Even without any interrupts available
> the registered ACPI Event handlers can be useful for debugging purposes.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Patch applied.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-05-18  7:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-12 18:27 [PATCH v1 1/3] gpio: xgene-sb: Drop redundant OF_GPIO dependency Andy Shevchenko
2020-05-12 18:27 ` [PATCH v1 2/3] gpio: xgene-sb: Allow driver to be built with COMPILE_TEST Andy Shevchenko
2020-05-18  7:17   ` Linus Walleij
2020-05-12 18:27 ` [PATCH v1 3/3] gpio: xgene-sb: Drop extra check to call acpi_gpiochip_request_interrupts() Andy Shevchenko
2020-05-18  7:18   ` Linus Walleij
2020-05-18  7:17 ` [PATCH v1 1/3] gpio: xgene-sb: Drop redundant OF_GPIO dependency Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).