]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/spi/tle62x0.c
Merge branch 'for-2.6.40' of git://linux-nfs.org/~bfields/linux
[karo-tx-linux.git] / drivers / spi / tle62x0.c
index a3938958147c887ecbf803c6c806d668735b62de..32a40876532fc499933bbf7fd1ac602f7228fd30 100644 (file)
@@ -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;
 }