Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging:iio: Streamline API function naming

Currently we use two different naming schemes in the IIO API, iio_verb_object
and iio_object_verb. E.g iio_device_register and iio_allocate_device. This
patches renames instances of the later to the former. The patch also renames allocate to
alloc as this seems to be the preferred form throughout the kernel.

In particular the following renames are performed by the patch:
iio_put_device -> iio_device_put
iio_allocate_device -> iio_device_alloc
iio_free_device -> iio_device_free
iio_get_trigger -> iio_trigger_get
iio_put_trigger -> iio_trigger_put
iio_allocate_trigger -> iio_trigger_alloc
iio_free_trigger -> iio_trigger_free

The conversion was done with the following coccinelle patch with manual fixes to
comments and documentation.

<smpl>
@@
@@
-iio_put_device
+iio_device_put
@@
@@
-iio_allocate_device
+iio_device_alloc
@@
@@
-iio_free_device
+iio_device_free
@@
@@
-iio_get_trigger
+iio_trigger_get
@@
@@
-iio_put_trigger
+iio_trigger_put
@@
@@
-iio_allocate_trigger
+iio_trigger_alloc
@@
@@
-iio_free_trigger
+iio_trigger_free
</smpl>

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Lars-Peter Clausen and committed by
Greg Kroah-Hartman
7cbb7537 5d4a6789

