* [PATCH] spi: tle620x: add missing device_remove_file()
@ 2011-05-11 12:39 ` Axel Lin
0 siblings, 0 replies; 4+ messages in thread
From: Axel Lin @ 2011-05-11 12:39 UTC (permalink / raw)
To: linux-kernel; +Cc: Ben Dooks, David Brownell, Grant Likely, spi-devel-general
This patch includes below fixes:
1. Add missing device_remove_file for dev_attr_status_show in tle62x0_remove.
2. Fix tle62x0_probe error handling:
Currently, if the error happens when ptr > 0, gpio_attrs[0] is not
properly remove.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
drivers/spi/tle62x0.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/spi/tle62x0.c b/drivers/spi/tle62x0.c
index a393895..32a4087 100644
--- a/drivers/spi/tle62x0.c
+++ b/drivers/spi/tle62x0.c
@@ -283,7 +283,7 @@ static int __devinit tle62x0_probe(struct spi_device *spi)
return 0;
err_gpios:
- for (; ptr > 0; ptr--)
+ while (--ptr >= 0)
device_remove_file(&spi->dev, gpio_attrs[ptr]);
device_remove_file(&spi->dev, &dev_attr_status_show);
@@ -301,6 +301,7 @@ static int __devexit tle62x0_remove(struct spi_device *spi)
for (ptr = 0; ptr < st->nr_gpio; ptr++)
device_remove_file(&spi->dev, gpio_attrs[ptr]);
+ device_remove_file(&spi->dev, &dev_attr_status_show);
kfree(st);
return 0;
}
--
1.7.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] spi: tle620x: add missing device_remove_file()
@ 2011-05-11 12:39 ` Axel Lin
0 siblings, 0 replies; 4+ messages in thread
From: Axel Lin @ 2011-05-11 12:39 UTC (permalink / raw)
To: linux-kernel-u79uwXL29TY76Z2rM5mHXA
Cc: Ben Dooks, David Brownell,
spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
This patch includes below fixes:
1. Add missing device_remove_file for dev_attr_status_show in tle62x0_remove.
2. Fix tle62x0_probe error handling:
Currently, if the error happens when ptr > 0, gpio_attrs[0] is not
properly remove.
Signed-off-by: Axel Lin <axel.lin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
drivers/spi/tle62x0.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/spi/tle62x0.c b/drivers/spi/tle62x0.c
index a393895..32a4087 100644
--- a/drivers/spi/tle62x0.c
+++ b/drivers/spi/tle62x0.c
@@ -283,7 +283,7 @@ static int __devinit tle62x0_probe(struct spi_device *spi)
return 0;
err_gpios:
- for (; ptr > 0; ptr--)
+ while (--ptr >= 0)
device_remove_file(&spi->dev, gpio_attrs[ptr]);
device_remove_file(&spi->dev, &dev_attr_status_show);
@@ -301,6 +301,7 @@ static int __devexit tle62x0_remove(struct spi_device *spi)
for (ptr = 0; ptr < st->nr_gpio; ptr++)
device_remove_file(&spi->dev, gpio_attrs[ptr]);
+ device_remove_file(&spi->dev, &dev_attr_status_show);
kfree(st);
return 0;
}
--
1.7.1
------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] spi: tle620x: add missing device_remove_file()
2011-05-11 12:39 ` Axel Lin
(?)
@ 2011-05-12 8:25 ` Ben Dooks
2011-05-27 3:31 ` Grant Likely
-1 siblings, 1 reply; 4+ messages in thread
From: Ben Dooks @ 2011-05-12 8:25 UTC (permalink / raw)
To: Axel Lin; +Cc: linux-kernel, Grant Likely, spi-devel-general
On 11/05/11 13:39, Axel Lin wrote:
> This patch includes below fixes:
> 1. Add missing device_remove_file for dev_attr_status_show in tle62x0_remove.
> 2. Fix tle62x0_probe error handling:
> Currently, if the error happens when ptr> 0, gpio_attrs[0] is not
> properly remove.
>
> Signed-off-by: Axel Lin<axel.lin@gmail.com>
Acked-by: Ben Dooks <ben-linux@fluff.org>
> ---
> drivers/spi/tle62x0.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/spi/tle62x0.c b/drivers/spi/tle62x0.c
> index a393895..32a4087 100644
> --- a/drivers/spi/tle62x0.c
> +++ b/drivers/spi/tle62x0.c
> @@ -283,7 +283,7 @@ static int __devinit tle62x0_probe(struct spi_device *spi)
> return 0;
>
> err_gpios:
> - for (; ptr> 0; ptr--)
> + while (--ptr>= 0)
> device_remove_file(&spi->dev, gpio_attrs[ptr]);
>
> device_remove_file(&spi->dev,&dev_attr_status_show);
> @@ -301,6 +301,7 @@ static int __devexit tle62x0_remove(struct spi_device *spi)
> for (ptr = 0; ptr< st->nr_gpio; ptr++)
> device_remove_file(&spi->dev, gpio_attrs[ptr]);
>
> + device_remove_file(&spi->dev,&dev_attr_status_show);
> kfree(st);
> return 0;
> }
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] spi: tle620x: add missing device_remove_file()
2011-05-12 8:25 ` Ben Dooks
@ 2011-05-27 3:31 ` Grant Likely
0 siblings, 0 replies; 4+ messages in thread
From: Grant Likely @ 2011-05-27 3:31 UTC (permalink / raw)
To: Ben Dooks; +Cc: Axel Lin, linux-kernel, spi-devel-general
On Thu, May 12, 2011 at 09:25:41AM +0100, Ben Dooks wrote:
> On 11/05/11 13:39, Axel Lin wrote:
> >This patch includes below fixes:
> >1. Add missing device_remove_file for dev_attr_status_show in tle62x0_remove.
> >2. Fix tle62x0_probe error handling:
> > Currently, if the error happens when ptr> 0, gpio_attrs[0] is not
> > properly remove.
> >
> >Signed-off-by: Axel Lin<axel.lin@gmail.com>
> Acked-by: Ben Dooks <ben-linux@fluff.org>
Applied, thanks.
g.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-05-27 3:31 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-11 12:39 [PATCH] spi: tle620x: add missing device_remove_file() Axel Lin
2011-05-11 12:39 ` Axel Lin
2011-05-12 8:25 ` Ben Dooks
2011-05-27 3:31 ` Grant Likely
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.