[PATCHv2,1/2] gpio: zynq: Remove call to platform_get_irq

Message ID 1525689415-16861-1-git-send-email-shubhrajyoti.datta@gmail.com
State New
Headers show
Series
  • [PATCHv2,1/2] gpio: zynq: Remove call to platform_get_irq
Related show

Commit Message

Shubhrajyoti Datta May 7, 2018, 10:36 a.m.
From: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>

Remove the call to  platform_get_irq use the cached
one instead.

Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
---
 drivers/gpio/gpio-zynq.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Michal Simek May 10, 2018, 8:31 a.m. | #1
On 7.5.2018 12:36, shubhrajyoti.datta@gmail.com wrote:
> From: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
> 
> Remove the call to  platform_get_irq use the cached
> one instead.
> 
> Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
> ---
>  drivers/gpio/gpio-zynq.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpio/gpio-zynq.c b/drivers/gpio/gpio-zynq.c
> index 2ffa0ed..7551857 100644
> --- a/drivers/gpio/gpio-zynq.c
> +++ b/drivers/gpio/gpio-zynq.c
> @@ -677,9 +677,8 @@ static void zynq_gpio_restore_context(struct zynq_gpio *gpio)
>  static int __maybe_unused zynq_gpio_suspend(struct device *dev)
>  {
>  	struct platform_device *pdev = to_platform_device(dev);
> -	int irq = platform_get_irq(pdev, 0);
> -	struct irq_data *data = irq_get_irq_data(irq);
>  	struct zynq_gpio *gpio = platform_get_drvdata(pdev);
> +	struct irq_data *data = irq_get_irq_data(gpio->irq);
>  
>  	if (!irqd_is_wakeup_set(data)) {
>  		zynq_gpio_save_context(gpio);
> @@ -692,9 +691,8 @@ static int __maybe_unused zynq_gpio_suspend(struct device *dev)
>  static int __maybe_unused zynq_gpio_resume(struct device *dev)
>  {
>  	struct platform_device *pdev = to_platform_device(dev);
> -	int irq = platform_get_irq(pdev, 0);
> -	struct irq_data *data = irq_get_irq_data(irq);
>  	struct zynq_gpio *gpio = platform_get_drvdata(pdev);
> +	struct irq_data *data = irq_get_irq_data(gpio->irq);
>  	int ret;
>  
>  	if (!irqd_is_wakeup_set(data)) {
> 

Reviewed-by: Michal Simek <michal.simek@xilinx.com>

Thanks,
Michal
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Linus Walleij May 23, 2018, 7:56 a.m. | #2
On Mon, May 7, 2018 at 12:36 PM,  <shubhrajyoti.datta@gmail.com> wrote:

> From: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
>
> Remove the call to  platform_get_irq use the cached
> one instead.
>
> Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>

Patch applied with Michal's review tag.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/gpio/gpio-zynq.c b/drivers/gpio/gpio-zynq.c
index 2ffa0ed..7551857 100644
--- a/drivers/gpio/gpio-zynq.c
+++ b/drivers/gpio/gpio-zynq.c
@@ -677,9 +677,8 @@  static void zynq_gpio_restore_context(struct zynq_gpio *gpio)
 static int __maybe_unused zynq_gpio_suspend(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
-	int irq = platform_get_irq(pdev, 0);
-	struct irq_data *data = irq_get_irq_data(irq);
 	struct zynq_gpio *gpio = platform_get_drvdata(pdev);
+	struct irq_data *data = irq_get_irq_data(gpio->irq);
 
 	if (!irqd_is_wakeup_set(data)) {
 		zynq_gpio_save_context(gpio);
@@ -692,9 +691,8 @@  static int __maybe_unused zynq_gpio_suspend(struct device *dev)
 static int __maybe_unused zynq_gpio_resume(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
-	int irq = platform_get_irq(pdev, 0);
-	struct irq_data *data = irq_get_irq_data(irq);
 	struct zynq_gpio *gpio = platform_get_drvdata(pdev);
+	struct irq_data *data = irq_get_irq_data(gpio->irq);
 	int ret;
 
 	if (!irqd_is_wakeup_set(data)) {