+280 -280
+4 -4
drivers/iio/industrialio-core.c
··· 737 737 .release = iio_dev_release, 738 738 }; 739 739 740 - struct iio_dev *iio_allocate_device(int sizeof_priv) 740 + struct iio_dev *iio_device_alloc(int sizeof_priv) 741 741 { 742 742 struct iio_dev *dev; 743 743 size_t alloc_size; ··· 773 773 774 774 return dev; 775 775 } 776 - EXPORT_SYMBOL(iio_allocate_device); 776 + EXPORT_SYMBOL(iio_device_alloc); 777 777 778 - void iio_free_device(struct iio_dev *dev) 778 + void iio_device_free(struct iio_dev *dev) 779 779 { 780 780 if (dev) { 781 781 ida_simple_remove(&iio_ida, dev->id); 782 782 kfree(dev); 783 783 } 784 784 } 785 - EXPORT_SYMBOL(iio_free_device); 785 + EXPORT_SYMBOL(iio_device_free); 786 786 787 787 /** 788 788 * iio_chrdev_open() - chrdev file open for buffer access and ioctls
+7 -7
drivers/iio/industrialio-trigger.c
··· 360 360 indio_dev->trig = trig; 361 361 362 362 if (oldtrig && indio_dev->trig != oldtrig) 363 - iio_put_trigger(oldtrig); 363 + iio_trigger_put(oldtrig); 364 364 if (indio_dev->trig) 365 - iio_get_trigger(indio_dev->trig); 365 + iio_trigger_get(indio_dev->trig); 366 366 367 367 return len; 368 368 } ··· 426 426 trig->subirqs[d->irq - trig->subirq_base].enabled = true; 427 427 } 428 428 429 - struct iio_trigger *iio_allocate_trigger(const char *fmt, ...) 429 + struct iio_trigger *iio_trigger_alloc(const char *fmt, ...) 430 430 { 431 431 va_list vargs; 432 432 struct iio_trigger *trig; ··· 472 472 } 473 473 return trig; 474 474 } 475 - EXPORT_SYMBOL(iio_allocate_trigger); 475 + EXPORT_SYMBOL(iio_trigger_alloc); 476 476 477 - void iio_free_trigger(struct iio_trigger *trig) 477 + void iio_trigger_free(struct iio_trigger *trig) 478 478 { 479 479 if (trig) 480 480 put_device(&trig->dev); 481 481 } 482 - EXPORT_SYMBOL(iio_free_trigger); 482 + EXPORT_SYMBOL(iio_trigger_free); 483 483 484 484 void iio_device_register_trigger_consumer(struct iio_dev *indio_dev) 485 485 { ··· 491 491 { 492 492 /* Clean up and associated but not attached triggers references */ 493 493 if (indio_dev->trig) 494 - iio_put_trigger(indio_dev->trig); 494 + iio_trigger_put(indio_dev->trig); 495 495 } 496 496 497 497 int iio_triggered_buffer_postenable(struct iio_dev *indio_dev)
+2 -2
drivers/staging/iio/Documentation/device.txt
··· 8 8 9 9 First allocate one using: 10 10 11 - struct iio_dev *indio_dev = iio_allocate_device(sizeof(struct chip_state)); 11 + struct iio_dev *indio_dev = iio_device_alloc(sizeof(struct chip_state)); 12 12 where chip_state is a structure of local state data for this instance of 13 13 the chip. 14 14 ··· 78 78 gets confused) 79 79 80 80 On remove, iio_device_unregister(indio_dev) will remove the device from 81 - the core, and iio_free_device will clean up. 81 + the core, and iio_device_free will clean up.
+1 -1
drivers/staging/iio/Documentation/trigger.txt
··· 5 5 such triggers are registered with the core in the same way as 6 6 stand-alone triggers. 7 7 8 - struct iio_trig *trig = iio_allocate_trigger("<trigger format string>", ...); 8 + struct iio_trig *trig = iio_trigger_alloc("<trigger format string>", ...); 9 9 10 10 allocates a trigger structure. The key elements to then fill in within 11 11 a driver are:
+3 -3
drivers/staging/iio/accel/adis16201_core.c
··· 532 532 struct iio_dev *indio_dev; 533 533 534 534 /* setup the industrialio driver allocated elements */ 535 - indio_dev = iio_allocate_device(sizeof(*st)); 535 + indio_dev = iio_device_alloc(sizeof(*st)); 536 536 if (indio_dev == NULL) { 537 537 ret = -ENOMEM; 538 538 goto error_ret; ··· 587 587 error_unreg_ring_funcs: 588 588 adis16201_unconfigure_ring(indio_dev); 589 589 error_free_dev: 590 - iio_free_device(indio_dev); 590 + iio_device_free(indio_dev); 591 591 error_ret: 592 592 return ret; 593 593 } ··· 600 600 adis16201_remove_trigger(indio_dev); 601 601 iio_buffer_unregister(indio_dev); 602 602 adis16201_unconfigure_ring(indio_dev); 603 - iio_free_device(indio_dev); 603 + iio_device_free(indio_dev); 604 604 605 605 return 0; 606 606 }
+3 -3
drivers/staging/iio/accel/adis16201_trigger.c
··· 29 29 int ret; 30 30 struct adis16201_state *st = iio_priv(indio_dev); 31 31 32 - st->trig = iio_allocate_trigger("adis16201-dev%d", indio_dev->id); 32 + st->trig = iio_trigger_alloc("adis16201-dev%d", indio_dev->id); 33 33 if (st->trig == NULL) { 34 34 ret = -ENOMEM; 35 35 goto error_ret; ··· 56 56 error_free_irq: 57 57 free_irq(st->us->irq, st->trig); 58 58 error_free_trig: 59 - iio_free_trigger(st->trig); 59 + iio_trigger_free(st->trig); 60 60 error_ret: 61 61 return ret; 62 62 } ··· 67 67 68 68 iio_trigger_unregister(state->trig); 69 69 free_irq(state->us->irq, state->trig); 70 - iio_free_trigger(state->trig); 70 + iio_trigger_free(state->trig); 71 71 }
+3 -3
drivers/staging/iio/accel/adis16203_core.c
··· 469 469 struct adis16203_state *st; 470 470 471 471 /* setup the industrialio driver allocated elements */ 472 - indio_dev = iio_allocate_device(sizeof(*st)); 472 + indio_dev = iio_device_alloc(sizeof(*st)); 473 473 if (indio_dev == NULL) { 474 474 ret = -ENOMEM; 475 475 goto error_ret; ··· 523 523 error_unreg_ring_funcs: 524 524 adis16203_unconfigure_ring(indio_dev); 525 525 error_free_dev: 526 - iio_free_device(indio_dev); 526 + iio_device_free(indio_dev); 527 527 error_ret: 528 528 return ret; 529 529 } ··· 536 536 adis16203_remove_trigger(indio_dev); 537 537 iio_buffer_unregister(indio_dev); 538 538 adis16203_unconfigure_ring(indio_dev); 539 - iio_free_device(indio_dev); 539 + iio_device_free(indio_dev); 540 540 541 541 return 0; 542 542 }
+3 -3
drivers/staging/iio/accel/adis16203_trigger.c
··· 29 29 int ret; 30 30 struct adis16203_state *st = iio_priv(indio_dev); 31 31 32 - st->trig = iio_allocate_trigger("adis16203-dev%d", indio_dev->id); 32 + st->trig = iio_trigger_alloc("adis16203-dev%d", indio_dev->id); 33 33 if (st->trig == NULL) { 34 34 ret = -ENOMEM; 35 35 goto error_ret; ··· 58 58 error_free_irq: 59 59 free_irq(st->us->irq, st->trig); 60 60 error_free_trig: 61 - iio_free_trigger(st->trig); 61 + iio_trigger_free(st->trig); 62 62 error_ret: 63 63 return ret; 64 64 } ··· 69 69 70 70 iio_trigger_unregister(st->trig); 71 71 free_irq(st->us->irq, st->trig); 72 - iio_free_trigger(st->trig); 72 + iio_trigger_free(st->trig); 73 73 }
+3 -3
drivers/staging/iio/accel/adis16204_core.c
··· 545 545 struct iio_dev *indio_dev; 546 546 547 547 /* setup the industrialio driver allocated elements */ 548 - indio_dev = iio_allocate_device(sizeof(*st)); 548 + indio_dev = iio_device_alloc(sizeof(*st)); 549 549 if (indio_dev == NULL) { 550 550 ret = -ENOMEM; 551 551 goto error_ret; ··· 598 598 error_unreg_ring_funcs: 599 599 adis16204_unconfigure_ring(indio_dev); 600 600 error_free_dev: 601 - iio_free_device(indio_dev); 601 + iio_device_free(indio_dev); 602 602 error_ret: 603 603 return ret; 604 604 } ··· 611 611 adis16204_remove_trigger(indio_dev); 612 612 iio_buffer_unregister(indio_dev); 613 613 adis16204_unconfigure_ring(indio_dev); 614 - iio_free_device(indio_dev); 614 + iio_device_free(indio_dev); 615 615 616 616 return 0; 617 617 }
+3 -3
drivers/staging/iio/accel/adis16204_trigger.c
··· 29 29 int ret; 30 30 struct adis16204_state *st = iio_priv(indio_dev); 31 31 32 - st->trig = iio_allocate_trigger("adis16204-dev%d", indio_dev->id); 32 + st->trig = iio_trigger_alloc("adis16204-dev%d", indio_dev->id); 33 33 if (st->trig == NULL) { 34 34 ret = -ENOMEM; 35 35 goto error_ret; ··· 58 58 error_free_irq: 59 59 free_irq(st->us->irq, st->trig); 60 60 error_free_trig: 61 - iio_free_trigger(st->trig); 61 + iio_trigger_free(st->trig); 62 62 error_ret: 63 63 return ret; 64 64 } ··· 69 69 70 70 iio_trigger_unregister(state->trig); 71 71 free_irq(state->us->irq, state->trig); 72 - iio_free_trigger(state->trig); 72 + iio_trigger_free(state->trig); 73 73 }
+3 -3
drivers/staging/iio/accel/adis16209_core.c
··· 544 544 struct iio_dev *indio_dev; 545 545 546 546 /* setup the industrialio driver allocated elements */ 547 - indio_dev = iio_allocate_device(sizeof(*st)); 547 + indio_dev = iio_device_alloc(sizeof(*st)); 548 548 if (indio_dev == NULL) { 549 549 ret = -ENOMEM; 550 550 goto error_ret; ··· 597 597 error_unreg_ring_funcs: 598 598 adis16209_unconfigure_ring(indio_dev); 599 599 error_free_dev: 600 - iio_free_device(indio_dev); 600 + iio_device_free(indio_dev); 601 601 error_ret: 602 602 return ret; 603 603 } ··· 612 612 adis16209_remove_trigger(indio_dev); 613 613 iio_buffer_unregister(indio_dev); 614 614 adis16209_unconfigure_ring(indio_dev); 615 - iio_free_device(indio_dev); 615 + iio_device_free(indio_dev); 616 616 617 617 return 0; 618 618 }
+3 -3
drivers/staging/iio/accel/adis16209_trigger.c
··· 38 38 int ret; 39 39 struct adis16209_state *st = iio_priv(indio_dev); 40 40 41 - st->trig = iio_allocate_trigger("adis16209-dev%d", indio_dev->id); 41 + st->trig = iio_trigger_alloc("adis16209-dev%d", indio_dev->id); 42 42 if (st->trig == NULL) { 43 43 ret = -ENOMEM; 44 44 goto error_ret; ··· 66 66 error_free_irq: 67 67 free_irq(st->us->irq, st->trig); 68 68 error_free_trig: 69 - iio_free_trigger(st->trig); 69 + iio_trigger_free(st->trig); 70 70 error_ret: 71 71 return ret; 72 72 } ··· 77 77 78 78 iio_trigger_unregister(st->trig); 79 79 free_irq(st->us->irq, st->trig); 80 - iio_free_trigger(st->trig); 80 + iio_trigger_free(st->trig); 81 81 }
+3 -3
drivers/staging/iio/accel/adis16220_core.c
··· 634 634 struct iio_dev *indio_dev; 635 635 636 636 /* setup the industrialio driver allocated elements */ 637 - indio_dev = iio_allocate_device(sizeof(*st)); 637 + indio_dev = iio_device_alloc(sizeof(*st)); 638 638 if (indio_dev == NULL) { 639 639 ret = -ENOMEM; 640 640 goto error_ret; ··· 685 685 error_unregister_dev: 686 686 iio_device_unregister(indio_dev); 687 687 error_free_dev: 688 - iio_free_device(indio_dev); 688 + iio_device_free(indio_dev); 689 689 error_ret: 690 690 return ret; 691 691 } ··· 700 700 sysfs_remove_bin_file(&indio_dev->dev.kobj, &adc1_bin); 701 701 sysfs_remove_bin_file(&indio_dev->dev.kobj, &accel_bin); 702 702 iio_device_unregister(indio_dev); 703 - iio_free_device(indio_dev); 703 + iio_device_free(indio_dev); 704 704 705 705 return 0; 706 706 }
+3 -3
drivers/staging/iio/accel/adis16240_core.c
··· 578 578 struct iio_dev *indio_dev; 579 579 580 580 /* setup the industrialio driver allocated elements */ 581 - indio_dev = iio_allocate_device(sizeof(*st)); 581 + indio_dev = iio_device_alloc(sizeof(*st)); 582 582 if (indio_dev == NULL) { 583 583 ret = -ENOMEM; 584 584 goto error_ret; ··· 631 631 error_unreg_ring_funcs: 632 632 adis16240_unconfigure_ring(indio_dev); 633 633 error_free_dev: 634 - iio_free_device(indio_dev); 634 + iio_device_free(indio_dev); 635 635 error_ret: 636 636 return ret; 637 637 } ··· 647 647 adis16240_remove_trigger(indio_dev); 648 648 iio_buffer_unregister(indio_dev); 649 649 adis16240_unconfigure_ring(indio_dev); 650 - iio_free_device(indio_dev); 650 + iio_device_free(indio_dev); 651 651 652 652 return 0; 653 653 }
+3 -3
drivers/staging/iio/accel/adis16240_trigger.c
··· 38 38 int ret; 39 39 struct adis16240_state *st = iio_priv(indio_dev); 40 40 41 - st->trig = iio_allocate_trigger("adis16240-dev%d", indio_dev->id); 41 + st->trig = iio_trigger_alloc("adis16240-dev%d", indio_dev->id); 42 42 if (st->trig == NULL) { 43 43 ret = -ENOMEM; 44 44 goto error_ret; ··· 67 67 error_free_irq: 68 68 free_irq(st->us->irq, st->trig); 69 69 error_free_trig: 70 - iio_free_trigger(st->trig); 70 + iio_trigger_free(st->trig); 71 71 error_ret: 72 72 return ret; 73 73 } ··· 78 78 79 79 iio_trigger_unregister(st->trig); 80 80 free_irq(st->us->irq, st->trig); 81 - iio_free_trigger(st->trig); 81 + iio_trigger_free(st->trig); 82 82 }
+3 -3
drivers/staging/iio/accel/kxsd9.c
··· 228 228 struct kxsd9_state *st; 229 229 int ret = 0; 230 230 231 - indio_dev = iio_allocate_device(sizeof(*st)); 231 + indio_dev = iio_device_alloc(sizeof(*st)); 232 232 if (indio_dev == NULL) { 233 233 ret = -ENOMEM; 234 234 goto error_ret; ··· 256 256 return 0; 257 257 258 258 error_free_dev: 259 - iio_free_device(indio_dev); 259 + iio_device_free(indio_dev); 260 260 error_ret: 261 261 return ret; 262 262 } ··· 264 264 static int __devexit kxsd9_remove(struct spi_device *spi) 265 265 { 266 266 iio_device_unregister(spi_get_drvdata(spi)); 267 - iio_free_device(spi_get_drvdata(spi)); 267 + iio_device_free(spi_get_drvdata(spi)); 268 268 269 269 return 0; 270 270 }
+3 -3
drivers/staging/iio/accel/lis3l02dq_core.c
··· 680 680 struct lis3l02dq_state *st; 681 681 struct iio_dev *indio_dev; 682 682 683 - indio_dev = iio_allocate_device(sizeof *st); 683 + indio_dev = iio_device_alloc(sizeof *st); 684 684 if (indio_dev == NULL) { 685 685 ret = -ENOMEM; 686 686 goto error_ret; ··· 748 748 error_unreg_buffer_funcs: 749 749 lis3l02dq_unconfigure_buffer(indio_dev); 750 750 error_free_dev: 751 - iio_free_device(indio_dev); 751 + iio_device_free(indio_dev); 752 752 error_ret: 753 753 return ret; 754 754 } ··· 803 803 iio_buffer_unregister(indio_dev); 804 804 lis3l02dq_unconfigure_buffer(indio_dev); 805 805 806 - iio_free_device(indio_dev); 806 + iio_device_free(indio_dev); 807 807 err_ret: 808 808 return ret; 809 809 }
+3 -3
drivers/staging/iio/accel/lis3l02dq_ring.c
··· 286 286 int ret; 287 287 struct lis3l02dq_state *st = iio_priv(indio_dev); 288 288 289 - st->trig = iio_allocate_trigger("lis3l02dq-dev%d", indio_dev->id); 289 + st->trig = iio_trigger_alloc("lis3l02dq-dev%d", indio_dev->id); 290 290 if (!st->trig) { 291 291 ret = -ENOMEM; 292 292 goto error_ret; ··· 302 302 return 0; 303 303 304 304 error_free_trig: 305 - iio_free_trigger(st->trig); 305 + iio_trigger_free(st->trig); 306 306 error_ret: 307 307 return ret; 308 308 } ··· 312 312 struct lis3l02dq_state *st = iio_priv(indio_dev); 313 313 314 314 iio_trigger_unregister(st->trig); 315 - iio_free_trigger(st->trig); 315 + iio_trigger_free(st->trig); 316 316 } 317 317 318 318 void lis3l02dq_unconfigure_buffer(struct iio_dev *indio_dev)
+3 -3
drivers/staging/iio/accel/sca3000_core.c
··· 1145 1145 struct sca3000_state *st; 1146 1146 struct iio_dev *indio_dev; 1147 1147 1148 - indio_dev = iio_allocate_device(sizeof(*st)); 1148 + indio_dev = iio_device_alloc(sizeof(*st)); 1149 1149 if (indio_dev == NULL) { 1150 1150 ret = -ENOMEM; 1151 1151 goto error_ret; ··· 1209 1209 error_unregister_dev: 1210 1210 iio_device_unregister(indio_dev); 1211 1211 error_free_dev: 1212 - iio_free_device(indio_dev); 1212 + iio_device_free(indio_dev); 1213 1213 1214 1214 error_ret: 1215 1215 return ret; ··· 1247 1247 iio_device_unregister(indio_dev); 1248 1248 iio_buffer_unregister(indio_dev); 1249 1249 sca3000_unconfigure_ring(indio_dev); 1250 - iio_free_device(indio_dev); 1250 + iio_device_free(indio_dev); 1251 1251 1252 1252 return 0; 1253 1253 }
+5 -5
drivers/staging/iio/adc/ad7192.c
··· 604 604 struct ad7192_state *st = iio_priv(indio_dev); 605 605 int ret; 606 606 607 - st->trig = iio_allocate_trigger("%s-dev%d", 607 + st->trig = iio_trigger_alloc("%s-dev%d", 608 608 spi_get_device_id(st->spi)->name, 609 609 indio_dev->id); 610 610 if (st->trig == NULL) { ··· 637 637 error_free_irq: 638 638 free_irq(st->spi->irq, indio_dev); 639 639 error_free_trig: 640 - iio_free_trigger(st->trig); 640 + iio_trigger_free(st->trig); 641 641 error_ret: 642 642 return ret; 643 643 } ··· 648 648 649 649 iio_trigger_unregister(st->trig); 650 650 free_irq(st->spi->irq, indio_dev); 651 - iio_free_trigger(st->trig); 651 + iio_trigger_free(st->trig); 652 652 } 653 653 654 654 static ssize_t ad7192_read_frequency(struct device *dev, ··· 1024 1024 return -ENODEV; 1025 1025 } 1026 1026 1027 - indio_dev = iio_allocate_device(sizeof(*st)); 1027 + indio_dev = iio_device_alloc(sizeof(*st)); 1028 1028 if (indio_dev == NULL) 1029 1029 return -ENOMEM; 1030 1030 ··· 1105 1105 if (!IS_ERR(st->reg)) 1106 1106 regulator_put(st->reg); 1107 1107 1108 - iio_free_device(indio_dev); 1108 + iio_device_free(indio_dev); 1109 1109 1110 1110 return ret; 1111 1111 }
+3 -3
drivers/staging/iio/adc/ad7280a.c
··· 839 839 int ret; 840 840 const unsigned short tACQ_ns[4] = {465, 1010, 1460, 1890}; 841 841 const unsigned short nAVG[4] = {1, 2, 4, 8}; 842 - struct iio_dev *indio_dev = iio_allocate_device(sizeof(*st)); 842 + struct iio_dev *indio_dev = iio_device_alloc(sizeof(*st)); 843 843 844 844 if (indio_dev == NULL) 845 845 return -ENOMEM; ··· 945 945 kfree(st->channels); 946 946 947 947 error_free_device: 948 - iio_free_device(indio_dev); 948 + iio_device_free(indio_dev); 949 949 950 950 return ret; 951 951 } ··· 964 964 965 965 kfree(st->channels); 966 966 kfree(st->iio_attr); 967 - iio_free_device(indio_dev); 967 + iio_device_free(indio_dev); 968 968 969 969 return 0; 970 970 }
+3 -3
drivers/staging/iio/adc/ad7291.c
··· 587 587 struct iio_dev *indio_dev; 588 588 int ret = 0, voltage_uv = 0; 589 589 590 - indio_dev = iio_allocate_device(sizeof(*chip)); 590 + indio_dev = iio_device_alloc(sizeof(*chip)); 591 591 if (indio_dev == NULL) { 592 592 ret = -ENOMEM; 593 593 goto error_ret; ··· 669 669 if (!IS_ERR(chip->reg)) 670 670 regulator_put(chip->reg); 671 671 672 - iio_free_device(indio_dev); 672 + iio_device_free(indio_dev); 673 673 error_ret: 674 674 return ret; 675 675 } ··· 689 689 regulator_put(chip->reg); 690 690 } 691 691 692 - iio_free_device(indio_dev); 692 + iio_device_free(indio_dev); 693 693 694 694 return 0; 695 695 }
+3 -3
drivers/staging/iio/adc/ad7298_core.c
··· 179 179 struct ad7298_platform_data *pdata = spi->dev.platform_data; 180 180 struct ad7298_state *st; 181 181 int ret; 182 - struct iio_dev *indio_dev = iio_allocate_device(sizeof(*st)); 182 + struct iio_dev *indio_dev = iio_device_alloc(sizeof(*st)); 183 183 184 184 if (indio_dev == NULL) 185 185 return -ENOMEM; ··· 252 252 error_put_reg: 253 253 if (!IS_ERR(st->reg)) 254 254 regulator_put(st->reg); 255 - iio_free_device(indio_dev); 255 + iio_device_free(indio_dev); 256 256 257 257 return ret; 258 258 } ··· 269 269 regulator_disable(st->reg); 270 270 regulator_put(st->reg); 271 271 } 272 - iio_free_device(indio_dev); 272 + iio_device_free(indio_dev); 273 273 274 274 return 0; 275 275 }
+3 -3
drivers/staging/iio/adc/ad7476_core.c
··· 128 128 struct iio_dev *indio_dev; 129 129 int ret, voltage_uv = 0; 130 130 131 - indio_dev = iio_allocate_device(sizeof(*st)); 131 + indio_dev = iio_device_alloc(sizeof(*st)); 132 132 if (indio_dev == NULL) { 133 133 ret = -ENOMEM; 134 134 goto error_ret; ··· 198 198 error_put_reg: 199 199 if (!IS_ERR(st->reg)) 200 200 regulator_put(st->reg); 201 - iio_free_device(indio_dev); 201 + iio_device_free(indio_dev); 202 202 203 203 error_ret: 204 204 return ret; ··· 216 216 regulator_disable(st->reg); 217 217 regulator_put(st->reg); 218 218 } 219 - iio_free_device(indio_dev); 219 + iio_device_free(indio_dev); 220 220 221 221 return 0; 222 222 }
+3 -3
drivers/staging/iio/adc/ad7606_core.c
··· 461 461 struct ad7606_platform_data *pdata = dev->platform_data; 462 462 struct ad7606_state *st; 463 463 int ret; 464 - struct iio_dev *indio_dev = iio_allocate_device(sizeof(*st)); 464 + struct iio_dev *indio_dev = iio_device_alloc(sizeof(*st)); 465 465 466 466 if (indio_dev == NULL) { 467 467 ret = -ENOMEM; ··· 560 560 error_put_reg: 561 561 if (!IS_ERR(st->reg)) 562 562 regulator_put(st->reg); 563 - iio_free_device(indio_dev); 563 + iio_device_free(indio_dev); 564 564 error_ret: 565 565 return ERR_PTR(ret); 566 566 } ··· 580 580 } 581 581 582 582 ad7606_free_gpios(st); 583 - iio_free_device(indio_dev); 583 + iio_device_free(indio_dev); 584 584 585 585 return 0; 586 586 }
+3 -3
drivers/staging/iio/adc/ad7780.c
··· 187 187 return -ENODEV; 188 188 } 189 189 190 - indio_dev = iio_allocate_device(sizeof(*st)); 190 + indio_dev = iio_device_alloc(sizeof(*st)); 191 191 if (indio_dev == NULL) 192 192 return -ENOMEM; 193 193 ··· 265 265 if (!IS_ERR(st->reg)) 266 266 regulator_put(st->reg); 267 267 268 - iio_free_device(indio_dev); 268 + iio_device_free(indio_dev); 269 269 270 270 return ret; 271 271 } ··· 282 282 regulator_disable(st->reg); 283 283 regulator_put(st->reg); 284 284 } 285 - iio_free_device(indio_dev); 285 + iio_device_free(indio_dev); 286 286 287 287 return 0; 288 288 }
+6 -6
drivers/staging/iio/adc/ad7793.c
··· 469 469 struct ad7793_state *st = iio_priv(indio_dev); 470 470 int ret; 471 471 472 - st->trig = iio_allocate_trigger("%s-dev%d", 472 + st->trig = iio_trigger_alloc("%s-dev%d", 473 473 spi_get_device_id(st->spi)->name, 474 474 indio_dev->id); 475 475 if (st->trig == NULL) { ··· 503 503 error_free_irq: 504 504 free_irq(st->spi->irq, indio_dev); 505 505 error_free_trig: 506 - iio_free_trigger(st->trig); 506 + iio_trigger_free(st->trig); 507 507 error_ret: 508 508 return ret; 509 509 } ··· 514 514 515 515 iio_trigger_unregister(st->trig); 516 516 free_irq(st->spi->irq, indio_dev); 517 - iio_free_trigger(st->trig); 517 + iio_trigger_free(st->trig); 518 518 } 519 519 520 520 static const u16 sample_freq_avail[16] = {0, 470, 242, 123, 62, 50, 39, 33, 19, ··· 904 904 return -ENODEV; 905 905 } 906 906 907 - indio_dev = iio_allocate_device(sizeof(*st)); 907 + indio_dev = iio_device_alloc(sizeof(*st)); 908 908 if (indio_dev == NULL) 909 909 return -ENOMEM; 910 910 ··· 988 988 if (!IS_ERR(st->reg)) 989 989 regulator_put(st->reg); 990 990 991 - iio_free_device(indio_dev); 991 + iio_device_free(indio_dev); 992 992 993 993 return ret; 994 994 } ··· 1008 1008 regulator_put(st->reg); 1009 1009 } 1010 1010 1011 - iio_free_device(indio_dev); 1011 + iio_device_free(indio_dev); 1012 1012 1013 1013 return 0; 1014 1014 }
+3 -3
drivers/staging/iio/adc/ad7816.c
··· 354 354 return -EINVAL; 355 355 } 356 356 357 - indio_dev = iio_allocate_device(sizeof(*chip)); 357 + indio_dev = iio_device_alloc(sizeof(*chip)); 358 358 if (indio_dev == NULL) { 359 359 ret = -ENOMEM; 360 360 goto error_ret; ··· 426 426 error_free_gpio_rdwr: 427 427 gpio_free(chip->rdwr_pin); 428 428 error_free_device: 429 - iio_free_device(indio_dev); 429 + iio_device_free(indio_dev); 430 430 error_ret: 431 431 return ret; 432 432 } ··· 443 443 gpio_free(chip->busy_pin); 444 444 gpio_free(chip->convert_pin); 445 445 gpio_free(chip->rdwr_pin); 446 - iio_free_device(indio_dev); 446 + iio_device_free(indio_dev); 447 447 448 448 return 0; 449 449 }
+3 -3
drivers/staging/iio/adc/ad7887_core.c
··· 106 106 struct ad7887_platform_data *pdata = spi->dev.platform_data; 107 107 struct ad7887_state *st; 108 108 int ret, voltage_uv = 0; 109 - struct iio_dev *indio_dev = iio_allocate_device(sizeof(*st)); 109 + struct iio_dev *indio_dev = iio_device_alloc(sizeof(*st)); 110 110 111 111 if (indio_dev == NULL) 112 112 return -ENOMEM; ··· 222 222 error_put_reg: 223 223 if (!IS_ERR(st->reg)) 224 224 regulator_put(st->reg); 225 - iio_free_device(indio_dev); 225 + iio_device_free(indio_dev); 226 226 227 227 return ret; 228 228 } ··· 239 239 regulator_disable(st->reg); 240 240 regulator_put(st->reg); 241 241 } 242 - iio_free_device(indio_dev); 242 + iio_device_free(indio_dev); 243 243 244 244 return 0; 245 245 }
+3 -3
drivers/staging/iio/adc/ad799x_core.c
··· 847 847 int ret; 848 848 struct ad799x_platform_data *pdata = client->dev.platform_data; 849 849 struct ad799x_state *st; 850 - struct iio_dev *indio_dev = iio_allocate_device(sizeof(*st)); 850 + struct iio_dev *indio_dev = iio_device_alloc(sizeof(*st)); 851 851 852 852 if (indio_dev == NULL) 853 853 return -ENOMEM; ··· 920 920 error_put_reg: 921 921 if (!IS_ERR(st->reg)) 922 922 regulator_put(st->reg); 923 - iio_free_device(indio_dev); 923 + iio_device_free(indio_dev); 924 924 925 925 return ret; 926 926 } ··· 940 940 regulator_disable(st->reg); 941 941 regulator_put(st->reg); 942 942 } 943 - iio_free_device(indio_dev); 943 + iio_device_free(indio_dev); 944 944 945 945 return 0; 946 946 }
+3 -3
drivers/staging/iio/adc/adt7310.c
··· 753 753 unsigned long *adt7310_platform_data = spi_dev->dev.platform_data; 754 754 unsigned long irq_flags; 755 755 756 - indio_dev = iio_allocate_device(sizeof(*chip)); 756 + indio_dev = iio_device_alloc(sizeof(*chip)); 757 757 if (indio_dev == NULL) { 758 758 ret = -ENOMEM; 759 759 goto error_ret; ··· 833 833 error_unreg_ct_irq: 834 834 free_irq(spi_dev->irq, indio_dev); 835 835 error_free_dev: 836 - iio_free_device(indio_dev); 836 + iio_device_free(indio_dev); 837 837 error_ret: 838 838 return ret; 839 839 } ··· 849 849 free_irq(adt7310_platform_data[0], indio_dev); 850 850 if (spi_dev->irq) 851 851 free_irq(spi_dev->irq, indio_dev); 852 - iio_free_device(indio_dev); 852 + iio_device_free(indio_dev); 853 853 854 854 return 0; 855 855 }
+3 -3
drivers/staging/iio/adc/adt7410.c
··· 721 721 int ret = 0; 722 722 unsigned long *adt7410_platform_data = client->dev.platform_data; 723 723 724 - indio_dev = iio_allocate_device(sizeof(*chip)); 724 + indio_dev = iio_device_alloc(sizeof(*chip)); 725 725 if (indio_dev == NULL) { 726 726 ret = -ENOMEM; 727 727 goto error_ret; ··· 797 797 error_unreg_ct_irq: 798 798 free_irq(client->irq, indio_dev); 799 799 error_free_dev: 800 - iio_free_device(indio_dev); 800 + iio_device_free(indio_dev); 801 801 error_ret: 802 802 return ret; 803 803 } ··· 812 812 free_irq(adt7410_platform_data[0], indio_dev); 813 813 if (client->irq) 814 814 free_irq(client->irq, indio_dev); 815 - iio_free_device(indio_dev); 815 + iio_device_free(indio_dev); 816 816 817 817 return 0; 818 818 }
+3 -3
drivers/staging/iio/adc/lpc32xx_adc.c
··· 141 141 goto errout1; 142 142 } 143 143 144 - iodev = iio_allocate_device(sizeof(struct lpc32xx_adc_info)); 144 + iodev = iio_device_alloc(sizeof(struct lpc32xx_adc_info)); 145 145 if (!iodev) { 146 146 dev_err(&pdev->dev, "failed allocating iio device\n"); 147 147 retval = -ENOMEM; ··· 202 202 errout3: 203 203 iounmap(info->adc_base); 204 204 errout2: 205 - iio_free_device(iodev); 205 + iio_device_free(iodev); 206 206 errout1: 207 207 return retval; 208 208 } ··· 218 218 platform_set_drvdata(pdev, NULL); 219 219 clk_put(info->clk); 220 220 iounmap(info->adc_base); 221 - iio_free_device(iodev); 221 + iio_device_free(iodev); 222 222 223 223 return 0; 224 224 }
+3 -3
drivers/staging/iio/adc/max1363_core.c
··· 1287 1287 if (ret) 1288 1288 goto error_put_reg; 1289 1289 1290 - indio_dev = iio_allocate_device(sizeof(struct max1363_state)); 1290 + indio_dev = iio_device_alloc(sizeof(struct max1363_state)); 1291 1291 if (indio_dev == NULL) { 1292 1292 ret = -ENOMEM; 1293 1293 goto error_disable_reg; ··· 1358 1358 error_unregister_map: 1359 1359 iio_map_array_unregister(indio_dev, client->dev.platform_data); 1360 1360 error_free_device: 1361 - iio_free_device(indio_dev); 1361 + iio_device_free(indio_dev); 1362 1362 error_disable_reg: 1363 1363 regulator_disable(reg); 1364 1364 error_put_reg: ··· 1384 1384 regulator_put(reg); 1385 1385 } 1386 1386 iio_map_array_unregister(indio_dev, client->dev.platform_data); 1387 - iio_free_device(indio_dev); 1387 + iio_device_free(indio_dev); 1388 1388 1389 1389 return 0; 1390 1390 }
+3 -3
drivers/staging/iio/adc/spear_adc.c
··· 300 300 int ret = -ENODEV; 301 301 int irq; 302 302 303 - iodev = iio_allocate_device(sizeof(struct spear_adc_info)); 303 + iodev = iio_device_alloc(sizeof(struct spear_adc_info)); 304 304 if (!iodev) { 305 305 dev_err(dev, "failed allocating iio device\n"); 306 306 ret = -ENOMEM; ··· 404 404 errout3: 405 405 iounmap(info->adc_base_spear6xx); 406 406 errout2: 407 - iio_free_device(iodev); 407 + iio_device_free(iodev); 408 408 errout1: 409 409 return ret; 410 410 } ··· 420 420 clk_unprepare(info->clk); 421 421 clk_put(info->clk); 422 422 iounmap(info->adc_base_spear6xx); 423 - iio_free_device(iodev); 423 + iio_device_free(iodev); 424 424 425 425 return 0; 426 426 }
+3 -3
drivers/staging/iio/addac/adt7316.c
··· 2133 2133 unsigned short *adt7316_platform_data = dev->platform_data; 2134 2134 int ret = 0; 2135 2135 2136 - indio_dev = iio_allocate_device(sizeof(*chip)); 2136 + indio_dev = iio_device_alloc(sizeof(*chip)); 2137 2137 if (indio_dev == NULL) { 2138 2138 ret = -ENOMEM; 2139 2139 goto error_ret; ··· 2210 2210 error_unreg_irq: 2211 2211 free_irq(chip->bus.irq, indio_dev); 2212 2212 error_free_dev: 2213 - iio_free_device(indio_dev); 2213 + iio_device_free(indio_dev); 2214 2214 error_ret: 2215 2215 return ret; 2216 2216 } ··· 2224 2224 iio_device_unregister(indio_dev); 2225 2225 if (chip->bus.irq) 2226 2226 free_irq(chip->bus.irq, indio_dev); 2227 - iio_free_device(indio_dev); 2227 + iio_device_free(indio_dev); 2228 2228 2229 2229 return 0; 2230 2230 }
+3 -3
drivers/staging/iio/cdc/ad7150.c
··· 558 558 struct ad7150_chip_info *chip; 559 559 struct iio_dev *indio_dev; 560 560 561 - indio_dev = iio_allocate_device(sizeof(*chip)); 561 + indio_dev = iio_device_alloc(sizeof(*chip)); 562 562 if (indio_dev == NULL) { 563 563 ret = -ENOMEM; 564 564 goto error_ret; ··· 621 621 if (client->irq) 622 622 free_irq(client->irq, indio_dev); 623 623 error_free_dev: 624 - iio_free_device(indio_dev); 624 + iio_device_free(indio_dev); 625 625 error_ret: 626 626 return ret; 627 627 } ··· 637 637 if (client->dev.platform_data) 638 638 free_irq(*(unsigned int *)client->dev.platform_data, indio_dev); 639 639 640 - iio_free_device(indio_dev); 640 + iio_device_free(indio_dev); 641 641 642 642 return 0; 643 643 }
+3 -3
drivers/staging/iio/cdc/ad7152.c
··· 481 481 struct ad7152_chip_info *chip; 482 482 struct iio_dev *indio_dev; 483 483 484 - indio_dev = iio_allocate_device(sizeof(*chip)); 484 + indio_dev = iio_device_alloc(sizeof(*chip)); 485 485 if (indio_dev == NULL) { 486 486 ret = -ENOMEM; 487 487 goto error_ret; ··· 513 513 return 0; 514 514 515 515 error_free_dev: 516 - iio_free_device(indio_dev); 516 + iio_device_free(indio_dev); 517 517 error_ret: 518 518 return ret; 519 519 } ··· 523 523 struct iio_dev *indio_dev = i2c_get_clientdata(client); 524 524 525 525 iio_device_unregister(indio_dev); 526 - iio_free_device(indio_dev); 526 + iio_device_free(indio_dev); 527 527 528 528 return 0; 529 529 }
+3 -3
drivers/staging/iio/cdc/ad7746.c
··· 703 703 int ret = 0; 704 704 unsigned char regval = 0; 705 705 706 - indio_dev = iio_allocate_device(sizeof(*chip)); 706 + indio_dev = iio_device_alloc(sizeof(*chip)); 707 707 if (indio_dev == NULL) { 708 708 ret = -ENOMEM; 709 709 goto error_ret; ··· 763 763 return 0; 764 764 765 765 error_free_dev: 766 - iio_free_device(indio_dev); 766 + iio_device_free(indio_dev); 767 767 error_ret: 768 768 return ret; 769 769 } ··· 773 773 struct iio_dev *indio_dev = i2c_get_clientdata(client); 774 774 775 775 iio_device_unregister(indio_dev); 776 - iio_free_device(indio_dev); 776 + iio_device_free(indio_dev); 777 777 778 778 return 0; 779 779 }
+3 -3
drivers/staging/iio/dac/ad5064.c
··· 443 443 unsigned int i; 444 444 int ret; 445 445 446 - indio_dev = iio_allocate_device(sizeof(*st)); 446 + indio_dev = iio_device_alloc(sizeof(*st)); 447 447 if (indio_dev == NULL) 448 448 return -ENOMEM; 449 449 ··· 500 500 if (!st->use_internal_vref) 501 501 regulator_bulk_free(ad5064_num_vref(st), st->vref_reg); 502 502 error_free: 503 - iio_free_device(indio_dev); 503 + iio_device_free(indio_dev); 504 504 505 505 return ret; 506 506 } ··· 518 518 regulator_bulk_free(ad5064_num_vref(st), st->vref_reg); 519 519 } 520 520 521 - iio_free_device(indio_dev); 521 + iio_device_free(indio_dev); 522 522 523 523 return 0; 524 524 }
+3 -3
drivers/staging/iio/dac/ad5360.c
··· 465 465 unsigned int i; 466 466 int ret; 467 467 468 - indio_dev = iio_allocate_device(sizeof(*st)); 468 + indio_dev = iio_device_alloc(sizeof(*st)); 469 469 if (indio_dev == NULL) { 470 470 dev_err(&spi->dev, "Failed to allocate iio device\n"); 471 471 return -ENOMEM; ··· 520 520 error_free_channels: 521 521 kfree(indio_dev->channels); 522 522 error_free: 523 - iio_free_device(indio_dev); 523 + iio_device_free(indio_dev); 524 524 525 525 return ret; 526 526 } ··· 537 537 regulator_bulk_disable(st->chip_info->num_vrefs, st->vref_reg); 538 538 regulator_bulk_free(st->chip_info->num_vrefs, st->vref_reg); 539 539 540 - iio_free_device(indio_dev); 540 + iio_device_free(indio_dev); 541 541 542 542 return 0; 543 543 }
+3 -3
drivers/staging/iio/dac/ad5380.c
··· 389 389 unsigned int ctrl = 0; 390 390 int ret; 391 391 392 - indio_dev = iio_allocate_device(sizeof(*st)); 392 + indio_dev = iio_device_alloc(sizeof(*st)); 393 393 if (indio_dev == NULL) { 394 394 dev_err(dev, "Failed to allocate iio device\n"); 395 395 ret = -ENOMEM; ··· 455 455 456 456 kfree(indio_dev->channels); 457 457 error_free: 458 - iio_free_device(indio_dev); 458 + iio_device_free(indio_dev); 459 459 error_regmap_exit: 460 460 regmap_exit(regmap); 461 461 ··· 477 477 } 478 478 479 479 regmap_exit(st->regmap); 480 - iio_free_device(indio_dev); 480 + iio_device_free(indio_dev); 481 481 482 482 return 0; 483 483 }
+3 -3
drivers/staging/iio/dac/ad5421.c
··· 457 457 struct ad5421_state *st; 458 458 int ret; 459 459 460 - indio_dev = iio_allocate_device(sizeof(*st)); 460 + indio_dev = iio_device_alloc(sizeof(*st)); 461 461 if (indio_dev == NULL) { 462 462 dev_err(&spi->dev, "Failed to allocate iio device\n"); 463 463 return -ENOMEM; ··· 512 512 if (spi->irq) 513 513 free_irq(spi->irq, indio_dev); 514 514 error_free: 515 - iio_free_device(indio_dev); 515 + iio_device_free(indio_dev); 516 516 517 517 return ret; 518 518 } ··· 524 524 iio_device_unregister(indio_dev); 525 525 if (spi->irq) 526 526 free_irq(spi->irq, indio_dev); 527 - iio_free_device(indio_dev); 527 + iio_device_free(indio_dev); 528 528 529 529 return 0; 530 530 }
+3 -3
drivers/staging/iio/dac/ad5446.c
··· 296 296 voltage_uv = regulator_get_voltage(reg); 297 297 } 298 298 299 - indio_dev = iio_allocate_device(sizeof(*st)); 299 + indio_dev = iio_device_alloc(sizeof(*st)); 300 300 if (indio_dev == NULL) { 301 301 ret = -ENOMEM; 302 302 goto error_disable_reg; ··· 331 331 return 0; 332 332 333 333 error_free_device: 334 - iio_free_device(indio_dev); 334 + iio_device_free(indio_dev); 335 335 error_disable_reg: 336 336 if (!IS_ERR(reg)) 337 337 regulator_disable(reg); ··· 352 352 regulator_disable(st->reg); 353 353 regulator_put(st->reg); 354 354 } 355 - iio_free_device(indio_dev); 355 + iio_device_free(indio_dev); 356 356 357 357 return 0; 358 358 }
+3 -3
drivers/staging/iio/dac/ad5504.c
··· 288 288 struct regulator *reg; 289 289 int ret, voltage_uv = 0; 290 290 291 - indio_dev = iio_allocate_device(sizeof(*st)); 291 + indio_dev = iio_device_alloc(sizeof(*st)); 292 292 if (indio_dev == NULL) { 293 293 ret = -ENOMEM; 294 294 goto error_ret; ··· 351 351 if (!IS_ERR(reg)) 352 352 regulator_put(reg); 353 353 354 - iio_free_device(indio_dev); 354 + iio_device_free(indio_dev); 355 355 error_ret: 356 356 return ret; 357 357 } ··· 369 369 regulator_disable(st->reg); 370 370 regulator_put(st->reg); 371 371 } 372 - iio_free_device(indio_dev); 372 + iio_device_free(indio_dev); 373 373 374 374 return 0; 375 375 }
+3 -3
drivers/staging/iio/dac/ad5624r_spi.c
··· 256 256 struct iio_dev *indio_dev; 257 257 int ret, voltage_uv = 0; 258 258 259 - indio_dev = iio_allocate_device(sizeof(*st)); 259 + indio_dev = iio_device_alloc(sizeof(*st)); 260 260 if (indio_dev == NULL) { 261 261 ret = -ENOMEM; 262 262 goto error_ret; ··· 306 306 error_put_reg: 307 307 if (!IS_ERR(st->reg)) 308 308 regulator_put(st->reg); 309 - iio_free_device(indio_dev); 309 + iio_device_free(indio_dev); 310 310 error_ret: 311 311 312 312 return ret; ··· 322 322 regulator_disable(st->reg); 323 323 regulator_put(st->reg); 324 324 } 325 - iio_free_device(indio_dev); 325 + iio_device_free(indio_dev); 326 326 327 327 return 0; 328 328 }
+3 -3
drivers/staging/iio/dac/ad5686.c
··· 359 359 struct iio_dev *indio_dev; 360 360 int ret, regdone = 0, voltage_uv = 0; 361 361 362 - indio_dev = iio_allocate_device(sizeof(*st)); 362 + indio_dev = iio_device_alloc(sizeof(*st)); 363 363 if (indio_dev == NULL) 364 364 return -ENOMEM; 365 365 ··· 411 411 if (!IS_ERR(st->reg)) 412 412 regulator_put(st->reg); 413 413 414 - iio_free_device(indio_dev); 414 + iio_device_free(indio_dev); 415 415 416 416 return ret; 417 417 } ··· 426 426 regulator_disable(st->reg); 427 427 regulator_put(st->reg); 428 428 } 429 - iio_free_device(indio_dev); 429 + iio_device_free(indio_dev); 430 430 431 431 return 0; 432 432 }
+3 -3
drivers/staging/iio/dac/ad5764.c
··· 281 281 struct ad5764_state *st; 282 282 int ret; 283 283 284 - indio_dev = iio_allocate_device(sizeof(*st)); 284 + indio_dev = iio_device_alloc(sizeof(*st)); 285 285 if (indio_dev == NULL) { 286 286 dev_err(&spi->dev, "Failed to allocate iio device\n"); 287 287 return -ENOMEM; ··· 336 336 if (st->chip_info->int_vref == 0) 337 337 regulator_bulk_free(ARRAY_SIZE(st->vref_reg), st->vref_reg); 338 338 error_free: 339 - iio_free_device(indio_dev); 339 + iio_device_free(indio_dev); 340 340 341 341 return ret; 342 342 } ··· 353 353 regulator_bulk_free(ARRAY_SIZE(st->vref_reg), st->vref_reg); 354 354 } 355 355 356 - iio_free_device(indio_dev); 356 + iio_device_free(indio_dev); 357 357 358 358 return 0; 359 359 }
+3 -3
drivers/staging/iio/dac/ad5791.c
··· 289 289 struct ad5791_state *st; 290 290 int ret, pos_voltage_uv = 0, neg_voltage_uv = 0; 291 291 292 - indio_dev = iio_allocate_device(sizeof(*st)); 292 + indio_dev = iio_device_alloc(sizeof(*st)); 293 293 if (indio_dev == NULL) { 294 294 ret = -ENOMEM; 295 295 goto error_ret; ··· 369 369 error_put_reg_pos: 370 370 if (!IS_ERR(st->reg_vdd)) 371 371 regulator_put(st->reg_vdd); 372 - iio_free_device(indio_dev); 372 + iio_device_free(indio_dev); 373 373 error_ret: 374 374 375 375 return ret; ··· 390 390 regulator_disable(st->reg_vss); 391 391 regulator_put(st->reg_vss); 392 392 } 393 - iio_free_device(indio_dev); 393 + iio_device_free(indio_dev); 394 394 395 395 return 0; 396 396 }
+3 -3
drivers/staging/iio/dac/max517.c
··· 218 218 struct max517_platform_data *platform_data = client->dev.platform_data; 219 219 int err; 220 220 221 - indio_dev = iio_allocate_device(sizeof(*data)); 221 + indio_dev = iio_device_alloc(sizeof(*data)); 222 222 if (indio_dev == NULL) { 223 223 err = -ENOMEM; 224 224 goto exit; ··· 257 257 return 0; 258 258 259 259 exit_free_device: 260 - iio_free_device(indio_dev); 260 + iio_device_free(indio_dev); 261 261 exit: 262 262 return err; 263 263 } 264 264 265 265 static int max517_remove(struct i2c_client *client) 266 266 { 267 - iio_free_device(i2c_get_clientdata(client)); 267 + iio_device_free(i2c_get_clientdata(client)); 268 268 269 269 return 0; 270 270 }
+3 -3
drivers/staging/iio/dds/ad5930.c
··· 97 97 struct iio_dev *idev; 98 98 int ret = 0; 99 99 100 - idev = iio_allocate_device(sizeof(*st)); 100 + idev = iio_device_alloc(sizeof(*st)); 101 101 if (idev == NULL) { 102 102 ret = -ENOMEM; 103 103 goto error_ret; ··· 122 122 return 0; 123 123 124 124 error_free_dev: 125 - iio_free_device(idev); 125 + iio_device_free(idev); 126 126 error_ret: 127 127 return ret; 128 128 } ··· 130 130 static int __devexit ad5930_remove(struct spi_device *spi) 131 131 { 132 132 iio_device_unregister(spi_get_drvdata(spi)); 133 - iio_free_device(spi_get_drvdata(spi)); 133 + iio_device_free(spi_get_drvdata(spi)); 134 134 135 135 return 0; 136 136 }
+3 -3
drivers/staging/iio/dds/ad9832.c
··· 221 221 goto error_put_reg; 222 222 } 223 223 224 - indio_dev = iio_allocate_device(sizeof(*st)); 224 + indio_dev = iio_device_alloc(sizeof(*st)); 225 225 if (indio_dev == NULL) { 226 226 ret = -ENOMEM; 227 227 goto error_disable_reg; ··· 313 313 return 0; 314 314 315 315 error_free_device: 316 - iio_free_device(indio_dev); 316 + iio_device_free(indio_dev); 317 317 error_disable_reg: 318 318 if (!IS_ERR(reg)) 319 319 regulator_disable(reg); ··· 334 334 regulator_disable(st->reg); 335 335 regulator_put(st->reg); 336 336 } 337 - iio_free_device(indio_dev); 337 + iio_device_free(indio_dev); 338 338 339 339 return 0; 340 340 }
+3 -3
drivers/staging/iio/dds/ad9834.c
··· 334 334 goto error_put_reg; 335 335 } 336 336 337 - indio_dev = iio_allocate_device(sizeof(*st)); 337 + indio_dev = iio_device_alloc(sizeof(*st)); 338 338 if (indio_dev == NULL) { 339 339 ret = -ENOMEM; 340 340 goto error_disable_reg; ··· 414 414 return 0; 415 415 416 416 error_free_device: 417 - iio_free_device(indio_dev); 417 + iio_device_free(indio_dev); 418 418 error_disable_reg: 419 419 if (!IS_ERR(reg)) 420 420 regulator_disable(reg); ··· 434 434 regulator_disable(st->reg); 435 435 regulator_put(st->reg); 436 436 } 437 - iio_free_device(indio_dev); 437 + iio_device_free(indio_dev); 438 438 439 439 return 0; 440 440 }
+3 -3
drivers/staging/iio/dds/ad9850.c
··· 83 83 struct iio_dev *idev; 84 84 int ret = 0; 85 85 86 - idev = iio_allocate_device(sizeof(*st)); 86 + idev = iio_device_alloc(sizeof(*st)); 87 87 if (idev == NULL) { 88 88 ret = -ENOMEM; 89 89 goto error_ret; ··· 108 108 return 0; 109 109 110 110 error_free_dev: 111 - iio_free_device(idev); 111 + iio_device_free(idev); 112 112 error_ret: 113 113 return ret; 114 114 } ··· 116 116 static int __devexit ad9850_remove(struct spi_device *spi) 117 117 { 118 118 iio_device_unregister(spi_get_drvdata(spi)); 119 - iio_free_device(spi_get_drvdata(spi)); 119 + iio_device_free(spi_get_drvdata(spi)); 120 120 121 121 return 0; 122 122 }
+3 -3
drivers/staging/iio/dds/ad9852.c
··· 232 232 struct iio_dev *idev; 233 233 int ret = 0; 234 234 235 - idev = iio_allocate_device(sizeof(*st)); 235 + idev = iio_device_alloc(sizeof(*st)); 236 236 if (idev == NULL) { 237 237 ret = -ENOMEM; 238 238 goto error_ret; ··· 258 258 return 0; 259 259 260 260 error_free_dev: 261 - iio_free_device(idev); 261 + iio_device_free(idev); 262 262 263 263 error_ret: 264 264 return ret; ··· 267 267 static int __devexit ad9852_remove(struct spi_device *spi) 268 268 { 269 269 iio_device_unregister(spi_get_drvdata(spi)); 270 - iio_free_device(spi_get_drvdata(spi)); 270 + iio_device_free(spi_get_drvdata(spi)); 271 271 272 272 return 0; 273 273 }
+3 -3
drivers/staging/iio/dds/ad9910.c
··· 367 367 struct iio_dev *idev; 368 368 int ret = 0; 369 369 370 - idev = iio_allocate_device(sizeof(*st)); 370 + idev = iio_device_alloc(sizeof(*st)); 371 371 if (idev == NULL) { 372 372 ret = -ENOMEM; 373 373 goto error_ret; ··· 392 392 return 0; 393 393 394 394 error_free_dev: 395 - iio_free_device(idev); 395 + iio_device_free(idev); 396 396 error_ret: 397 397 return ret; 398 398 } ··· 400 400 static int __devexit ad9910_remove(struct spi_device *spi) 401 401 { 402 402 iio_device_unregister(spi_get_drvdata(spi)); 403 - iio_free_device(spi_get_drvdata(spi)); 403 + iio_device_free(spi_get_drvdata(spi)); 404 404 405 405 return 0; 406 406 }
+3 -3
drivers/staging/iio/dds/ad9951.c
··· 176 176 struct iio_dev *idev; 177 177 int ret = 0; 178 178 179 - idev = iio_allocate_device(sizeof(*st)); 179 + idev = iio_device_alloc(sizeof(*st)); 180 180 if (idev == NULL) { 181 181 ret = -ENOMEM; 182 182 goto error_ret; ··· 202 202 return 0; 203 203 204 204 error_free_dev: 205 - iio_free_device(idev); 205 + iio_device_free(idev); 206 206 207 207 error_ret: 208 208 return ret; ··· 211 211 static int __devexit ad9951_remove(struct spi_device *spi) 212 212 { 213 213 iio_device_unregister(spi_get_drvdata(spi)); 214 - iio_free_device(spi_get_drvdata(spi)); 214 + iio_device_free(spi_get_drvdata(spi)); 215 215 216 216 return 0; 217 217 }
+3 -3
drivers/staging/iio/gyro/adis16060_core.c
··· 152 152 struct iio_dev *indio_dev; 153 153 154 154 /* setup the industrialio driver allocated elements */ 155 - indio_dev = iio_allocate_device(sizeof(*st)); 155 + indio_dev = iio_device_alloc(sizeof(*st)); 156 156 if (indio_dev == NULL) { 157 157 ret = -ENOMEM; 158 158 goto error_ret; ··· 178 178 return 0; 179 179 180 180 error_free_dev: 181 - iio_free_device(indio_dev); 181 + iio_device_free(indio_dev); 182 182 error_ret: 183 183 return ret; 184 184 } ··· 187 187 static int adis16060_r_remove(struct spi_device *spi) 188 188 { 189 189 iio_device_unregister(spi_get_drvdata(spi)); 190 - iio_free_device(spi_get_drvdata(spi)); 190 + iio_device_free(spi_get_drvdata(spi)); 191 191 192 192 return 0; 193 193 }
+3 -3
drivers/staging/iio/gyro/adis16080_core.c
··· 145 145 struct iio_dev *indio_dev; 146 146 147 147 /* setup the industrialio driver allocated elements */ 148 - indio_dev = iio_allocate_device(sizeof(*st)); 148 + indio_dev = iio_device_alloc(sizeof(*st)); 149 149 if (indio_dev == NULL) { 150 150 ret = -ENOMEM; 151 151 goto error_ret; ··· 171 171 return 0; 172 172 173 173 error_free_dev: 174 - iio_free_device(indio_dev); 174 + iio_device_free(indio_dev); 175 175 error_ret: 176 176 return ret; 177 177 } ··· 180 180 static int adis16080_remove(struct spi_device *spi) 181 181 { 182 182 iio_device_unregister(spi_get_drvdata(spi)); 183 - iio_free_device(spi_get_drvdata(spi)); 183 + iio_device_free(spi_get_drvdata(spi)); 184 184 185 185 return 0; 186 186 }
+3 -3
drivers/staging/iio/gyro/adis16130_core.c
··· 123 123 struct iio_dev *indio_dev; 124 124 125 125 /* setup the industrialio driver allocated elements */ 126 - indio_dev = iio_allocate_device(sizeof(*st)); 126 + indio_dev = iio_device_alloc(sizeof(*st)); 127 127 if (indio_dev == NULL) { 128 128 ret = -ENOMEM; 129 129 goto error_ret; ··· 147 147 return 0; 148 148 149 149 error_free_dev: 150 - iio_free_device(indio_dev); 150 + iio_device_free(indio_dev); 151 151 152 152 error_ret: 153 153 return ret; ··· 157 157 static int adis16130_remove(struct spi_device *spi) 158 158 { 159 159 iio_device_unregister(spi_get_drvdata(spi)); 160 - iio_free_device(spi_get_drvdata(spi)); 160 + iio_device_free(spi_get_drvdata(spi)); 161 161 162 162 return 0; 163 163 }
+3 -3
drivers/staging/iio/gyro/adis16260_core.c
··· 627 627 struct iio_dev *indio_dev; 628 628 629 629 /* setup the industrialio driver allocated elements */ 630 - indio_dev = iio_allocate_device(sizeof(*st)); 630 + indio_dev = iio_device_alloc(sizeof(*st)); 631 631 if (indio_dev == NULL) { 632 632 ret = -ENOMEM; 633 633 goto error_ret; ··· 712 712 error_unreg_ring_funcs: 713 713 adis16260_unconfigure_ring(indio_dev); 714 714 error_free_dev: 715 - iio_free_device(indio_dev); 715 + iio_device_free(indio_dev); 716 716 error_ret: 717 717 return ret; 718 718 } ··· 733 733 adis16260_remove_trigger(indio_dev); 734 734 iio_buffer_unregister(indio_dev); 735 735 adis16260_unconfigure_ring(indio_dev); 736 - iio_free_device(indio_dev); 736 + iio_device_free(indio_dev); 737 737 738 738 err_ret: 739 739 return ret;
+3 -3
drivers/staging/iio/gyro/adis16260_trigger.c
··· 29 29 int ret; 30 30 struct adis16260_state *st = iio_priv(indio_dev); 31 31 32 - st->trig = iio_allocate_trigger("%s-dev%d", 32 + st->trig = iio_trigger_alloc("%s-dev%d", 33 33 spi_get_device_id(st->us)->name, 34 34 indio_dev->id); 35 35 if (st->trig == NULL) { ··· 60 60 error_free_irq: 61 61 free_irq(st->us->irq, st->trig); 62 62 error_free_trig: 63 - iio_free_trigger(st->trig); 63 + iio_trigger_free(st->trig); 64 64 error_ret: 65 65 return ret; 66 66 } ··· 71 71 72 72 iio_trigger_unregister(st->trig); 73 73 free_irq(st->us->irq, st->trig); 74 - iio_free_trigger(st->trig); 74 + iio_trigger_free(st->trig); 75 75 }
+3 -3
drivers/staging/iio/gyro/adxrs450_core.c
··· 372 372 struct iio_dev *indio_dev; 373 373 374 374 /* setup the industrialio driver allocated elements */ 375 - indio_dev = iio_allocate_device(sizeof(*st)); 375 + indio_dev = iio_device_alloc(sizeof(*st)); 376 376 if (indio_dev == NULL) { 377 377 ret = -ENOMEM; 378 378 goto error_ret; ··· 403 403 error_initial: 404 404 iio_device_unregister(indio_dev); 405 405 error_free_dev: 406 - iio_free_device(indio_dev); 406 + iio_device_free(indio_dev); 407 407 408 408 error_ret: 409 409 return ret; ··· 412 412 static int adxrs450_remove(struct spi_device *spi) 413 413 { 414 414 iio_device_unregister(spi_get_drvdata(spi)); 415 - iio_free_device(spi_get_drvdata(spi)); 415 + iio_device_free(spi_get_drvdata(spi)); 416 416 417 417 return 0; 418 418 }
+3 -3
drivers/staging/iio/iio_simple_dummy.c
··· 392 392 * It also has a region (accessed by iio_priv() 393 393 * for chip specific state information. 394 394 */ 395 - indio_dev = iio_allocate_device(sizeof(*st)); 395 + indio_dev = iio_device_alloc(sizeof(*st)); 396 396 if (indio_dev == NULL) { 397 397 ret = -ENOMEM; 398 398 goto error_ret; ··· 472 472 error_free_device: 473 473 /* Note free device should only be called, before registration 474 474 * has succeeded. */ 475 - iio_free_device(indio_dev); 475 + iio_device_free(indio_dev); 476 476 error_ret: 477 477 return ret; 478 478 } ··· 509 509 goto error_ret; 510 510 511 511 /* Free all structures */ 512 - iio_free_device(indio_dev); 512 + iio_device_free(indio_dev); 513 513 514 514 error_ret: 515 515 return ret;
+3 -3
drivers/staging/iio/impedance-analyzer/ad5933.c
··· 705 705 int ret, voltage_uv = 0; 706 706 struct ad5933_platform_data *pdata = client->dev.platform_data; 707 707 struct ad5933_state *st; 708 - struct iio_dev *indio_dev = iio_allocate_device(sizeof(*st)); 708 + struct iio_dev *indio_dev = iio_device_alloc(sizeof(*st)); 709 709 if (indio_dev == NULL) 710 710 return -ENOMEM; 711 711 ··· 784 784 if (!IS_ERR(st->reg)) 785 785 regulator_put(st->reg); 786 786 787 - iio_free_device(indio_dev); 787 + iio_device_free(indio_dev); 788 788 789 789 return ret; 790 790 } ··· 801 801 regulator_disable(st->reg); 802 802 regulator_put(st->reg); 803 803 } 804 - iio_free_device(indio_dev); 804 + iio_device_free(indio_dev); 805 805 806 806 return 0; 807 807 }
+3 -3
drivers/staging/iio/imu/adis16400_core.c
··· 1161 1161 { 1162 1162 int ret; 1163 1163 struct adis16400_state *st; 1164 - struct iio_dev *indio_dev = iio_allocate_device(sizeof(*st)); 1164 + struct iio_dev *indio_dev = iio_device_alloc(sizeof(*st)); 1165 1165 if (indio_dev == NULL) { 1166 1166 ret = -ENOMEM; 1167 1167 goto error_ret; ··· 1218 1218 error_unreg_ring_funcs: 1219 1219 adis16400_unconfigure_ring(indio_dev); 1220 1220 error_free_dev: 1221 - iio_free_device(indio_dev); 1221 + iio_device_free(indio_dev); 1222 1222 error_ret: 1223 1223 return ret; 1224 1224 } ··· 1237 1237 adis16400_remove_trigger(indio_dev); 1238 1238 iio_buffer_unregister(indio_dev); 1239 1239 adis16400_unconfigure_ring(indio_dev); 1240 - iio_free_device(indio_dev); 1240 + iio_device_free(indio_dev); 1241 1241 1242 1242 return 0; 1243 1243
+3 -3
drivers/staging/iio/imu/adis16400_trigger.c
··· 29 29 int ret; 30 30 struct adis16400_state *st = iio_priv(indio_dev); 31 31 32 - st->trig = iio_allocate_trigger("%s-dev%d", 32 + st->trig = iio_trigger_alloc("%s-dev%d", 33 33 indio_dev->name, 34 34 indio_dev->id); 35 35 if (st->trig == NULL) { ··· 59 59 error_free_irq: 60 60 free_irq(st->us->irq, st->trig); 61 61 error_free_trig: 62 - iio_free_trigger(st->trig); 62 + iio_trigger_free(st->trig); 63 63 error_ret: 64 64 return ret; 65 65 } ··· 70 70 71 71 iio_trigger_unregister(st->trig); 72 72 free_irq(st->us->irq, st->trig); 73 - iio_free_trigger(st->trig); 73 + iio_trigger_free(st->trig); 74 74 }
+3 -3
drivers/staging/iio/light/isl29018.c
··· 532 532 struct iio_dev *indio_dev; 533 533 int err; 534 534 535 - indio_dev = iio_allocate_device(sizeof(*chip)); 535 + indio_dev = iio_device_alloc(sizeof(*chip)); 536 536 if (indio_dev == NULL) { 537 537 dev_err(&client->dev, "iio allocation fails\n"); 538 538 err = -ENOMEM; ··· 574 574 575 575 return 0; 576 576 exit_iio_free: 577 - iio_free_device(indio_dev); 577 + iio_device_free(indio_dev); 578 578 exit: 579 579 return err; 580 580 } ··· 585 585 586 586 dev_dbg(&client->dev, "%s()\n", __func__); 587 587 iio_device_unregister(indio_dev); 588 - iio_free_device(indio_dev); 588 + iio_device_free(indio_dev); 589 589 590 590 return 0; 591 591 }
+3 -3
drivers/staging/iio/light/isl29028.c
··· 482 482 struct iio_dev *indio_dev; 483 483 int ret; 484 484 485 - indio_dev = iio_allocate_device(sizeof(*chip)); 485 + indio_dev = iio_device_alloc(sizeof(*chip)); 486 486 if (!indio_dev) { 487 487 dev_err(&client->dev, "iio allocation fails\n"); 488 488 return -ENOMEM; ··· 522 522 return 0; 523 523 524 524 exit_iio_free: 525 - iio_free_device(indio_dev); 525 + iio_device_free(indio_dev); 526 526 return ret; 527 527 } 528 528 ··· 531 531 struct iio_dev *indio_dev = i2c_get_clientdata(client); 532 532 533 533 iio_device_unregister(indio_dev); 534 - iio_free_device(indio_dev); 534 + iio_device_free(indio_dev); 535 535 return 0; 536 536 } 537 537
+3 -3
drivers/staging/iio/light/tsl2563.c
··· 714 714 int err = 0; 715 715 u8 id = 0; 716 716 717 - indio_dev = iio_allocate_device(sizeof(*chip)); 717 + indio_dev = iio_device_alloc(sizeof(*chip)); 718 718 if (!indio_dev) 719 719 return -ENOMEM; 720 720 ··· 801 801 if (client->irq) 802 802 free_irq(client->irq, indio_dev); 803 803 fail1: 804 - iio_free_device(indio_dev); 804 + iio_device_free(indio_dev); 805 805 return err; 806 806 } 807 807 ··· 822 822 if (client->irq) 823 823 free_irq(client->irq, indio_dev); 824 824 825 - iio_free_device(indio_dev); 825 + iio_device_free(indio_dev); 826 826 827 827 return 0; 828 828 }
+3 -3
drivers/staging/iio/light/tsl2583.c
··· 815 815 return -EOPNOTSUPP; 816 816 } 817 817 818 - indio_dev = iio_allocate_device(sizeof(*chip)); 818 + indio_dev = iio_device_alloc(sizeof(*chip)); 819 819 if (indio_dev == NULL) { 820 820 ret = -ENOMEM; 821 821 dev_err(&clientp->dev, "iio allocation failed\n"); ··· 879 879 dev_info(&clientp->dev, "Light sensor found.\n"); 880 880 return 0; 881 881 fail1: 882 - iio_free_device(indio_dev); 882 + iio_device_free(indio_dev); 883 883 fail2: 884 884 return ret; 885 885 } ··· 926 926 static int __devexit taos_remove(struct i2c_client *client) 927 927 { 928 928 iio_device_unregister(i2c_get_clientdata(client)); 929 - iio_free_device(i2c_get_clientdata(client)); 929 + iio_device_free(i2c_get_clientdata(client)); 930 930 931 931 return 0; 932 932 }
+3 -3
drivers/staging/iio/light/tsl2x7x_core.c
··· 1906 1906 struct iio_dev *indio_dev; 1907 1907 struct tsl2X7X_chip *chip; 1908 1908 1909 - indio_dev = iio_allocate_device(sizeof(*chip)); 1909 + indio_dev = iio_device_alloc(sizeof(*chip)); 1910 1910 if (!indio_dev) 1911 1911 return -ENOMEM; 1912 1912 ··· 1986 1986 if (clientp->irq) 1987 1987 free_irq(clientp->irq, indio_dev); 1988 1988 fail2: 1989 - iio_free_device(indio_dev); 1989 + iio_device_free(indio_dev); 1990 1990 1991 1991 return ret; 1992 1992 } ··· 2038 2038 if (client->irq) 2039 2039 free_irq(client->irq, chip->client->name); 2040 2040 2041 - iio_free_device(indio_dev); 2041 + iio_device_free(indio_dev); 2042 2042 2043 2043 return 0; 2044 2044 }
+3 -3
drivers/staging/iio/magnetometer/ak8975.c
··· 504 504 } 505 505 506 506 /* Register with IIO */ 507 - indio_dev = iio_allocate_device(sizeof(*data)); 507 + indio_dev = iio_device_alloc(sizeof(*data)); 508 508 if (indio_dev == NULL) { 509 509 err = -ENOMEM; 510 510 goto exit_gpio; ··· 535 535 return 0; 536 536 537 537 exit_free_iio: 538 - iio_free_device(indio_dev); 538 + iio_device_free(indio_dev); 539 539 exit_gpio: 540 540 if (gpio_is_valid(eoc_gpio)) 541 541 gpio_free(eoc_gpio); ··· 553 553 if (gpio_is_valid(data->eoc_gpio)) 554 554 gpio_free(data->eoc_gpio); 555 555 556 - iio_free_device(indio_dev); 556 + iio_device_free(indio_dev); 557 557 558 558 return 0; 559 559 }
+3 -3
drivers/staging/iio/magnetometer/hmc5843.c
··· 544 544 struct iio_dev *indio_dev; 545 545 int err = 0; 546 546 547 - indio_dev = iio_allocate_device(sizeof(*data)); 547 + indio_dev = iio_device_alloc(sizeof(*data)); 548 548 if (indio_dev == NULL) { 549 549 err = -ENOMEM; 550 550 goto exit; ··· 572 572 goto exit_free2; 573 573 return 0; 574 574 exit_free2: 575 - iio_free_device(indio_dev); 575 + iio_device_free(indio_dev); 576 576 exit: 577 577 return err; 578 578 } ··· 584 584 iio_device_unregister(indio_dev); 585 585 /* sleep mode to save power */ 586 586 hmc5843_configure(client, MODE_SLEEP); 587 - iio_free_device(indio_dev); 587 + iio_device_free(indio_dev); 588 588 589 589 return 0; 590 590 }
+3 -3
drivers/staging/iio/meter/ade7753.c
··· 517 517 struct iio_dev *indio_dev; 518 518 519 519 /* setup the industrialio driver allocated elements */ 520 - indio_dev = iio_allocate_device(sizeof(*st)); 520 + indio_dev = iio_device_alloc(sizeof(*st)); 521 521 if (indio_dev == NULL) { 522 522 ret = -ENOMEM; 523 523 goto error_ret; ··· 546 546 return 0; 547 547 548 548 error_free_dev: 549 - iio_free_device(indio_dev); 549 + iio_device_free(indio_dev); 550 550 551 551 error_ret: 552 552 return ret; ··· 564 564 if (ret) 565 565 goto err_ret; 566 566 567 - iio_free_device(indio_dev); 567 + iio_device_free(indio_dev); 568 568 err_ret: 569 569 return ret; 570 570 }
+3 -3
drivers/staging/iio/meter/ade7754.c
··· 540 540 struct iio_dev *indio_dev; 541 541 542 542 /* setup the industrialio driver allocated elements */ 543 - indio_dev = iio_allocate_device(sizeof(*st)); 543 + indio_dev = iio_device_alloc(sizeof(*st)); 544 544 if (indio_dev == NULL) { 545 545 ret = -ENOMEM; 546 546 goto error_ret; ··· 568 568 return 0; 569 569 570 570 error_free_dev: 571 - iio_free_device(indio_dev); 571 + iio_device_free(indio_dev); 572 572 573 573 error_ret: 574 574 return ret; ··· 585 585 if (ret) 586 586 goto err_ret; 587 587 588 - iio_free_device(indio_dev); 588 + iio_device_free(indio_dev); 589 589 590 590 err_ret: 591 591 return ret;
+3 -3
drivers/staging/iio/meter/ade7758_core.c
··· 885 885 { 886 886 int i, ret; 887 887 struct ade7758_state *st; 888 - struct iio_dev *indio_dev = iio_allocate_device(sizeof(*st)); 888 + struct iio_dev *indio_dev = iio_device_alloc(sizeof(*st)); 889 889 890 890 if (indio_dev == NULL) { 891 891 ret = -ENOMEM; ··· 962 962 error_free_rx: 963 963 kfree(st->rx); 964 964 error_free_dev: 965 - iio_free_device(indio_dev); 965 + iio_device_free(indio_dev); 966 966 error_ret: 967 967 return ret; 968 968 } ··· 984 984 kfree(st->tx); 985 985 kfree(st->rx); 986 986 987 - iio_free_device(indio_dev); 987 + iio_device_free(indio_dev); 988 988 989 989 err_ret: 990 990 return ret;
+3 -3
drivers/staging/iio/meter/ade7758_trigger.c
··· 63 63 struct ade7758_state *st = iio_priv(indio_dev); 64 64 int ret; 65 65 66 - st->trig = iio_allocate_trigger("%s-dev%d", 66 + st->trig = iio_trigger_alloc("%s-dev%d", 67 67 spi_get_device_id(st->us)->name, 68 68 indio_dev->id); 69 69 if (st->trig == NULL) { ··· 94 94 error_free_irq: 95 95 free_irq(st->us->irq, st->trig); 96 96 error_free_trig: 97 - iio_free_trigger(st->trig); 97 + iio_trigger_free(st->trig); 98 98 error_ret: 99 99 return ret; 100 100 } ··· 105 105 106 106 iio_trigger_unregister(st->trig); 107 107 free_irq(st->us->irq, st->trig); 108 - iio_free_trigger(st->trig); 108 + iio_trigger_free(st->trig); 109 109 }
+3 -3
drivers/staging/iio/meter/ade7759.c
··· 463 463 struct iio_dev *indio_dev; 464 464 465 465 /* setup the industrialio driver allocated elements */ 466 - indio_dev = iio_allocate_device(sizeof(*st)); 466 + indio_dev = iio_device_alloc(sizeof(*st)); 467 467 if (indio_dev == NULL) { 468 468 ret = -ENOMEM; 469 469 goto error_ret; ··· 491 491 return 0; 492 492 493 493 error_free_dev: 494 - iio_free_device(indio_dev); 494 + iio_device_free(indio_dev); 495 495 error_ret: 496 496 return ret; 497 497 } ··· 507 507 if (ret) 508 508 goto err_ret; 509 509 510 - iio_free_device(indio_dev); 510 + iio_device_free(indio_dev); 511 511 512 512 err_ret: 513 513 return ret;
+2 -2
drivers/staging/iio/meter/ade7854-i2c.c
··· 208 208 struct ade7854_state *st; 209 209 struct iio_dev *indio_dev; 210 210 211 - indio_dev = iio_allocate_device(sizeof(*st)); 211 + indio_dev = iio_device_alloc(sizeof(*st)); 212 212 if (indio_dev == NULL) 213 213 return -ENOMEM; 214 214 st = iio_priv(indio_dev); ··· 226 226 227 227 ret = ade7854_probe(indio_dev, &client->dev); 228 228 if (ret) 229 - iio_free_device(indio_dev); 229 + iio_device_free(indio_dev); 230 230 231 231 return ret; 232 232 }
+2 -2
drivers/staging/iio/meter/ade7854-spi.c
··· 306 306 struct ade7854_state *st; 307 307 struct iio_dev *indio_dev; 308 308 309 - indio_dev = iio_allocate_device(sizeof(*st)); 309 + indio_dev = iio_device_alloc(sizeof(*st)); 310 310 if (indio_dev == NULL) 311 311 return -ENOMEM; 312 312 st = iio_priv(indio_dev); ··· 325 325 326 326 ret = ade7854_probe(indio_dev, &spi->dev); 327 327 if (ret) 328 - iio_free_device(indio_dev); 328 + iio_device_free(indio_dev); 329 329 330 330 return 0; 331 331 }
+2 -2
drivers/staging/iio/meter/ade7854.c
··· 581 581 error_unreg_dev: 582 582 iio_device_unregister(indio_dev); 583 583 error_free_dev: 584 - iio_free_device(indio_dev); 584 + iio_device_free(indio_dev); 585 585 586 586 return ret; 587 587 } ··· 590 590 int ade7854_remove(struct iio_dev *indio_dev) 591 591 { 592 592 iio_device_unregister(indio_dev); 593 - iio_free_device(indio_dev); 593 + iio_device_free(indio_dev); 594 594 595 595 return 0; 596 596 }
+3 -3
drivers/staging/iio/resolver/ad2s1200.c
··· 112 112 DRV_NAME, pins[pn]); 113 113 goto error_ret; 114 114 } 115 - indio_dev = iio_allocate_device(sizeof(*st)); 115 + indio_dev = iio_device_alloc(sizeof(*st)); 116 116 if (indio_dev == NULL) { 117 117 ret = -ENOMEM; 118 118 goto error_ret; ··· 142 142 return 0; 143 143 144 144 error_free_dev: 145 - iio_free_device(indio_dev); 145 + iio_device_free(indio_dev); 146 146 error_ret: 147 147 for (--pn; pn >= 0; pn--) 148 148 gpio_free(pins[pn]); ··· 152 152 static int __devexit ad2s1200_remove(struct spi_device *spi) 153 153 { 154 154 iio_device_unregister(spi_get_drvdata(spi)); 155 - iio_free_device(spi_get_drvdata(spi)); 155 + iio_device_free(spi_get_drvdata(spi)); 156 156 157 157 return 0; 158 158 }
+3 -3
drivers/staging/iio/resolver/ad2s1210.c
··· 690 690 if (spi->dev.platform_data == NULL) 691 691 return -EINVAL; 692 692 693 - indio_dev = iio_allocate_device(sizeof(*st)); 693 + indio_dev = iio_device_alloc(sizeof(*st)); 694 694 if (indio_dev == NULL) { 695 695 ret = -ENOMEM; 696 696 goto error_ret; ··· 731 731 error_free_gpios: 732 732 ad2s1210_free_gpios(st); 733 733 error_free_dev: 734 - iio_free_device(indio_dev); 734 + iio_device_free(indio_dev); 735 735 error_ret: 736 736 return ret; 737 737 } ··· 742 742 743 743 iio_device_unregister(indio_dev); 744 744 ad2s1210_free_gpios(iio_priv(indio_dev)); 745 - iio_free_device(indio_dev); 745 + iio_device_free(indio_dev); 746 746 747 747 return 0; 748 748 }
+3 -3
drivers/staging/iio/resolver/ad2s90.c
··· 64 64 struct ad2s90_state *st; 65 65 int ret = 0; 66 66 67 - indio_dev = iio_allocate_device(sizeof(*st)); 67 + indio_dev = iio_device_alloc(sizeof(*st)); 68 68 if (indio_dev == NULL) { 69 69 ret = -ENOMEM; 70 70 goto error_ret; ··· 93 93 return 0; 94 94 95 95 error_free_dev: 96 - iio_free_device(indio_dev); 96 + iio_device_free(indio_dev); 97 97 error_ret: 98 98 return ret; 99 99 } ··· 101 101 static int __devexit ad2s90_remove(struct spi_device *spi) 102 102 { 103 103 iio_device_unregister(spi_get_drvdata(spi)); 104 - iio_free_device(spi_get_drvdata(spi)); 104 + iio_device_free(spi_get_drvdata(spi)); 105 105 106 106 return 0; 107 107 }
+3 -3
drivers/staging/iio/trigger/iio-trig-bfin-timer.c
··· 172 172 st->timer_num = ret; 173 173 st->t = &iio_bfin_timer_code[st->timer_num]; 174 174 175 - st->trig = iio_allocate_trigger("bfintmr%d", st->timer_num); 175 + st->trig = iio_trigger_alloc("bfintmr%d", st->timer_num); 176 176 if (!st->trig) { 177 177 ret = -ENOMEM; 178 178 goto out1; ··· 203 203 out4: 204 204 iio_trigger_unregister(st->trig); 205 205 out2: 206 - iio_put_trigger(st->trig); 206 + iio_trigger_put(st->trig); 207 207 out1: 208 208 kfree(st); 209 209 out: ··· 217 217 disable_gptimers(st->t->bit); 218 218 free_irq(st->irq, st); 219 219 iio_trigger_unregister(st->trig); 220 - iio_put_trigger(st->trig); 220 + iio_trigger_put(st->trig); 221 221 kfree(st); 222 222 223 223 return 0;
+3 -3
drivers/staging/iio/trigger/iio-trig-gpio.c
··· 72 72 73 73 for (irq = irq_res->start; irq <= irq_res->end; irq++) { 74 74 75 - trig = iio_allocate_trigger("irqtrig%d", irq); 75 + trig = iio_trigger_alloc("irqtrig%d", irq); 76 76 if (!trig) { 77 77 ret = -ENOMEM; 78 78 goto error_free_completed_registrations; ··· 114 114 error_free_trig_info: 115 115 kfree(trig_info); 116 116 error_put_trigger: 117 - iio_put_trigger(trig); 117 + iio_trigger_put(trig); 118 118 error_free_completed_registrations: 119 119 /* The rest should have been added to the iio_gpio_trigger_list */ 120 120 list_for_each_entry_safe(trig, ··· 144 144 iio_trigger_unregister(trig); 145 145 free_irq(trig_info->irq, trig); 146 146 kfree(trig_info); 147 - iio_put_trigger(trig); 147 + iio_trigger_put(trig); 148 148 } 149 149 mutex_unlock(&iio_gpio_trigger_list_lock); 150 150
+2 -2
drivers/staging/iio/trigger/iio-trig-periodic-rtc.c
··· 112 112 for (i = 0;; i++) { 113 113 if (pdata[i] == NULL) 114 114 break; 115 - trig = iio_allocate_trigger("periodic%s", pdata[i]); 115 + trig = iio_trigger_alloc("periodic%s", pdata[i]); 116 116 if (!trig) { 117 117 ret = -ENOMEM; 118 118 goto error_free_completed_registrations; ··· 152 152 kfree(trig_info); 153 153 error_put_trigger_and_remove_from_list: 154 154 list_del(&trig->alloc_list); 155 - iio_put_trigger(trig); 155 + iio_trigger_put(trig); 156 156 error_free_completed_registrations: 157 157 list_for_each_entry_safe(trig, 158 158 trig2,
+3 -3
drivers/staging/iio/trigger/iio-trig-sysfs.c
··· 139 139 goto out1; 140 140 } 141 141 t->id = id; 142 - t->trig = iio_allocate_trigger("sysfstrig%d", id); 142 + t->trig = iio_trigger_alloc("sysfstrig%d", id); 143 143 if (!t->trig) { 144 144 ret = -ENOMEM; 145 145 goto free_t; ··· 158 158 return 0; 159 159 160 160 out2: 161 - iio_put_trigger(t->trig); 161 + iio_trigger_put(t->trig); 162 162 free_t: 163 163 kfree(t); 164 164 out1: ··· 182 182 } 183 183 184 184 iio_trigger_unregister(t->trig); 185 - iio_free_trigger(t->trig); 185 + iio_trigger_free(t->trig); 186 186 187 187 list_del(&t->l); 188 188 kfree(t);
+6 -6
include/linux/iio/iio.h
··· 400 400 extern struct bus_type iio_bus_type; 401 401 402 402 /** 403 - * iio_put_device() - reference counted deallocation of struct device 403 + * iio_device_put() - reference counted deallocation of struct device 404 404 * @dev: the iio_device containing the device 405 405 **/ 406 - static inline void iio_put_device(struct iio_dev *indio_dev) 406 + static inline void iio_device_put(struct iio_dev *indio_dev) 407 407 { 408 408 if (indio_dev) 409 409 put_device(&indio_dev->dev); ··· 412 412 /* Can we make this smaller? */ 413 413 #define IIO_ALIGN L1_CACHE_BYTES 414 414 /** 415 - * iio_allocate_device() - allocate an iio_dev from a driver 415 + * iio_device_alloc() - allocate an iio_dev from a driver 416 416 * @sizeof_priv: Space to allocate for private structure. 417 417 **/ 418 - struct iio_dev *iio_allocate_device(int sizeof_priv); 418 + struct iio_dev *iio_device_alloc(int sizeof_priv); 419 419 420 420 static inline void *iio_priv(const struct iio_dev *indio_dev) 421 421 { ··· 429 429 } 430 430 431 431 /** 432 - * iio_free_device() - free an iio_dev from a driver 432 + * iio_device_free() - free an iio_dev from a driver 433 433 * @dev: the iio_dev associated with the device 434 434 **/ 435 - void iio_free_device(struct iio_dev *indio_dev); 435 + void iio_device_free(struct iio_dev *indio_dev); 436 436 437 437 /** 438 438 * iio_buffer_enabled() - helper function to test if the buffer is enabled
+4 -4
include/linux/iio/trigger.h
··· 78 78 return container_of(d, struct iio_trigger, dev); 79 79 }; 80 80 81 - static inline void iio_put_trigger(struct iio_trigger *trig) 81 + static inline void iio_trigger_put(struct iio_trigger *trig) 82 82 { 83 83 module_put(trig->ops->owner); 84 84 put_device(&trig->dev); 85 85 }; 86 86 87 - static inline void iio_get_trigger(struct iio_trigger *trig) 87 + static inline void iio_trigger_get(struct iio_trigger *trig) 88 88 { 89 89 get_device(&trig->dev); 90 90 __module_get(trig->ops->owner); ··· 113 113 114 114 irqreturn_t iio_trigger_generic_data_rdy_poll(int irq, void *private); 115 115 116 - __printf(1, 2) struct iio_trigger *iio_allocate_trigger(const char *fmt, ...); 117 - void iio_free_trigger(struct iio_trigger *trig); 116 + __printf(1, 2) struct iio_trigger *iio_trigger_alloc(const char *fmt, ...); 117 + void iio_trigger_free(struct iio_trigger *trig); 118 118 119 119 #endif /* _IIO_TRIGGER_H_ */