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

Pull staging/IIO driver fixes from Greg KH:
"Here are a number of small fixes for staging and IIO drivers that
resolve reported problems.

Full details are in the shortlog. All of these have been in
linux-next with no reported issues"

* tag 'staging-4.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (35 commits)
arm: dts: rockchip: add reset node for the exist saradc SoCs
arm64: dts: rockchip: add reset saradc node for rk3368 SoCs
iio: adc: rockchip_saradc: reset saradc controller before programming it
iio: accel: kxsd9: Fix raw read return
iio: adc: ti_am335x_adc: Increase timeout value waiting for ADC sample
iio: adc: ti_am335x_adc: Protect FIFO1 from concurrent access
include/linux: fix excess fence.h kernel-doc notation
staging: wilc1000: correctly check if associatedsta has not been found
staging: wilc1000: NULL dereference on error
staging: wilc1000: txq_event: Fix coding error
MAINTAINERS: Add file patterns for ion device tree bindings
MAINTAINERS: Update maintainer entry for wilc1000
iio: chemical: atlas-ph-sensor: fix typo in val assignment
iio: fix sched WARNING "do not call blocking ops when !TASK_RUNNING"
staging: comedi: ni_mio_common: fix AO inttrig backwards compatibility
staging: comedi: dt2811: fix a precedence bug
staging: comedi: adv_pci1760: Do not return EINVAL for CMDF_ROUND_DOWN.
staging: comedi: ni_mio_common: fix wrong insn_write handler
staging: comedi: comedi_test: fix timer race conditions
staging: comedi: daqboard2000: bug fix board type matching code
...

