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.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging / IIO driver fixes from Greg KH:
"Here are some small staging and IIO driver fixes for 3.15-rc3.

Nothing major at all, just some assorted issues that people have
reported"

* tag 'staging-3.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
staging: comedi: usbdux: bug fix for accessing 'ao_chanlist' in private data
iio: adc: mxs-lradc: fix warning when buidling on avr32
iio: cm36651: Fix i2c client leak and possible NULL pointer dereference
iio: querying buffer scan_mask should return 0/1
staging:iio:ad2s1200 fix a missing break
iio: adc: at91_adc: correct default shtim value
ARM: at91: at91sam9260: change at91_adc name
ARM: at91: at91sam9g45: change at91_adc name
iio: cm32181: Fix read integration time function
iio: adc: at91_adc: Repair broken platform_data support

+59 -19
+1 -1
arch/arm/mach-at91/at91sam9260_devices.c
··· 1296 1296 }; 1297 1297 1298 1298 static struct platform_device at91_adc_device = { 1299 - .name = "at91_adc", 1299 + .name = "at91sam9260-adc", 1300 1300 .id = -1, 1301 1301 .dev = { 1302 1302 .platform_data = &adc_data,
+1 -1
arch/arm/mach-at91/at91sam9g45_devices.c
··· 1204 1204 }; 1205 1205 1206 1206 static struct platform_device at91_adc_device = { 1207 - .name = "at91_adc", 1207 + .name = "at91sam9g45-adc", 1208 1208 .id = -1, 1209 1209 .dev = { 1210 1210 .platform_data = &adc_data,
+27 -6
drivers/iio/adc/at91_adc.c
··· 765 765 if (!pdata) 766 766 return -EINVAL; 767 767 768 + st->caps = (struct at91_adc_caps *) 769 + platform_get_device_id(pdev)->driver_data; 770 + 768 771 st->use_external = pdata->use_external_triggers; 769 772 st->vref_mv = pdata->vref; 770 773 st->channels_mask = pdata->channels_used; 771 - st->num_channels = pdata->num_channels; 774 + st->num_channels = st->caps->num_channels; 772 775 st->startup_time = pdata->startup_time; 773 776 st->trigger_number = pdata->trigger_number; 774 777 st->trigger_list = pdata->trigger_list; 775 - st->registers = pdata->registers; 778 + st->registers = &st->caps->registers; 776 779 777 780 return 0; 778 781 } ··· 1007 1004 * the best converted final value between two channels selection 1008 1005 * The formula thus is : Sample and Hold Time = (shtim + 1) / ADCClock 1009 1006 */ 1010 - shtim = round_up((st->sample_hold_time * adc_clk_khz / 1011 - 1000) - 1, 1); 1007 + if (st->sample_hold_time > 0) 1008 + shtim = round_up((st->sample_hold_time * adc_clk_khz / 1000) 1009 + - 1, 1); 1010 + else 1011 + shtim = 0; 1012 1012 1013 1013 reg = AT91_ADC_PRESCAL_(prsc) & st->registers->mr_prescal_mask; 1014 1014 reg |= AT91_ADC_STARTUP_(ticks) & st->registers->mr_startup_mask; ··· 1107 1101 return 0; 1108 1102 } 1109 1103 1110 - #ifdef CONFIG_OF 1111 1104 static struct at91_adc_caps at91sam9260_caps = { 1112 1105 .calc_startup_ticks = calc_startup_ticks_9260, 1113 1106 .num_channels = 4, ··· 1159 1154 {}, 1160 1155 }; 1161 1156 MODULE_DEVICE_TABLE(of, at91_adc_dt_ids); 1162 - #endif 1157 + 1158 + static const struct platform_device_id at91_adc_ids[] = { 1159 + { 1160 + .name = "at91sam9260-adc", 1161 + .driver_data = (unsigned long)&at91sam9260_caps, 1162 + }, { 1163 + .name = "at91sam9g45-adc", 1164 + .driver_data = (unsigned long)&at91sam9g45_caps, 1165 + }, { 1166 + .name = "at91sam9x5-adc", 1167 + .driver_data = (unsigned long)&at91sam9x5_caps, 1168 + }, { 1169 + /* terminator */ 1170 + } 1171 + }; 1172 + MODULE_DEVICE_TABLE(platform, at91_adc_ids); 1163 1173 1164 1174 static struct platform_driver at91_adc_driver = { 1165 1175 .probe = at91_adc_probe, 1166 1176 .remove = at91_adc_remove, 1177 + .id_table = at91_adc_ids, 1167 1178 .driver = { 1168 1179 .name = DRIVER_NAME, 1169 1180 .of_match_table = of_match_ptr(at91_adc_dt_ids),
+4 -2
drivers/iio/industrialio-buffer.c
··· 165 165 int ret; 166 166 struct iio_dev *indio_dev = dev_to_iio_dev(dev); 167 167 168 - ret = test_bit(to_iio_dev_attr(attr)->address, 168 + /* Ensure ret is 0 or 1. */ 169 + ret = !!test_bit(to_iio_dev_attr(attr)->address, 169 170 indio_dev->buffer->scan_mask); 170 171 171 172 return sprintf(buf, "%d\n", ret); ··· 863 862 if (!buffer->scan_mask) 864 863 return 0; 865 864 866 - return test_bit(bit, buffer->scan_mask); 865 + /* Ensure return value is 0 or 1. */ 866 + return !!test_bit(bit, buffer->scan_mask); 867 867 }; 868 868 EXPORT_SYMBOL_GPL(iio_scan_mask_query); 869 869
+1
drivers/iio/light/cm32181.c
··· 221 221 *val = cm32181->calibscale; 222 222 return IIO_VAL_INT; 223 223 case IIO_CHAN_INFO_INT_TIME: 224 + *val = 0; 224 225 ret = cm32181_read_als_it(cm32181, val2); 225 226 return ret; 226 227 }
+20 -2
drivers/iio/light/cm36651.c
··· 652 652 cm36651->client = client; 653 653 cm36651->ps_client = i2c_new_dummy(client->adapter, 654 654 CM36651_I2C_ADDR_PS); 655 + if (!cm36651->ps_client) { 656 + dev_err(&client->dev, "%s: new i2c device failed\n", __func__); 657 + ret = -ENODEV; 658 + goto error_disable_reg; 659 + } 660 + 655 661 cm36651->ara_client = i2c_new_dummy(client->adapter, CM36651_ARA); 662 + if (!cm36651->ara_client) { 663 + dev_err(&client->dev, "%s: new i2c device failed\n", __func__); 664 + ret = -ENODEV; 665 + goto error_i2c_unregister_ps; 666 + } 667 + 656 668 mutex_init(&cm36651->lock); 657 669 indio_dev->dev.parent = &client->dev; 658 670 indio_dev->channels = cm36651_channels; ··· 676 664 ret = cm36651_setup_reg(cm36651); 677 665 if (ret) { 678 666 dev_err(&client->dev, "%s: register setup failed\n", __func__); 679 - goto error_disable_reg; 667 + goto error_i2c_unregister_ara; 680 668 } 681 669 682 670 ret = request_threaded_irq(client->irq, NULL, cm36651_irq_handler, ··· 684 672 "cm36651", indio_dev); 685 673 if (ret) { 686 674 dev_err(&client->dev, "%s: request irq failed\n", __func__); 687 - goto error_disable_reg; 675 + goto error_i2c_unregister_ara; 688 676 } 689 677 690 678 ret = iio_device_register(indio_dev); ··· 697 685 698 686 error_free_irq: 699 687 free_irq(client->irq, indio_dev); 688 + error_i2c_unregister_ara: 689 + i2c_unregister_device(cm36651->ara_client); 690 + error_i2c_unregister_ps: 691 + i2c_unregister_device(cm36651->ps_client); 700 692 error_disable_reg: 701 693 regulator_disable(cm36651->vled_reg); 702 694 return ret; ··· 714 698 iio_device_unregister(indio_dev); 715 699 regulator_disable(cm36651->vled_reg); 716 700 free_irq(client->irq, indio_dev); 701 + i2c_unregister_device(cm36651->ps_client); 702 + i2c_unregister_device(cm36651->ara_client); 717 703 718 704 return 0; 719 705 }
+3 -6
drivers/staging/comedi/drivers/usbdux.c
··· 493 493 /* pointer to the DA */ 494 494 *datap++ = val & 0xff; 495 495 *datap++ = (val >> 8) & 0xff; 496 - *datap++ = chan; 496 + *datap++ = chan << 6; 497 497 devpriv->ao_readback[chan] = val; 498 498 499 499 s->async->events |= COMEDI_CB_BLOCK; ··· 1040 1040 /* set current channel of the running acquisition to zero */ 1041 1041 s->async->cur_chan = 0; 1042 1042 1043 - for (i = 0; i < cmd->chanlist_len; ++i) { 1044 - unsigned int chan = CR_CHAN(cmd->chanlist[i]); 1045 - 1046 - devpriv->ao_chanlist[i] = chan << 6; 1047 - } 1043 + for (i = 0; i < cmd->chanlist_len; ++i) 1044 + devpriv->ao_chanlist[i] = CR_CHAN(cmd->chanlist[i]); 1048 1045 1049 1046 /* we count in steps of 1ms (125us) */ 1050 1047 /* 125us mode not used yet */
+1 -1
drivers/staging/iio/adc/mxs-lradc.c
··· 1526 1526 struct resource *iores; 1527 1527 int ret = 0, touch_ret; 1528 1528 int i, s; 1529 - unsigned int scale_uv; 1529 + uint64_t scale_uv; 1530 1530 1531 1531 /* Allocate the IIO device. */ 1532 1532 iio = devm_iio_device_alloc(dev, sizeof(*lradc));
+1
drivers/staging/iio/resolver/ad2s1200.c
··· 70 70 vel = (((s16)(st->rx[0])) << 4) | ((st->rx[1] & 0xF0) >> 4); 71 71 vel = (vel << 4) >> 4; 72 72 *val = vel; 73 + break; 73 74 default: 74 75 mutex_unlock(&st->lock); 75 76 return -EINVAL;