spi: tle620x: add missing device_remove_file()
PATCH 1/1 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.
--- drivers/spi/tle62x0.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/spi/tle62x0.c +2 -1
@@ -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 ; }
Signature · 11 lines
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
Quoted 7 lines · Axel Lin
This patch includes below fixes:
1. Add missingdevice_remove_filefordev_attr_status_showintle62x0_remove.
2. Fixtle62x0_probeerror handling:
Currently, if the error happens when ptr> 0, gpio_attrs[0] is not properly remove.Signed-off-by Axel Lin<[email protected]>
Quoted 25 lines
--- drivers/spi/tle62x0.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)drivers/spi/tle62x0.c +2
-1@@ -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 ; }
Grant Likely
AppliedQuoted 9 lines · Ben Dooks
Quoted 7 lines · Axel Lin
This patch includes below fixes:
1. Add missingdevice_remove_filefordev_attr_status_showintle62x0_remove.
2. Fixtle62x0_probeerror handling:
Currently, if the error happens when ptr> 0, gpio_attrs[0] is not properly remove.Signed-off-by Axel Lin<[email protected]>Acked-by Ben Dooks <[email protected]>
Applied, thanks.
g.