+198 -128
+7
Documentation/devicetree/bindings/iio/adc/rockchip-saradc.txt
··· 16 16 - vref-supply: The regulator supply ADC reference voltage. 17 17 - #io-channel-cells: Should be 1, see ../iio-bindings.txt 18 18 19 + Optional properties: 20 + - resets: Must contain an entry for each entry in reset-names if need support 21 + this option. See ../reset/reset.txt for details. 22 + - reset-names: Must include the name "saradc-apb". 23 + 19 24 Example: 20 25 saradc: saradc@2006c000 { 21 26 compatible = "rockchip,saradc"; ··· 28 23 interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>; 29 24 clocks = <&cru SCLK_SARADC>, <&cru PCLK_SARADC>; 30 25 clock-names = "saradc", "apb_pclk"; 26 + resets = <&cru SRST_SARADC>; 27 + reset-names = "saradc-apb"; 31 28 #io-channel-cells = <1>; 32 29 vref-supply = <&vcc18>; 33 30 };
+3 -6
MAINTAINERS
··· 798 798 M: Sumit Semwal <sumit.semwal@linaro.org> 799 799 L: devel@driverdev.osuosl.org 800 800 S: Supported 801 + F: Documentation/devicetree/bindings/staging/ion/ 801 802 F: drivers/staging/android/ion 802 803 F: drivers/staging/android/uapi/ion.h 803 804 F: drivers/staging/android/uapi/ion_test.h ··· 11233 11232 F: drivers/staging/vt665?/ 11234 11233 11235 11234 STAGING - WILC1000 WIFI DRIVER 11236 - M: Johnny Kim <johnny.kim@atmel.com> 11237 - M: Austin Shin <austin.shin@atmel.com> 11238 - M: Chris Park <chris.park@atmel.com> 11239 - M: Tony Cho <tony.cho@atmel.com> 11240 - M: Glen Lee <glen.lee@atmel.com> 11241 - M: Leo Kim <leo.kim@atmel.com> 11235 + M: Aditya Shankar <aditya.shankar@microchip.com> 11236 + M: Ganesh Krishna <ganesh.krishna@microchip.com> 11242 11237 L: linux-wireless@vger.kernel.org 11243 11238 S: Supported 11244 11239 F: drivers/staging/wilc1000/
+2
arch/arm/boot/dts/rk3066a.dtsi
··· 197 197 clock-names = "saradc", "apb_pclk"; 198 198 interrupts = <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>; 199 199 #io-channel-cells = <1>; 200 + resets = <&cru SRST_SARADC>; 201 + reset-names = "saradc-apb"; 200 202 status = "disabled"; 201 203 }; 202 204
+2
arch/arm/boot/dts/rk3288.dtsi
··· 279 279 #io-channel-cells = <1>; 280 280 clocks = <&cru SCLK_SARADC>, <&cru PCLK_SARADC>; 281 281 clock-names = "saradc", "apb_pclk"; 282 + resets = <&cru SRST_SARADC>; 283 + reset-names = "saradc-apb"; 282 284 status = "disabled"; 283 285 }; 284 286
+2
arch/arm/boot/dts/rk3xxx.dtsi
··· 399 399 #io-channel-cells = <1>; 400 400 clocks = <&cru SCLK_SARADC>, <&cru PCLK_SARADC>; 401 401 clock-names = "saradc", "apb_pclk"; 402 + resets = <&cru SRST_SARADC>; 403 + reset-names = "saradc-apb"; 402 404 status = "disabled"; 403 405 }; 404 406
+2
arch/arm64/boot/dts/rockchip/rk3368.dtsi
··· 270 270 #io-channel-cells = <1>; 271 271 clocks = <&cru SCLK_SARADC>, <&cru PCLK_SARADC>; 272 272 clock-names = "saradc", "apb_pclk"; 273 + resets = <&cru SRST_SARADC>; 274 + reset-names = "saradc-apb"; 273 275 status = "disabled"; 274 276 }; 275 277
+4 -1
drivers/iio/accel/Kconfig
··· 20 20 config BMA220 21 21 tristate "Bosch BMA220 3-Axis Accelerometer Driver" 22 22 depends on SPI 23 + select IIO_BUFFER 24 + select IIO_TRIGGERED_BUFFER 23 25 help 24 26 Say yes here to add support for the Bosch BMA220 triaxial 25 27 acceleration sensor. ··· 236 234 config STK8BA50 237 235 tristate "Sensortek STK8BA50 3-Axis Accelerometer Driver" 238 236 depends on I2C 239 - depends on IIO_TRIGGER 237 + select IIO_BUFFER 238 + select IIO_TRIGGERED_BUFFER 240 239 help 241 240 Say yes here to get support for the Sensortek STK8BA50 3-axis 242 241 accelerometer.
+1 -1
drivers/iio/accel/bma220_spi.c
··· 253 253 if (ret < 0) 254 254 return ret; 255 255 256 - ret = iio_triggered_buffer_setup(indio_dev, NULL, 256 + ret = iio_triggered_buffer_setup(indio_dev, iio_pollfunc_store_time, 257 257 bma220_trigger_handler, NULL); 258 258 if (ret < 0) { 259 259 dev_err(&spi->dev, "iio triggered buffer setup failed\n");
+1
drivers/iio/accel/kxsd9.c
··· 160 160 if (ret < 0) 161 161 goto error_ret; 162 162 *val = ret; 163 + ret = IIO_VAL_INT; 163 164 break; 164 165 case IIO_CHAN_INFO_SCALE: 165 166 ret = spi_w8r8(st->us, KXSD9_READ(KXSD9_REG_CTRL_C));
+1
drivers/iio/adc/Kconfig
··· 389 389 config ROCKCHIP_SARADC 390 390 tristate "Rockchip SARADC driver" 391 391 depends on ARCH_ROCKCHIP || (ARM && COMPILE_TEST) 392 + depends on RESET_CONTROLLER 392 393 help 393 394 Say yes here to build support for the SARADC found in SoCs from 394 395 Rockchip.
+1
drivers/iio/adc/ad799x.c
··· 527 527 static const struct iio_info ad7991_info = { 528 528 .read_raw = &ad799x_read_raw, 529 529 .driver_module = THIS_MODULE, 530 + .update_scan_mode = ad799x_update_scan_mode, 530 531 }; 531 532 532 533 static const struct iio_info ad7993_4_7_8_noirq_info = {
+2 -2
drivers/iio/adc/at91_adc.c
··· 381 381 st->ts_bufferedmeasure = false; 382 382 input_report_key(st->ts_input, BTN_TOUCH, 0); 383 383 input_sync(st->ts_input); 384 - } else if (status & AT91_ADC_EOC(3)) { 385 - /* Conversion finished */ 384 + } else if (status & AT91_ADC_EOC(3) && st->ts_input) { 385 + /* Conversion finished and we've a touchscreen */ 386 386 if (st->ts_bufferedmeasure) { 387 387 /* 388 388 * Last measurement is always discarded, since it can
+30
drivers/iio/adc/rockchip_saradc.c
··· 21 21 #include <linux/of_device.h> 22 22 #include <linux/clk.h> 23 23 #include <linux/completion.h> 24 + #include <linux/delay.h> 25 + #include <linux/reset.h> 24 26 #include <linux/regulator/consumer.h> 25 27 #include <linux/iio/iio.h> 26 28 ··· 55 53 struct clk *clk; 56 54 struct completion completion; 57 55 struct regulator *vref; 56 + struct reset_control *reset; 58 57 const struct rockchip_saradc_data *data; 59 58 u16 last_val; 60 59 }; ··· 193 190 }; 194 191 MODULE_DEVICE_TABLE(of, rockchip_saradc_match); 195 192 193 + /** 194 + * Reset SARADC Controller. 195 + */ 196 + static void rockchip_saradc_reset_controller(struct reset_control *reset) 197 + { 198 + reset_control_assert(reset); 199 + usleep_range(10, 20); 200 + reset_control_deassert(reset); 201 + } 202 + 196 203 static int rockchip_saradc_probe(struct platform_device *pdev) 197 204 { 198 205 struct rockchip_saradc *info = NULL; ··· 230 217 info->regs = devm_ioremap_resource(&pdev->dev, mem); 231 218 if (IS_ERR(info->regs)) 232 219 return PTR_ERR(info->regs); 220 + 221 + /* 222 + * The reset should be an optional property, as it should work 223 + * with old devicetrees as well 224 + */ 225 + info->reset = devm_reset_control_get(&pdev->dev, "saradc-apb"); 226 + if (IS_ERR(info->reset)) { 227 + ret = PTR_ERR(info->reset); 228 + if (ret != -ENOENT) 229 + return ret; 230 + 231 + dev_dbg(&pdev->dev, "no reset control found\n"); 232 + info->reset = NULL; 233 + } 233 234 234 235 init_completion(&info->completion); 235 236 ··· 278 251 PTR_ERR(info->vref)); 279 252 return PTR_ERR(info->vref); 280 253 } 254 + 255 + if (info->reset) 256 + rockchip_saradc_reset_controller(info->reset); 281 257 282 258 /* 283 259 * Use a default value for the converter clock.
+2 -1
drivers/iio/adc/ti-ads1015.c
··· 489 489 #ifdef CONFIG_OF 490 490 static int ads1015_get_channels_config_of(struct i2c_client *client) 491 491 { 492 - struct ads1015_data *data = i2c_get_clientdata(client); 492 + struct iio_dev *indio_dev = i2c_get_clientdata(client); 493 + struct ads1015_data *data = iio_priv(indio_dev); 493 494 struct device_node *node; 494 495 495 496 if (!client->dev.of_node ||
+12 -4
drivers/iio/adc/ti_am335x_adc.c
··· 32 32 33 33 struct tiadc_device { 34 34 struct ti_tscadc_dev *mfd_tscadc; 35 + struct mutex fifo1_lock; /* to protect fifo access */ 35 36 int channels; 36 37 u8 channel_line[8]; 37 38 u8 channel_step[8]; ··· 360 359 int *val, int *val2, long mask) 361 360 { 362 361 struct tiadc_device *adc_dev = iio_priv(indio_dev); 362 + int ret = IIO_VAL_INT; 363 363 int i, map_val; 364 364 unsigned int fifo1count, read, stepid; 365 365 bool found = false; ··· 374 372 if (!step_en) 375 373 return -EINVAL; 376 374 375 + mutex_lock(&adc_dev->fifo1_lock); 377 376 fifo1count = tiadc_readl(adc_dev, REG_FIFO1CNT); 378 377 while (fifo1count--) 379 378 tiadc_readl(adc_dev, REG_FIFO1); 380 379 381 380 am335x_tsc_se_set_once(adc_dev->mfd_tscadc, step_en); 382 381 383 - timeout = jiffies + usecs_to_jiffies 382 + timeout = jiffies + msecs_to_jiffies 384 383 (IDLE_TIMEOUT * adc_dev->channels); 385 384 /* Wait for Fifo threshold interrupt */ 386 385 while (1) { ··· 391 388 392 389 if (time_after(jiffies, timeout)) { 393 390 am335x_tsc_se_adc_done(adc_dev->mfd_tscadc); 394 - return -EAGAIN; 391 + ret = -EAGAIN; 392 + goto err_unlock; 395 393 } 396 394 } 397 395 map_val = adc_dev->channel_step[chan->scan_index]; ··· 418 414 am335x_tsc_se_adc_done(adc_dev->mfd_tscadc); 419 415 420 416 if (found == false) 421 - return -EBUSY; 422 - return IIO_VAL_INT; 417 + ret = -EBUSY; 418 + 419 + err_unlock: 420 + mutex_unlock(&adc_dev->fifo1_lock); 421 + return ret; 423 422 } 424 423 425 424 static const struct iio_info tiadc_info = { ··· 490 483 491 484 tiadc_step_config(indio_dev); 492 485 tiadc_writel(adc_dev, REG_FIFO1THR, FIFO1_THRESHOLD); 486 + mutex_init(&adc_dev->fifo1_lock); 493 487 494 488 err = tiadc_channel_init(indio_dev, adc_dev->channels); 495 489 if (err < 0)
+1 -1
drivers/iio/chemical/atlas-ph-sensor.c
··· 434 434 break; 435 435 case IIO_ELECTRICALCONDUCTIVITY: 436 436 *val = 1; /* 0.00001 */ 437 - *val = 100000; 437 + *val2 = 100000; 438 438 break; 439 439 case IIO_CONCENTRATION: 440 440 *val = 0; /* 0.000000001 */
+29 -9
drivers/iio/dac/stx104.c
··· 65 65 unsigned int out_state; 66 66 }; 67 67 68 + /** 69 + * struct stx104_dev - STX104 device private data structure 70 + * @indio_dev: IIO device 71 + * @chip: instance of the gpio_chip 72 + */ 73 + struct stx104_dev { 74 + struct iio_dev *indio_dev; 75 + struct gpio_chip *chip; 76 + }; 77 + 68 78 static int stx104_read_raw(struct iio_dev *indio_dev, 69 79 struct iio_chan_spec const *chan, int *val, int *val2, long mask) 70 80 { ··· 117 107 static int stx104_gpio_get_direction(struct gpio_chip *chip, 118 108 unsigned int offset) 119 109 { 110 + /* GPIO 0-3 are input only, while the rest are output only */ 120 111 if (offset < 4) 121 112 return 1; 122 113 ··· 180 169 struct iio_dev *indio_dev; 181 170 struct stx104_iio *priv; 182 171 struct stx104_gpio *stx104gpio; 172 + struct stx104_dev *stx104dev; 183 173 int err; 184 174 185 175 indio_dev = devm_iio_device_alloc(dev, sizeof(*priv)); ··· 189 177 190 178 stx104gpio = devm_kzalloc(dev, sizeof(*stx104gpio), GFP_KERNEL); 191 179 if (!stx104gpio) 180 + return -ENOMEM; 181 + 182 + stx104dev = devm_kzalloc(dev, sizeof(*stx104dev), GFP_KERNEL); 183 + if (!stx104dev) 192 184 return -ENOMEM; 193 185 194 186 if (!devm_request_region(dev, base[id], STX104_EXTENT, ··· 215 199 outw(0, base[id] + 4); 216 200 outw(0, base[id] + 6); 217 201 218 - err = devm_iio_device_register(dev, indio_dev); 219 - if (err) { 220 - dev_err(dev, "IIO device registering failed (%d)\n", err); 221 - return err; 222 - } 223 - 224 202 stx104gpio->chip.label = dev_name(dev); 225 203 stx104gpio->chip.parent = dev; 226 204 stx104gpio->chip.owner = THIS_MODULE; ··· 230 220 231 221 spin_lock_init(&stx104gpio->lock); 232 222 233 - dev_set_drvdata(dev, stx104gpio); 223 + stx104dev->indio_dev = indio_dev; 224 + stx104dev->chip = &stx104gpio->chip; 225 + dev_set_drvdata(dev, stx104dev); 234 226 235 227 err = gpiochip_add_data(&stx104gpio->chip, stx104gpio); 236 228 if (err) { 237 229 dev_err(dev, "GPIO registering failed (%d)\n", err); 230 + return err; 231 + } 232 + 233 + err = iio_device_register(indio_dev); 234 + if (err) { 235 + dev_err(dev, "IIO device registering failed (%d)\n", err); 236 + gpiochip_remove(&stx104gpio->chip); 238 237 return err; 239 238 } 240 239 ··· 252 233 253 234 static int stx104_remove(struct device *dev, unsigned int id) 254 235 { 255 - struct stx104_gpio *const stx104gpio = dev_get_drvdata(dev); 236 + struct stx104_dev *const stx104dev = dev_get_drvdata(dev); 256 237 257 - gpiochip_remove(&stx104gpio->chip); 238 + iio_device_unregister(stx104dev->indio_dev); 239 + gpiochip_remove(stx104dev->chip); 258 240 259 241 return 0; 260 242 }
+2
drivers/iio/humidity/Kconfig
··· 6 6 config AM2315 7 7 tristate "Aosong AM2315 relative humidity and temperature sensor" 8 8 depends on I2C 9 + select IIO_BUFFER 10 + select IIO_TRIGGERED_BUFFER 9 11 help 10 12 If you say yes here you get support for the Aosong AM2315 11 13 relative humidity and ambient temperature sensor.
+1 -1
drivers/iio/humidity/am2315.c
··· 244 244 indio_dev->channels = am2315_channels; 245 245 indio_dev->num_channels = ARRAY_SIZE(am2315_channels); 246 246 247 - ret = iio_triggered_buffer_setup(indio_dev, NULL, 247 + ret = iio_triggered_buffer_setup(indio_dev, iio_pollfunc_store_time, 248 248 am2315_trigger_handler, NULL); 249 249 if (ret < 0) { 250 250 dev_err(&client->dev, "iio triggered buffer setup failed\n");
+7 -20
drivers/iio/humidity/hdc100x.c
··· 142 142 struct i2c_client *client = data->client; 143 143 int delay = data->adc_int_us[chan->address]; 144 144 int ret; 145 - int val; 145 + __be16 val; 146 146 147 147 /* start measurement */ 148 148 ret = i2c_smbus_write_byte(client, chan->address); ··· 154 154 /* wait for integration time to pass */ 155 155 usleep_range(delay, delay + 1000); 156 156 157 - /* 158 - * i2c_smbus_read_word_data cannot() be used here due to the command 159 - * value not being understood and causes NAKs preventing any reading 160 - * from being accessed. 161 - */ 162 - ret = i2c_smbus_read_byte(client); 157 + /* read measurement */ 158 + ret = i2c_master_recv(data->client, (char *)&val, sizeof(val)); 163 159 if (ret < 0) { 164 - dev_err(&client->dev, "cannot read high byte measurement"); 160 + dev_err(&client->dev, "cannot read sensor data\n"); 165 161 return ret; 166 162 } 167 - val = ret << 8; 168 - 169 - ret = i2c_smbus_read_byte(client); 170 - if (ret < 0) { 171 - dev_err(&client->dev, "cannot read low byte measurement"); 172 - return ret; 173 - } 174 - val |= ret; 175 - 176 - return val; 163 + return be16_to_cpu(val); 177 164 } 178 165 179 166 static int hdc100x_get_heater_status(struct hdc100x_data *data) ··· 259 272 struct iio_dev *indio_dev; 260 273 struct hdc100x_data *data; 261 274 262 - if (!i2c_check_functionality(client->adapter, 263 - I2C_FUNC_SMBUS_WORD_DATA | I2C_FUNC_SMBUS_BYTE)) 275 + if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_WORD_DATA | 276 + I2C_FUNC_SMBUS_BYTE | I2C_FUNC_I2C)) 264 277 return -EOPNOTSUPP; 265 278 266 279 indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data));
+17 -6
drivers/iio/industrialio-buffer.c
··· 107 107 { 108 108 struct iio_dev *indio_dev = filp->private_data; 109 109 struct iio_buffer *rb = indio_dev->buffer; 110 + DEFINE_WAIT_FUNC(wait, woken_wake_function); 110 111 size_t datum_size; 111 112 size_t to_wait; 112 113 int ret; ··· 132 131 else 133 132 to_wait = min_t(size_t, n / datum_size, rb->watermark); 134 133 134 + add_wait_queue(&rb->pollq, &wait); 135 135 do { 136 - ret = wait_event_interruptible(rb->pollq, 137 - iio_buffer_ready(indio_dev, rb, to_wait, n / datum_size)); 138 - if (ret) 139 - return ret; 136 + if (!indio_dev->info) { 137 + ret = -ENODEV; 138 + break; 139 + } 140 140 141 - if (!indio_dev->info) 142 - return -ENODEV; 141 + if (!iio_buffer_ready(indio_dev, rb, to_wait, n / datum_size)) { 142 + if (signal_pending(current)) { 143 + ret = -ERESTARTSYS; 144 + break; 145 + } 146 + 147 + wait_woken(&wait, TASK_INTERRUPTIBLE, 148 + MAX_SCHEDULE_TIMEOUT); 149 + continue; 150 + } 143 151 144 152 ret = rb->access->read_first_n(rb, n, buf); 145 153 if (ret == 0 && (filp->f_flags & O_NONBLOCK)) 146 154 ret = -EAGAIN; 147 155 } while (ret == 0); 156 + remove_wait_queue(&rb->pollq, &wait); 148 157 149 158 return ret; 150 159 }
+2
drivers/iio/light/Kconfig
··· 238 238 tristate "MAX44000 Ambient and Infrared Proximity Sensor" 239 239 depends on I2C 240 240 select REGMAP_I2C 241 + select IIO_BUFFER 242 + select IIO_TRIGGERED_BUFFER 241 243 help 242 244 Say Y here if you want to build support for Maxim Integrated's 243 245 MAX44000 ambient and infrared proximity sensor device.
+5 -3
drivers/iio/pressure/bmp280-core.c
··· 970 970 data->vdda = devm_regulator_get(dev, "vdda"); 971 971 if (IS_ERR(data->vdda)) { 972 972 dev_err(dev, "failed to get VDDA regulator\n"); 973 - ret = PTR_ERR(data->vddd); 973 + ret = PTR_ERR(data->vdda); 974 974 goto out_disable_vddd; 975 975 } 976 976 ret = regulator_enable(data->vdda); ··· 1079 1079 #ifdef CONFIG_PM 1080 1080 static int bmp280_runtime_suspend(struct device *dev) 1081 1081 { 1082 - struct bmp280_data *data = dev_get_drvdata(dev); 1082 + struct iio_dev *indio_dev = dev_get_drvdata(dev); 1083 + struct bmp280_data *data = iio_priv(indio_dev); 1083 1084 int ret; 1084 1085 1085 1086 ret = regulator_disable(data->vdda); ··· 1091 1090 1092 1091 static int bmp280_runtime_resume(struct device *dev) 1093 1092 { 1094 - struct bmp280_data *data = dev_get_drvdata(dev); 1093 + struct iio_dev *indio_dev = dev_get_drvdata(dev); 1094 + struct bmp280_data *data = iio_priv(indio_dev); 1095 1095 int ret; 1096 1096 1097 1097 ret = regulator_enable(data->vddd);
+1 -1
drivers/iio/proximity/as3935.c
··· 397 397 return ret; 398 398 } 399 399 400 - ret = iio_triggered_buffer_setup(indio_dev, NULL, 400 + ret = iio_triggered_buffer_setup(indio_dev, iio_pollfunc_store_time, 401 401 &as3935_trigger_handler, NULL); 402 402 403 403 if (ret) {
+1
drivers/staging/comedi/drivers/adv_pci1760.c
··· 196 196 break; 197 197 case CMDF_ROUND_DOWN: 198 198 divisor = ns / PCI1760_PWM_TIMEBASE; 199 + break; 199 200 default: 200 201 return -EINVAL; 201 202 }
+12 -34
drivers/staging/comedi/drivers/comedi_test.c
··· 56 56 57 57 #define N_CHANS 8 58 58 59 - enum waveform_state_bits { 60 - WAVEFORM_AI_RUNNING, 61 - WAVEFORM_AO_RUNNING 62 - }; 63 - 64 59 /* Data unique to this driver */ 65 60 struct waveform_private { 66 61 struct timer_list ai_timer; /* timer for AI commands */ ··· 63 68 unsigned int wf_amplitude; /* waveform amplitude in microvolts */ 64 69 unsigned int wf_period; /* waveform period in microseconds */ 65 70 unsigned int wf_current; /* current time in waveform period */ 66 - unsigned long state_bits; 67 71 unsigned int ai_scan_period; /* AI scan period in usec */ 68 72 unsigned int ai_convert_period; /* AI conversion period in usec */ 69 73 struct timer_list ao_timer; /* timer for AO commands */ ··· 184 190 u64 now; 185 191 unsigned int nsamples; 186 192 unsigned int time_increment; 187 - 188 - /* check command is still active */ 189 - if (!test_bit(WAVEFORM_AI_RUNNING, &devpriv->state_bits)) 190 - return; 191 193 192 194 now = ktime_to_us(ktime_get()); 193 195 nsamples = comedi_nsamples_left(s, UINT_MAX); ··· 376 386 */ 377 387 devpriv->ai_timer.expires = 378 388 jiffies + usecs_to_jiffies(devpriv->ai_convert_period) + 1; 379 - 380 - /* mark command as active */ 381 - smp_mb__before_atomic(); 382 - set_bit(WAVEFORM_AI_RUNNING, &devpriv->state_bits); 383 - smp_mb__after_atomic(); 384 389 add_timer(&devpriv->ai_timer); 385 390 return 0; 386 391 } ··· 385 400 { 386 401 struct waveform_private *devpriv = dev->private; 387 402 388 - /* mark command as no longer active */ 389 - clear_bit(WAVEFORM_AI_RUNNING, &devpriv->state_bits); 390 - smp_mb__after_atomic(); 391 - /* cannot call del_timer_sync() as may be called from timer routine */ 392 - del_timer(&devpriv->ai_timer); 403 + if (in_softirq()) { 404 + /* Assume we were called from the timer routine itself. */ 405 + del_timer(&devpriv->ai_timer); 406 + } else { 407 + del_timer_sync(&devpriv->ai_timer); 408 + } 393 409 return 0; 394 410 } 395 411 ··· 421 435 u64 now; 422 436 u64 scans_since; 423 437 unsigned int scans_avail = 0; 424 - 425 - /* check command is still active */ 426 - if (!test_bit(WAVEFORM_AO_RUNNING, &devpriv->state_bits)) 427 - return; 428 438 429 439 /* determine number of scan periods since last time */ 430 440 now = ktime_to_us(ktime_get()); ··· 500 518 devpriv->ao_last_scan_time = ktime_to_us(ktime_get()); 501 519 devpriv->ao_timer.expires = 502 520 jiffies + usecs_to_jiffies(devpriv->ao_scan_period); 503 - 504 - /* mark command as active */ 505 - smp_mb__before_atomic(); 506 - set_bit(WAVEFORM_AO_RUNNING, &devpriv->state_bits); 507 - smp_mb__after_atomic(); 508 521 add_timer(&devpriv->ao_timer); 509 522 510 523 return 1; ··· 585 608 struct waveform_private *devpriv = dev->private; 586 609 587 610 s->async->inttrig = NULL; 588 - /* mark command as no longer active */ 589 - clear_bit(WAVEFORM_AO_RUNNING, &devpriv->state_bits); 590 - smp_mb__after_atomic(); 591 - /* cannot call del_timer_sync() as may be called from timer routine */ 592 - del_timer(&devpriv->ao_timer); 611 + if (in_softirq()) { 612 + /* Assume we were called from the timer routine itself. */ 613 + del_timer(&devpriv->ao_timer); 614 + } else { 615 + del_timer_sync(&devpriv->ao_timer); 616 + } 593 617 return 0; 594 618 } 595 619
+1 -1
drivers/staging/comedi/drivers/daqboard2000.c
··· 634 634 const struct daq200_boardtype *board; 635 635 int i; 636 636 637 - if (pcidev->subsystem_device != PCI_VENDOR_ID_IOTECH) 637 + if (pcidev->subsystem_vendor != PCI_VENDOR_ID_IOTECH) 638 638 return NULL; 639 639 640 640 for (i = 0; i < ARRAY_SIZE(boardtypes); i++) {
+2 -2
drivers/staging/comedi/drivers/dt2811.c
··· 588 588 s = &dev->subdevices[0]; 589 589 s->type = COMEDI_SUBD_AI; 590 590 s->subdev_flags = SDF_READABLE | 591 - (it->options[2] == 1) ? SDF_DIFF : 592 - (it->options[2] == 2) ? SDF_COMMON : SDF_GROUND; 591 + ((it->options[2] == 1) ? SDF_DIFF : 592 + (it->options[2] == 2) ? SDF_COMMON : SDF_GROUND); 593 593 s->n_chan = (it->options[2] == 1) ? 8 : 16; 594 594 s->maxdata = 0x0fff; 595 595 s->range_table = board->is_pgh ? &dt2811_pgh_ai_ranges
+10 -2
drivers/staging/comedi/drivers/ni_mio_common.c
··· 2772 2772 int i; 2773 2773 static const int timeout = 1000; 2774 2774 2775 - if (trig_num != cmd->start_arg) 2775 + /* 2776 + * Require trig_num == cmd->start_arg when cmd->start_src == TRIG_INT. 2777 + * For backwards compatibility, also allow trig_num == 0 when 2778 + * cmd->start_src != TRIG_INT (i.e. when cmd->start_src == TRIG_EXT); 2779 + * in that case, the internal trigger is being used as a pre-trigger 2780 + * before the external trigger. 2781 + */ 2782 + if (!(trig_num == cmd->start_arg || 2783 + (trig_num == 0 && cmd->start_src != TRIG_INT))) 2776 2784 return -EINVAL; 2777 2785 2778 2786 /* ··· 5488 5480 s->maxdata = (devpriv->is_m_series) ? 0xffffffff 5489 5481 : 0x00ffffff; 5490 5482 s->insn_read = ni_tio_insn_read; 5491 - s->insn_write = ni_tio_insn_read; 5483 + s->insn_write = ni_tio_insn_write; 5492 5484 s->insn_config = ni_tio_insn_config; 5493 5485 #ifdef PCIDMA 5494 5486 if (dev->irq && devpriv->mite) {
+1 -1
drivers/staging/iio/impedance-analyzer/ad5933.c
··· 419 419 mutex_lock(&indio_dev->mlock); 420 420 switch ((u32)this_attr->address) { 421 421 case AD5933_OUT_RANGE: 422 + ret = -EINVAL; 422 423 for (i = 0; i < 4; i++) 423 424 if (val == st->range_avail[i]) { 424 425 st->ctrl_hb &= ~AD5933_CTRL_RANGE(0x3); ··· 427 426 ret = ad5933_cmd(st, 0); 428 427 break; 429 428 } 430 - ret = -EINVAL; 431 429 break; 432 430 case AD5933_IN_PGA_GAIN: 433 431 if (sysfs_streq(buf, "1")) {
+24 -19
drivers/staging/lustre/lustre/llite/namei.c
··· 388 388 struct inode *inode = NULL; 389 389 __u64 bits = 0; 390 390 int rc = 0; 391 + struct dentry *alias; 391 392 392 393 /* NB 1 request reference will be taken away by ll_intent_lock() 393 394 * when I return ··· 413 412 */ 414 413 } 415 414 416 - /* Only hash *de if it is unhashed (new dentry). 417 - * Atoimc_open may passing hashed dentries for open. 418 - */ 419 - if (d_unhashed(*de)) { 420 - struct dentry *alias; 421 - 422 - alias = ll_splice_alias(inode, *de); 423 - if (IS_ERR(alias)) { 424 - rc = PTR_ERR(alias); 425 - goto out; 426 - } 427 - *de = alias; 428 - } else if (!it_disposition(it, DISP_LOOKUP_NEG) && 429 - !it_disposition(it, DISP_OPEN_CREATE)) { 430 - /* With DISP_OPEN_CREATE dentry will be 431 - * instantiated in ll_create_it. 432 - */ 433 - LASSERT(!d_inode(*de)); 434 - d_instantiate(*de, inode); 415 + alias = ll_splice_alias(inode, *de); 416 + if (IS_ERR(alias)) { 417 + rc = PTR_ERR(alias); 418 + goto out; 435 419 } 420 + *de = alias; 436 421 437 422 if (!it_disposition(it, DISP_LOOKUP_NEG)) { 438 423 /* we have lookup look - unhide dentry */ ··· 573 586 CDEBUG(D_VFSTRACE, "VFS Op:name=%pd, dir="DFID"(%p),file %p,open_flags %x,mode %x opened %d\n", 574 587 dentry, PFID(ll_inode2fid(dir)), dir, file, open_flags, mode, 575 588 *opened); 589 + 590 + /* Only negative dentries enter here */ 591 + LASSERT(!d_inode(dentry)); 592 + 593 + if (!d_in_lookup(dentry)) { 594 + /* A valid negative dentry that just passed revalidation, 595 + * there's little point to try and open it server-side, 596 + * even though there's a minuscle chance it might succeed. 597 + * Either way it's a valid race to just return -ENOENT here. 598 + */ 599 + if (!(open_flags & O_CREAT)) 600 + return -ENOENT; 601 + 602 + /* Otherwise we just unhash it to be rehashed afresh via 603 + * lookup if necessary 604 + */ 605 + d_drop(dentry); 606 + } 576 607 577 608 it = kzalloc(sizeof(*it), GFP_NOFS); 578 609 if (!it)
+1 -2
drivers/staging/wilc1000/host_interface.c
··· 3363 3363 if (!hif_workqueue) { 3364 3364 netdev_err(vif->ndev, "Failed to create workqueue\n"); 3365 3365 result = -ENOMEM; 3366 - goto _fail_mq_; 3366 + goto _fail_; 3367 3367 } 3368 3368 3369 3369 setup_timer(&periodic_rssi, GetPeriodicRSSI, ··· 3391 3391 3392 3392 clients_count++; 3393 3393 3394 - _fail_mq_: 3395 3394 destroy_workqueue(hif_workqueue); 3396 3395 _fail_: 3397 3396 return result;
+1 -1
drivers/staging/wilc1000/linux_wlan.c
··· 648 648 mutex_unlock(&wl->hif_cs); 649 649 } 650 650 if (&wl->txq_event) 651 - wait_for_completion(&wl->txq_event); 651 + complete(&wl->txq_event); 652 652 653 653 wlan_deinitialize_threads(dev); 654 654 deinit_irq(dev);
+2 -2
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
··· 1191 1191 struct wilc_priv *priv; 1192 1192 struct wilc_vif *vif; 1193 1193 u32 i = 0; 1194 - u32 associatedsta = 0; 1194 + u32 associatedsta = ~0; 1195 1195 u32 inactive_time = 0; 1196 1196 priv = wiphy_priv(wiphy); 1197 1197 vif = netdev_priv(dev); ··· 1204 1204 } 1205 1205 } 1206 1206 1207 - if (associatedsta == -1) { 1207 + if (associatedsta == ~0) { 1208 1208 netdev_err(dev, "sta required is not associated\n"); 1209 1209 return -ENOENT; 1210 1210 }
-2
include/linux/fence.h
··· 49 49 * @timestamp: Timestamp when the fence was signaled. 50 50 * @status: Optional, only valid if < 0, must be set before calling 51 51 * fence_signal, indicates that the fence has completed with an error. 52 - * @child_list: list of children fences 53 - * @active_list: list of active fences 54 52 * 55 53 * the flags member must be manipulated and read using the appropriate 56 54 * atomic ops (bit_*), so taking the spinlock will not be needed most
+1 -1
include/linux/iio/sw_trigger.h
··· 62 62 const char *name, 63 63 struct config_item_type *type) 64 64 { 65 - #ifdef CONFIG_CONFIGFS_FS 65 + #if IS_ENABLED(CONFIG_CONFIGFS_FS) 66 66 config_group_init_type_name(&t->group, name, type); 67 67 #endif 68 68 }
+4 -4
include/linux/mfd/ti_am335x_tscadc.h
··· 138 138 /* 139 139 * time in us for processing a single channel, calculated as follows: 140 140 * 141 - * num cycles = open delay + (sample delay + conv time) * averaging 141 + * max num cycles = open delay + (sample delay + conv time) * averaging 142 142 * 143 - * num cycles: 152 + (1 + 13) * 16 = 376 143 + * max num cycles: 262143 + (255 + 13) * 16 = 266431 144 144 * 145 145 * clock frequency: 26MHz / 8 = 3.25MHz 146 146 * clock period: 1 / 3.25MHz = 308ns 147 147 * 148 - * processing time: 376 * 308ns = 116us 148 + * max processing time: 266431 * 308ns = 83ms(approx) 149 149 */ 150 - #define IDLE_TIMEOUT 116 /* microsec */ 150 + #define IDLE_TIMEOUT 83 /* milliseconds */ 151 151 152 152 #define TSCADC_CELLS 2 153 153
+1 -1
tools/iio/iio_generic_buffer.c
··· 348 348 int notrigger = 0; 349 349 char *dummy; 350 350 351 - struct iio_channel_info *channels; 351 + struct iio_channel_info *channels = NULL; 352 352 353 353 register_cleanup(); 354 354