All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] gpio: altera: use of_mm_gpiochip_remove() to fix memory leak
@ 2015-06-17 11:59 Masahiro Yamada
  2015-06-17 11:59 ` [PATCH 2/2] gpio: altera: fix return value of altera_gpio_remove() Masahiro Yamada
                   ` (3 more replies)
  0 siblings, 4 replies; 17+ messages in thread
From: Masahiro Yamada @ 2015-06-17 11:59 UTC (permalink / raw)
  To: linux-gpio
  Cc: Masahiro Yamada, Linus Walleij, Alexandre Courbot, linux-kernel,
	Tien Hock Loh

This driver calls of_mm_gpiochip_add() to add a memory mapped gpio
chip.  So, of_mm_gpiochip_remove() should be used when removing it.

The direct call of gpiochip_remove() misses unmapping the register
and freeing the label.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 drivers/gpio/gpio-altera.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-altera.c b/drivers/gpio/gpio-altera.c
index 449fb46..c653c83 100644
--- a/drivers/gpio/gpio-altera.c
+++ b/drivers/gpio/gpio-altera.c
@@ -337,7 +337,7 @@ static int altera_gpio_remove(struct platform_device *pdev)
 {
 	struct altera_gpio_chip *altera_gc = platform_get_drvdata(pdev);
 
-	gpiochip_remove(&altera_gc->mmchip.gc);
+	of_mm_gpiochip_remove(&altera_gc->mmchip);
 
 	return -EIO;
 }
-- 
1.9.1

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

* [PATCH 2/2] gpio: altera: fix return value of altera_gpio_remove()
  2015-06-17 11:59 [PATCH 1/2] gpio: altera: use of_mm_gpiochip_remove() to fix memory leak Masahiro Yamada
@ 2015-06-17 11:59 ` Masahiro Yamada
  2015-06-21  7:25     ` Alexandre Courbot
  2015-06-26  3:16     ` Tien Hock Loh
  2015-06-21  7:22   ` Alexandre Courbot
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 17+ messages in thread
From: Masahiro Yamada @ 2015-06-17 11:59 UTC (permalink / raw)
  To: linux-gpio
  Cc: Masahiro Yamada, Linus Walleij, Alexandre Courbot, linux-kernel,
	Tien Hock Loh

The remove callback never succeeds, which seems odd.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

I wonder why nobody has pointed this out before me.
I am suspecting -EIO might be intentional.
I hope some Altera guys will give me comments.


 drivers/gpio/gpio-altera.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-altera.c b/drivers/gpio/gpio-altera.c
index c653c83..5861550 100644
--- a/drivers/gpio/gpio-altera.c
+++ b/drivers/gpio/gpio-altera.c
@@ -339,7 +339,7 @@ static int altera_gpio_remove(struct platform_device *pdev)
 
 	of_mm_gpiochip_remove(&altera_gc->mmchip);
 
