diff options
author | Axel Lin <axel.lin@gmail.com> | 2011-05-11 08:39:05 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2011-05-26 23:30:25 -0400 |
commit | 80b4037033c2dae31e73810d506ce93b3783be05 (patch) | |
tree | 783fd060fd7fde5e26f655e183cf99405aab51a1 /drivers/spi | |
parent | bc9bc72e2f9bb07384c00604d1a40d0b5f62be6c (diff) |
spi/tle620x: add missing device_remove_file()
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>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | 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 a3938958147c..32a40876532f 100644 --- a/drivers/spi/tle62x0.c +++ b/drivers/spi/tle62x0.c | |||
@@ -283,7 +283,7 @@ static int __devinit tle62x0_probe(struct spi_device *spi) | |||
283 | return 0; | 283 | return 0; |
284 | 284 | ||
285 | err_gpios: | 285 | err_gpios: |
286 | for (; ptr > 0; ptr--) | 286 | while (--ptr >= 0) |
287 | device_remove_file(&spi->dev, gpio_attrs[ptr]); | 287 | device_remove_file(&spi->dev, gpio_attrs[ptr]); |
288 | 288 | ||
289 | device_remove_file(&spi->dev, &dev_attr_status_show); | 289 | device_remove_file(&spi->dev, &dev_attr_status_show); |
@@ -301,6 +301,7 @@ static int __devexit tle62x0_remove(struct spi_device *spi) | |||
301 | for (ptr = 0; ptr < st->nr_gpio; ptr++) | 301 | for (ptr = 0; ptr < st->nr_gpio; ptr++) |
302 | device_remove_file(&spi->dev, gpio_attrs[ptr]); | 302 | device_remove_file(&spi->dev, gpio_attrs[ptr]); |
303 | 303 | ||
304 | device_remove_file(&spi->dev, &dev_attr_status_show); | ||
304 | kfree(st); | 305 | kfree(st); |
305 | return 0; | 306 | return 0; |
306 | } | 307 | } |