Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 80b40370 authored by Axel Lin's avatar Axel Lin Committed by Grant Likely
Browse files

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: default avatarAxel Lin <axel.lin@gmail.com>
Acked-by: default avatarBen Dooks <ben-linux@fluff.org>
Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
parent bc9bc72e
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -283,7 +283,7 @@ static int __devinit tle62x0_probe(struct spi_device *spi)
	return 0;
	return 0;


 err_gpios:
 err_gpios:
	for (; ptr > 0; ptr--)
	while (--ptr >= 0)
		device_remove_file(&spi->dev, gpio_attrs[ptr]);
		device_remove_file(&spi->dev, gpio_attrs[ptr]);


	device_remove_file(&spi->dev, &dev_attr_status_show);
	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++)
	for (ptr = 0; ptr < st->nr_gpio; ptr++)
		device_remove_file(&spi->dev, gpio_attrs[ptr]);
		device_remove_file(&spi->dev, gpio_attrs[ptr]);


	device_remove_file(&spi->dev, &dev_attr_status_show);
	kfree(st);
	kfree(st);
	return 0;
	return 0;
}
}