-	return -EIO;
+	return 0;
 }
 
 static const struct of_device_id altera_gpio_of_match[] = {
-- 
1.9.1


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

* Re: [PATCH 1/2] gpio: altera: use of_mm_gpiochip_remove() to fix memory leak
  2015-06-17 11:59 [PATCH 1/2] gpio: altera: use of_mm_gpiochip_remove() to fix memory leak Masahiro Yamada
@ 2015-06-21  7:22   ` Alexandre Courbot
  2015-06-21  7:22   ` Alexandre Courbot
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 17+ messages in thread
From: Alexandre Courbot @ 2015-06-21  7:22 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: linux-gpio, Linus Walleij, Linux Kernel Mailing List, Tien Hock Loh

On Wed, Jun 17, 2015 at 8:59 PM, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
> This driver calls of_mm_gpiochip_add() to add a memory mapped gpio
> chip.  So, of_mm_gpiochip_remove() should be used when removing it.
>
> The direct call of gpiochip_remove() misses unmapping the register
> and freeing the label.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in

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

* Re: [PATCH 1/2] gpio: altera: use of_mm_gpiochip_remove() to fix memory leak
@ 2015-06-21  7:22   ` Alexandre Courbot
  0 siblings, 0 replies; 17+ messages in thread
From: Alexandre Courbot @ 2015-06-21  7:22 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: linux-gpio, Linus Walleij, Linux Kernel Mailing List, Tien Hock Loh

On Wed, Jun 17, 2015 at 8:59 PM, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
> This driver calls of_mm_gpiochip_add() to add a memory mapped gpio
> chip.  So, of_mm_gpiochip_remove() should be used when removing it.
>
> The direct call of gpiochip_remove() misses unmapping the register
> and freeing the label.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/

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

* Re: [PATCH 2/2] gpio: altera: fix return value of altera_gpio_remove()
  2015-06-17 11:59 ` [PATCH 2/2] gpio: altera: fix return value of altera_gpio_remove() Masahiro Yamada
@ 2015-06-21  7:25     ` Alexandre Courbot
  2015-06-26  3:16     ` Tien Hock Loh
  1 sibling, 0 replies; 17+ messages in thread
From: Alexandre Courbot @ 2015-06-21  7:25 UTC (permalink / raw)
  To: Masahiro Yamada, Tien Hock Loh
  Cc: linux-gpio, Linus Walleij, Linux Kernel Mailing List

On Wed, Jun 17, 2015 at 8:59 PM, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
> The remove callback never succeeds, which seems odd.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
>
> I wonder why nobody has pointed this out before me.
> I am suspecting -EIO might be intentional.
> I hope some Altera guys will give me comments.
>
>
>  drivers/gpio/gpio-altera.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpio-altera.c b/drivers/gpio/gpio-altera.c
> index c653c83..5861550 100644
> --- a/drivers/gpio/gpio-altera.c
> +++ b/drivers/gpio/gpio-altera.c
> @@ -339,7 +339,7 @@ static int altera_gpio_remove(struct platform_device *pdev)
>
>         of_mm_gpiochip_remove(&altera_gc->mmchip);
>
> -       return -EIO;
> +       return 0;

That looks weird indeed. Tien, can you comment on this?
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in

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

* Re: [PATCH 2/2] gpio: altera: fix return value of altera_gpio_remove()
@ 2015-06-21  7:25     ` Alexandre Courbot
  0 siblings, 0 replies; 17+ messages in thread
From: Alexandre Courbot @ 2015-06-21  7:25 UTC (permalink / raw)
  To: Masahiro Yamada, Tien Hock Loh
  Cc: linux-gpio, Linus Walleij, Linux Kernel Mailing List

On Wed, Jun 17, 2015 at 8:59 PM, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
> The remove callback never succeeds, which seems odd.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
>
> I wonder why nobody has pointed this out before me.
> I am suspecting -EIO might be intentional.
> I hope some Altera guys will give me comments.
>
>
>  drivers/gpio/gpio-altera.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpio-altera.c b/drivers/gpio/gpio-altera.c
> index c653c83..5861550 100644
> --- a/drivers/gpio/gpio-altera.c
> +++ b/drivers/gpio/gpio-altera.c
> @@ -339,7 +339,7 @@ static int altera_gpio_remove(struct platform_device *pdev)
>
>         of_mm_gpiochip_remove(&altera_gc->mmchip);
>
> -       return -EIO;
> +       return 0;

That looks weird indeed. Tien, can you comment on this?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/

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

* Re: [PATCH 2/2] gpio: altera: fix return value of altera_gpio_remove()
  2015-06-21  7:25     ` Alexandre Courbot
@ 2015-06-22  1:36       ` Tien Hock Loh
  -1 siblings, 0 replies; 17+ messages in thread
From: Tien Hock Loh @ 2015-06-22  1:36 UTC (permalink / raw)
  To: Alexandre Courbot
  Cc: Masahiro Yamada, linux-gpio, Linus Walleij, Linux Kernel Mailing List

Sorry I was away from my mail for the past few weeks. 
This isn't intentional, should be a bug I overlook. The fix is correct.

On Sun, 2015-06-21 at 16:25 +0900, Alexandre Courbot wrote:
> On Wed, Jun 17, 2015 at 8:59 PM, Masahiro Yamada
> <yamada.masahiro@socionext.com> wrote:
> > The remove callback never succeeds, which seems odd.
> >
> > Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> > ---
> >
> > I wonder why nobody has pointed this out before me.
> > I am suspecting -EIO might be intentional.
> > I hope some Altera guys will give me comments.
> >
> >
> >  drivers/gpio/gpio-altera.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpio/gpio-altera.c b/drivers/gpio/gpio-altera.c
> > index c653c83..5861550 100644
> > --- a/drivers/gpio/gpio-altera.c
> > +++ b/drivers/gpio/gpio-altera.c
> > @@ -339,7 +339,7 @@ static int altera_gpio_remove(struct platform_device *pdev)
> >
> >         of_mm_gpiochip_remove(&altera_gc->mmchip);
> >
> > -       return -EIO;
> > +       return 0;
> 
> That looks weird indeed. Tien, can you comment on this?

--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in

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

* Re: [PATCH 2/2] gpio: altera: fix return value of altera_gpio_remove()
@ 2015-06-22  1:36       ` Tien Hock Loh
  0 siblings, 0 replies; 17+ messages in thread
From: Tien Hock Loh @ 2015-06-22  1:36 UTC (permalink / raw)
  To: Alexandre Courbot
  Cc: Masahiro Yamada, linux-gpio, Linus Walleij, Linux Kernel Mailing List

Sorry I was away from my mail for the past few weeks. 
This isn't intentional, should be a bug I overlook. The fix is correct.

On Sun, 2015-06-21 at 16:25 +0900, Alexandre Courbot wrote:
> On Wed, Jun 17, 2015 at 8:59 PM, Masahiro Yamada
> <yamada.masahiro@socionext.com> wrote:
> > The remove callback never succeeds, which seems odd.
> >
> > Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> > ---
> >
> > I wonder why nobody has pointed this out before me.
> > I am suspecting -EIO might be intentional.
> > I hope some Altera guys will give me comments.
> >
> >
> >  drivers/gpio/gpio-altera.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpio/gpio-altera.c b/drivers/gpio/gpio-altera.c
> > index c653c83..5861550 100644
> > --- a/drivers/gpio/gpio-altera.c
> > +++ b/drivers/gpio/gpio-altera.c
> > @@ -339,7 +339,7 @@ static int altera_gpio_remove(struct platform_device *pdev)
> >
> >         of_mm_gpiochip_remove(&altera_gc->mmchip);
> >
> > -       return -EIO;
> > +       return 0;
> 
> That looks weird indeed. Tien, can you comment on this?

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/

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

* Re: [PATCH 2/2] gpio: altera: fix return value of altera_gpio_remove()
  2015-06-22  1:36       ` Tien Hock Loh
@ 2015-06-22  2:25         ` Alexandre Courbot
  -1 siblings, 0 replies; 17+ messages in thread
From: Alexandre Courbot @ 2015-06-22  2:25 UTC (permalink / raw)
  To: Tien Hock Loh
  Cc: Masahiro Yamada, linux-gpio, Linus Walleij, Linux Kernel Mailing List

On Mon, Jun 22, 2015 at 10:36 AM, Tien Hock Loh <thloh@altera.com> wrote:
> Sorry I was away from my mail for the past few weeks.
> This isn't intentional, should be a bug I overlook. The fix is correct.

Interestingly that has never been caught by reviewers despite 10
respins of your series!

Thanks for confirming.

Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>

>
> On Sun, 2015-06-21 at 16:25 +0900, Alexandre Courbot wrote:
>> On Wed, Jun 17, 2015 at 8:59 PM, Masahiro Yamada
>> <yamada.masahiro@socionext.com> wrote:
>> > The remove callback never succeeds, which seems odd.
>> >
>> > Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
>> > ---
>> >
>> > I wonder why nobody has pointed this out before me.
>> > I am suspecting -EIO might be intentional.
>> > I hope some Altera guys will give me comments.
>> >
>> >
>> >  drivers/gpio/gpio-altera.c | 2 +-
>> >  1 file changed, 1 insertion(+), 1 deletion(-)
>> >
>> > diff --git a/drivers/gpio/gpio-altera.c b/drivers/gpio/gpio-altera.c
>> > index c653c83..5861550 100644
>> > --- a/drivers/gpio/gpio-altera.c
>> > +++ b/drivers/gpio/gpio-altera.c
>> > @@ -339,7 +339,7 @@ static int altera_gpio_remove(struct platform_device *pdev)
>> >
>> >         of_mm_gpiochip_remove(&altera_gc->mmchip);
>> >
>> > -       return -EIO;
>> > +       return 0;
>>
>> That looks weird indeed. Tien, can you comment on this?
>

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

* Re: [PATCH 2/2] gpio: altera: fix return value of altera_gpio_remove()
@ 2015-06-22  2:25         ` Alexandre Courbot
  0 siblings, 0 replies; 17+ messages in thread
From: Alexandre Courbot @ 2015-06-22  2:25 UTC (permalink / raw)
  To: Tien Hock Loh
  Cc: Masahiro Yamada, linux-gpio, Linus Walleij, Linux Kernel Mailing List

On Mon, Jun 22, 2015 at 10:36 AM, Tien Hock Loh <thloh@altera.com> wrote:
> Sorry I was away from my mail for the past few weeks.
> This isn't intentional, should be a bug I overlook. The fix is correct.

Interestingly that has never been caught by reviewers despite 10
respins of your series!

Thanks for confirming.

Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>

>
> On Sun, 2015-06-21 at 16:25 +0900, Alexandre Courbot wrote:
>> On Wed, Jun 17, 2015 at 8:59 PM, Masahiro Yamada
>> <yamada.masahiro@socionext.com> wrote:
>> > The remove callback never succeeds, which seems odd.
>> >
>> > Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
>> > ---
>> >
>> > I wonder why nobody has pointed this out before me.
>> > I am suspecting -EIO might be intentional.
>> > I hope some Altera guys will give me comments.
>> >
>> >
>> >  drivers/gpio/gpio-altera.c | 2 +-
>> >  1 file changed, 1 insertion(+), 1 deletion(-)
>> >
>> > diff --git a/drivers/gpio/gpio-altera.c b/drivers/gpio/gpio-altera.c
>> > index c653c83..5861550 100644
>> > --- a/drivers/gpio/gpio-altera.c
>> > +++ b/drivers/gpio/gpio-altera.c
>> > @@ -339,7 +339,7 @@ static int altera_gpio_remove(struct platform_device *pdev)
>> >
>> >         of_mm_gpiochip_remove(&altera_gc->mmchip);
>> >
>> > -       return -EIO;
>> > +       return 0;
>>
>> That looks weird indeed. Tien, can you comment on this?
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/

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

* Re: [PATCH 2/2] gpio: altera: fix return value of altera_gpio_remove()
  2015-06-22  1:36       ` Tien Hock Loh
@ 2015-06-22 10:04         ` Masahiro Yamada
  -1 siblings, 0 replies; 17+ messages in thread
From: Masahiro Yamada @ 2015-06-22 10:04 UTC (permalink / raw)
  To: Tien Hock Loh
  Cc: Alexandre Courbot, linux-gpio, Linus Walleij, Linux Kernel Mailing List

Hi Tien,


2015-06-22 10:36 GMT+09:00 Tien Hock Loh <thloh@altera.com>:
> Sorry I was away from my mail for the past few weeks.
> This isn't intentional, should be a bug I overlook. The fix is correct.
>

OK, then could you issue your Acked-by credit?


Also, do the followings look good?

http://patchwork.ozlabs.org/patch/485370/
http://patchwork.ozlabs.org/patch/486669/

Thanks.

-- 
Best Regards
Masahiro Yamada
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in

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

* Re: [PATCH 2/2] gpio: altera: fix return value of altera_gpio_remove()
@ 2015-06-22 10:04         ` Masahiro Yamada
  0 siblings, 0 replies; 17+ messages in thread
From: Masahiro Yamada @ 2015-06-22 10:04 UTC (permalink / raw)
  To: Tien Hock Loh
  Cc: Alexandre Courbot, linux-gpio, Linus Walleij, Linux Kernel Mailing List

Hi Tien,


2015-06-22 10:36 GMT+09:00 Tien Hock Loh <thloh@altera.com>:
> Sorry I was away from my mail for the past few weeks.
> This isn't intentional, should be a bug I overlook. The fix is correct.
>

OK, then could you issue your Acked-by credit?


Also, do the followings look good?

http://patchwork.ozlabs.org/patch/485370/
http://patchwork.ozlabs.org/patch/486669/

Thanks.

-- 
Best Regards
Masahiro Yamada
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/

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

* Re: [PATCH 2/2] gpio: altera: fix return value of altera_gpio_remove()
  2015-06-17 11:59 ` [PATCH 2/2] gpio: altera: fix return value of altera_gpio_remove() Masahiro Yamada
@ 2015-06-26  3:16     ` Tien Hock Loh
  2015-06-26  3:16     ` Tien Hock Loh
  1 sibling, 0 replies; 17+ messages in thread
From: Tien Hock Loh @ 2015-06-26  3:16 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: thloh.linux, linux-gpio, Linus Walleij, Alexandre Courbot, linux-kernel

Acked-by: Tien Hock Loh <thloh@altera.com>

On Wed, 2015-06-17 at 20:59 +0900, Masahiro Yamada wrote:
> The remove callback never succeeds, which seems odd.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
> 
> I wonder why nobody has pointed this out before me.
> I am suspecting -EIO might be intentional.
> I hope some Altera guys will give me comments.
> 
> 
>  drivers/gpio/gpio-altera.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpio/gpio-altera.c b/drivers/gpio/gpio-altera.c
> index c653c83..5861550 100644
> --- a/drivers/gpio/gpio-altera.c
> +++ b/drivers/gpio/gpio-altera.c
> @@ -339,7 +339,7 @@ static int altera_gpio_remove(struct platform_device *pdev)
>  
>  	of_mm_gpiochip_remove(&altera_gc->mmchip);
>  
> -	return -EIO;
> +	return 0;
>  }
>  
>  static const struct of_device_id altera_gpio_of_match[] = {


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

* Re: [PATCH 2/2] gpio: altera: fix return value of altera_gpio_remove()
@ 2015-06-26  3:16     ` Tien Hock Loh
  0 siblings, 0 replies; 17+ messages in thread
From: Tien Hock Loh @ 2015-06-26  3:16 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: thloh.linux, linux-gpio, Linus Walleij, Alexandre Courbot, linux-kernel

Acked-by: Tien Hock Loh <thloh@altera.com>

On Wed, 2015-06-17 at 20:59 +0900, Masahiro Yamada wrote:
> The remove callback never succeeds, which seems odd.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
> 
> I wonder why nobody has pointed this out before me.
> I am suspecting -EIO might be intentional.
> I hope some Altera guys will give me comments.
> 
> 
>  drivers/gpio/gpio-altera.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpio/gpio-altera.c b/drivers/gpio/gpio-altera.c
> index c653c83..5861550 100644
> --- a/drivers/gpio/gpio-altera.c
> +++ b/drivers/gpio/gpio-altera.c
> @@ -339,7 +339,7 @@ static int altera_gpio_remove(struct platform_device *pdev)
>  
>  	of_mm_gpiochip_remove(&altera_gc->mmchip);
>  
> -	return -EIO;
> +	return 0;
>  }
>  
>  static const struct of_device_id altera_gpio_of_match[] = {


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

* Re: [PATCH 1/2] gpio: altera: use of_mm_gpiochip_remove() to fix memory leak
  2015-06-17 11:59 [PATCH 1/2] gpio: altera: use of_mm_gpiochip_remove() to fix memory leak Masahiro Yamada
@ 2015-06-26  3:17   ` Tien Hock Loh
  2015-06-21  7:22   ` Alexandre Courbot
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 17+ messages in thread
From: Tien Hock Loh @ 2015-06-26  3:17 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: linux-gpio, Linus Walleij, Alexandre Courbot, linux-kernel

Acked-by: Tien Hock Loh <thloh@altera.com>

On Wed, 2015-06-17 at 20:59 +0900, Masahiro Yamada wrote:
> This driver calls of_mm_gpiochip_add() to add a memory mapped gpio
> chip.  So, of_mm_gpiochip_remove() should be used when removing it.
> 
> The direct call of gpiochip_remove() misses unmapping the register
> and freeing the label.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
> 
>  drivers/gpio/gpio-altera.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpio/gpio-altera.c b/drivers/gpio/gpio-altera.c
> index 449fb46..c653c83 100644
> --- a/drivers/gpio/gpio-altera.c
> +++ b/drivers/gpio/gpio-altera.c
> @@ -337,7 +337,7 @@ static int altera_gpio_remove(struct platform_device *pdev)
>  {
>  	struct altera_gpio_chip *altera_gc = platform_get_drvdata(pdev);
>  
> -	gpiochip_remove(&altera_gc->mmchip.gc);
> +	of_mm_gpiochip_remove(&altera_gc->mmchip);
>  
>  	return -EIO;
>  }


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

* Re: [PATCH 1/2] gpio: altera: use of_mm_gpiochip_remove() to fix memory leak
@ 2015-06-26  3:17   ` Tien Hock Loh
  0 siblings, 0 replies; 17+ messages in thread
From: Tien Hock Loh @ 2015-06-26  3:17 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: linux-gpio, Linus Walleij, Alexandre Courbot, linux-kernel

Acked-by: Tien Hock Loh <thloh@altera.com>

On Wed, 2015-06-17 at 20:59 +0900, Masahiro Yamada wrote:
> This driver calls of_mm_gpiochip_add() to add a memory mapped gpio
> chip.  So, of_mm_gpiochip_remove() should be used when removing it.
> 
> The direct call of gpiochip_remove() misses unmapping the register
> and freeing the label.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
> 
>  drivers/gpio/gpio-altera.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpio/gpio-altera.c b/drivers/gpio/gpio-altera.c
> index 449fb46..c653c83 100644
> --- a/drivers/gpio/gpio-altera.c
> +++ b/drivers/gpio/gpio-altera.c
> @@ -337,7 +337,7 @@ static int altera_gpio_remove(struct platform_device *pdev)
>  {
>  	struct altera_gpio_chip *altera_gc = platform_get_drvdata(pdev);
>  
> -	gpiochip_remove(&altera_gc->mmchip.gc);
> +	of_mm_gpiochip_remove(&altera_gc->mmchip);
>  
>  	return -EIO;
>  }


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

* Re: [PATCH 1/2] gpio: altera: use of_mm_gpiochip_remove() to fix memory leak
  2015-06-17 11:59 [PATCH 1/2] gpio: altera: use of_mm_gpiochip_remove() to fix memory leak Masahiro Yamada
                   ` (2 preceding siblings ...)
  2015-06-26  3:17   ` Tien Hock Loh
@ 2015-07-15  9:45 ` Linus Walleij
  3 siblings, 0 replies; 17+ messages in thread
From: Linus Walleij @ 2015-07-15  9:45 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: linux-gpio, Alexandre Courbot, linux-kernel, Tien Hock Loh

On Wed, Jun 17, 2015 at 1:59 PM, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:

> This driver calls of_mm_gpiochip_add() to add a memory mapped gpio
> chip.  So, of_mm_gpiochip_remove() should be used when removing it.
>
> The direct call of gpiochip_remove() misses unmapping the register
> and freeing the label.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

Patch applied with the ACKs.

Yours,
Linus Walleij

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

end of thread, other threads:[~2015-07-15  9:45 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-17 11:59 [PATCH 1/2] gpio: altera: use of_mm_gpiochip_remove() to fix memory leak Masahiro Yamada
2015-06-17 11:59 ` [PATCH 2/2] gpio: altera: fix return value of altera_gpio_remove() Masahiro Yamada
2015-06-21  7:25   ` Alexandre Courbot
2015-06-21  7:25     ` Alexandre Courbot
2015-06-22  1:36     ` Tien Hock Loh
2015-06-22  1:36       ` Tien Hock Loh
2015-06-22  2:25       ` Alexandre Courbot
2015-06-22  2:25         ` Alexandre Courbot
2015-06-22 10:04       ` Masahiro Yamada
2015-06-22 10:04         ` Masahiro Yamada
2015-06-26  3:16   ` Tien Hock Loh
2015-06-26  3:16     ` Tien Hock Loh
2015-06-21  7:22 ` [PATCH 1/2] gpio: altera: use of_mm_gpiochip_remove() to fix memory leak Alexandre Courbot
2015-06-21  7:22   ` Alexandre Courbot
2015-06-26  3:17 ` Tien Hock Loh
2015-06-26  3:17   ` Tien Hock Loh
2015-07-15  9:45 ` Linus Walleij

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.