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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'staging-3.18-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging driver fixes from Greg KH:
"Here are some staging/iio fixes for 3.18-rc4.

Nothing major, just a few bugfixes of things that have been reported"

* tag 'staging-3.18-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
staging:iio:ade7758: Remove "raw" from channel name
staging:iio:ade7758: Fix check if channels are enabled in prenable
staging:iio:ade7758: Fix NULL pointer deref when enabling buffer
iio: as3935: allocate correct iio_device size
io: accel: kxcjk-1013: Fix iio_event_spec direction
iio: tsl4531: Fix compiler error when CONFIG_PM_OPS is not defined
iio: adc: mxs-lradc: Disable the clock on probe failure
iio: st_sensors: Fix buffer copy
staging:iio:ad5933: Drop "raw" from channel names
staging:iio:ad5933: Fix NULL pointer deref when enabling buffer

+20 -54
+1 -1
drivers/iio/accel/kxcjk-1013.c
··· 894 894 895 895 static const struct iio_event_spec kxcjk1013_event = { 896 896 .type = IIO_EV_TYPE_THRESH, 897 - .dir = IIO_EV_DIR_RISING | IIO_EV_DIR_FALLING, 897 + .dir = IIO_EV_DIR_EITHER, 898 898 .mask_separate = BIT(IIO_EV_INFO_VALUE) | 899 899 BIT(IIO_EV_INFO_ENABLE) | 900 900 BIT(IIO_EV_INFO_PERIOD)
+5 -2
drivers/iio/light/tsl4531.c
··· 230 230 return i2c_smbus_write_byte_data(to_i2c_client(dev), TSL4531_CONTROL, 231 231 TSL4531_MODE_NORMAL); 232 232 } 233 - #endif 234 233 235 234 static SIMPLE_DEV_PM_OPS(tsl4531_pm_ops, tsl4531_suspend, tsl4531_resume); 235 + #define TSL4531_PM_OPS (&tsl4531_pm_ops) 236 + #else 237 + #define TSL4531_PM_OPS NULL 238 + #endif 236 239 237 240 static const struct i2c_device_id tsl4531_id[] = { 238 241 { "tsl4531", 0 }, ··· 246 243 static struct i2c_driver tsl4531_driver = { 247 244 .driver = { 248 245 .name = TSL4531_DRV_NAME, 249 - .pm = &tsl4531_pm_ops, 246 + .pm = TSL4531_PM_OPS, 250 247 .owner = THIS_MODULE, 251 248 }, 252 249 .probe = tsl4531_probe,
+1 -1
drivers/iio/proximity/as3935.c
··· 330 330 return -EINVAL; 331 331 } 332 332 333 - indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(st)); 333 + indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st)); 334 334 if (!indio_dev) 335 335 return -ENOMEM; 336 336
-1
drivers/staging/iio/meter/ade7758.h
··· 119 119 u8 *tx; 120 120 u8 *rx; 121 121 struct mutex buf_lock; 122 - const struct iio_chan_spec *ade7758_ring_channels; 123 122 struct spi_transfer ring_xfer[4]; 124 123 struct spi_message ring_msg; 125 124 /*
+11 -46
drivers/staging/iio/meter/ade7758_core.c
··· 634 634 .type = IIO_VOLTAGE, 635 635 .indexed = 1, 636 636 .channel = 0, 637 - .extend_name = "raw", 638 - .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), 639 - .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), 640 637 .address = AD7758_WT(AD7758_PHASE_A, AD7758_VOLTAGE), 641 638 .scan_index = 0, 642 639 .scan_type = { ··· 645 648 .type = IIO_CURRENT, 646 649 .indexed = 1, 647 650 .channel = 0, 648 - .extend_name = "raw", 649 - .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), 650 - .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), 651 651 .address = AD7758_WT(AD7758_PHASE_A, AD7758_CURRENT), 652 652 .scan_index = 1, 653 653 .scan_type = { ··· 656 662 .type = IIO_POWER, 657 663 .indexed = 1, 658 664 .channel = 0, 659 - .extend_name = "apparent_raw", 660 - .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), 661 - .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), 665 + .extend_name = "apparent", 662 666 .address = AD7758_WT(AD7758_PHASE_A, AD7758_APP_PWR), 663 667 .scan_index = 2, 664 668 .scan_type = { ··· 668 676 .type = IIO_POWER, 669 677 .indexed = 1, 670 678 .channel = 0, 671 - .extend_name = "active_raw", 672 - .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), 673 - .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), 679 + .extend_name = "active", 674 680 .address = AD7758_WT(AD7758_PHASE_A, AD7758_ACT_PWR), 675 681 .scan_index = 3, 676 682 .scan_type = { ··· 680 690 .type = IIO_POWER, 681 691 .indexed = 1, 682 692 .channel = 0, 683 - .extend_name = "reactive_raw", 684 - .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), 685 - .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), 693 + .extend_name = "reactive", 686 694 .address = AD7758_WT(AD7758_PHASE_A, AD7758_REACT_PWR), 687 695 .scan_index = 4, 688 696 .scan_type = { ··· 692 704 .type = IIO_VOLTAGE, 693 705 .indexed = 1, 694 706 .channel = 1, 695 - .extend_name = "raw", 696 - .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), 697 - .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), 698 707 .address = AD7758_WT(AD7758_PHASE_B, AD7758_VOLTAGE), 699 708 .scan_index = 5, 700 709 .scan_type = { ··· 703 718 .type = IIO_CURRENT, 704 719 .indexed = 1, 705 720 .channel = 1, 706 - .extend_name = "raw", 707 - .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), 708 - .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), 709 721 .address = AD7758_WT(AD7758_PHASE_B, AD7758_CURRENT), 710 722 .scan_index = 6, 711 723 .scan_type = { ··· 714 732 .type = IIO_POWER, 715 733 .indexed = 1, 716 734 .channel = 1, 717 - .extend_name = "apparent_raw", 718 - .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), 719 - .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), 735 + .extend_name = "apparent", 720 736 .address = AD7758_WT(AD7758_PHASE_B, AD7758_APP_PWR), 721 737 .scan_index = 7, 722 738 .scan_type = { ··· 726 746 .type = IIO_POWER, 727 747 .indexed = 1, 728 748 .channel = 1, 729 - .extend_name = "active_raw", 730 - .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), 731 - .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), 749 + .extend_name = "active", 732 750 .address = AD7758_WT(AD7758_PHASE_B, AD7758_ACT_PWR), 733 751 .scan_index = 8, 734 752 .scan_type = { ··· 738 760 .type = IIO_POWER, 739 761 .indexed = 1, 740 762 .channel = 1, 741 - .extend_name = "reactive_raw", 742 - .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), 743 - .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), 763 + .extend_name = "reactive", 744 764 .address = AD7758_WT(AD7758_PHASE_B, AD7758_REACT_PWR), 745 765 .scan_index = 9, 746 766 .scan_type = { ··· 750 774 .type = IIO_VOLTAGE, 751 775 .indexed = 1, 752 776 .channel = 2, 753 - .extend_name = "raw", 754 - .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), 755 - .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), 756 777 .address = AD7758_WT(AD7758_PHASE_C, AD7758_VOLTAGE), 757 778 .scan_index = 10, 758 779 .scan_type = { ··· 761 788 .type = IIO_CURRENT, 762 789 .indexed = 1, 763 790 .channel = 2, 764 - .extend_name = "raw", 765 - .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), 766 - .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), 767 791 .address = AD7758_WT(AD7758_PHASE_C, AD7758_CURRENT), 768 792 .scan_index = 11, 769 793 .scan_type = { ··· 772 802 .type = IIO_POWER, 773 803 .indexed = 1, 774 804 .channel = 2, 775 - .extend_name = "apparent_raw", 776 - .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), 777 - .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), 805 + .extend_name = "apparent", 778 806 .address = AD7758_WT(AD7758_PHASE_C, AD7758_APP_PWR), 779 807 .scan_index = 12, 780 808 .scan_type = { ··· 784 816 .type = IIO_POWER, 785 817 .indexed = 1, 786 818 .channel = 2, 787 - .extend_name = "active_raw", 788 - .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), 789 - .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), 819 + .extend_name = "active", 790 820 .address = AD7758_WT(AD7758_PHASE_C, AD7758_ACT_PWR), 791 821 .scan_index = 13, 792 822 .scan_type = { ··· 796 830 .type = IIO_POWER, 797 831 .indexed = 1, 798 832 .channel = 2, 799 - .extend_name = "reactive_raw", 800 - .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), 801 - .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), 833 + .extend_name = "reactive", 802 834 .address = AD7758_WT(AD7758_PHASE_C, AD7758_REACT_PWR), 803 835 .scan_index = 14, 804 836 .scan_type = { ··· 837 873 goto error_free_rx; 838 874 } 839 875 st->us = spi; 840 - st->ade7758_ring_channels = &ade7758_channels[0]; 841 876 mutex_init(&st->buf_lock); 842 877 843 878 indio_dev->name = spi->dev.driver->name; 844 879 indio_dev->dev.parent = &spi->dev; 845 880 indio_dev->info = &ade7758_info; 846 881 indio_dev->modes = INDIO_DIRECT_MODE; 882 + indio_dev->channels = ade7758_channels; 883 + indio_dev->num_channels = ARRAY_SIZE(ade7758_channels); 847 884 848 885 ret = ade7758_configure_ring(indio_dev); 849 886 if (ret)
+2 -3
drivers/staging/iio/meter/ade7758_ring.c
··· 85 85 **/ 86 86 static int ade7758_ring_preenable(struct iio_dev *indio_dev) 87 87 { 88 - struct ade7758_state *st = iio_priv(indio_dev); 89 88 unsigned channel; 90 89 91 - if (!bitmap_empty(indio_dev->active_scan_mask, indio_dev->masklength)) 90 + if (bitmap_empty(indio_dev->active_scan_mask, indio_dev->masklength)) 92 91 return -EINVAL; 93 92 94 93 channel = find_first_bit(indio_dev->active_scan_mask, 95 94 indio_dev->masklength); 96 95 97 96 ade7758_write_waveform_type(&indio_dev->dev, 98 - st->ade7758_ring_channels[channel].address); 97 + indio_dev->channels[channel].address); 99 98 100 99 return 0; 101 100 }