spi-tle62x0.c (53279f36dccffc26ff536003fd6bb97cc21c3b82) spi-tle62x0.c (fd4a319bc933ae93e68935b21924a9ca4ba2d060)
1/*
2 * Support Infineon TLE62x0 driver chips
3 *
4 * Copyright (c) 2007 Simtec Electronics
5 * Ben Dooks, <ben@simtec.co.uk>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as

--- 226 unchanged lines hidden (view full) ---

235 for (ptr = 0; ptr < ARRAY_SIZE(gpio_attrs); ptr++) {
236 if (gpio_attrs[ptr] == attr)
237 return ptr;
238 }
239
240 return -1;
241}
242
1/*
2 * Support Infineon TLE62x0 driver chips
3 *
4 * Copyright (c) 2007 Simtec Electronics
5 * Ben Dooks, <ben@simtec.co.uk>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as

--- 226 unchanged lines hidden (view full) ---

235 for (ptr = 0; ptr < ARRAY_SIZE(gpio_attrs); ptr++) {
236 if (gpio_attrs[ptr] == attr)
237 return ptr;
238 }
239
240 return -1;
241}
242
243static int __devinit tle62x0_probe(struct spi_device *spi)
243static int tle62x0_probe(struct spi_device *spi)
244{
245 struct tle62x0_state *st;
246 struct tle62x0_pdata *pdata;
247 int ptr;
248 int ret;
249
250 pdata = spi->dev.platform_data;
251 if (pdata == NULL) {

--- 37 unchanged lines hidden (view full) ---

289
290 device_remove_file(&spi->dev, &dev_attr_status_show);
291
292 err_status:
293 kfree(st);
294 return ret;
295}
296
244{
245 struct tle62x0_state *st;
246 struct tle62x0_pdata *pdata;
247 int ptr;
248 int ret;
249
250 pdata = spi->dev.platform_data;
251 if (pdata == NULL) {

--- 37 unchanged lines hidden (view full) ---

289
290 device_remove_file(&spi->dev, &dev_attr_status_show);
291
292 err_status:
293 kfree(st);
294 return ret;
295}
296
297static int __devexit tle62x0_remove(struct spi_device *spi)
297static int tle62x0_remove(struct spi_device *spi)
298{
299 struct tle62x0_state *st = spi_get_drvdata(spi);
300 int ptr;
301
302 for (ptr = 0; ptr < st->nr_gpio; ptr++)
303 device_remove_file(&spi->dev, gpio_attrs[ptr]);
304
305 device_remove_file(&spi->dev, &dev_attr_status_show);
306 kfree(st);
307 return 0;
308}
309
310static struct spi_driver tle62x0_driver = {
311 .driver = {
312 .name = "tle62x0",
313 .owner = THIS_MODULE,
314 },
315 .probe = tle62x0_probe,
298{
299 struct tle62x0_state *st = spi_get_drvdata(spi);
300 int ptr;
301
302 for (ptr = 0; ptr < st->nr_gpio; ptr++)
303 device_remove_file(&spi->dev, gpio_attrs[ptr]);
304
305 device_remove_file(&spi->dev, &dev_attr_status_show);
306 kfree(st);
307 return 0;
308}
309
310static struct spi_driver tle62x0_driver = {
311 .driver = {
312 .name = "tle62x0",
313 .owner = THIS_MODULE,
314 },
315 .probe = tle62x0_probe,
316 .remove = __devexit_p(tle62x0_remove),
316 .remove = tle62x0_remove,
317};
318
319module_spi_driver(tle62x0_driver);
320
321MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>");
322MODULE_DESCRIPTION("TLE62x0 SPI driver");
323MODULE_LICENSE("GPL v2");
324MODULE_ALIAS("spi:tle62x0");
317};
318
319module_spi_driver(tle62x0_driver);
320
321MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>");
322MODULE_DESCRIPTION("TLE62x0 SPI driver");
323MODULE_LICENSE("GPL v2");
324MODULE_ALIAS("spi:tle62x0");