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

Pull staging and IIO fixes from Greg KH:
"Here is a bunch of IIO driver fixes, and some smaller staging driver
fixes, for 5.1-rc6. The IIO fixes were delayed due to my vacation, but
all resolve a number of reported issues and have been in linux-next
for a few weeks with no reported issues.

The other staging driver fixes are all tiny, resolving some reported
issues in the comedi and most drivers, as well as some erofs fixes.

All of these patches have been in linux-next with no reported issues"

* tag 'staging-5.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (24 commits)
staging: comedi: ni_usb6501: Fix possible double-free of ->usb_rx_buf
staging: comedi: ni_usb6501: Fix use of uninitialized mutex
staging: erofs: fix unexpected out-of-bound data access
staging: comedi: vmk80xx: Fix possible double-free of ->usb_rx_buf
staging: comedi: vmk80xx: Fix use of uninitialized semaphore
staging: most: core: use device description as name
iio: core: fix a possible circular locking dependency
iio: ad_sigma_delta: select channel when reading register
iio: pms7003: select IIO_TRIGGERED_BUFFER
iio: cros_ec: Fix the maths for gyro scale calculation
iio: adc: xilinx: prevent touching unclocked h/w on remove
iio: adc: xilinx: fix potential use-after-free on probe
iio: adc: xilinx: fix potential use-after-free on remove
iio: dac: mcp4725: add missing powerdown bits in store eeprom
io: accel: kxcjk1013: restore the range after resume.
iio:chemical:bme680: Fix SPI read interface
iio:chemical:bme680: Fix, report temperature in millidegrees
iio: chemical: fix missing Kconfig block for sgp30
iio: adc: at91: disable adc channel interrupt in timeout case
iio: gyro: mpu3050: fix chip ID reading
...

+192 -115
+2
drivers/iio/accel/kxcjk-1013.c
··· 1437 1437 1438 1438 mutex_lock(&data->mutex); 1439 1439 ret = kxcjk1013_set_mode(data, OPERATION); 1440 + if (ret == 0) 1441 + ret = kxcjk1013_set_range(data, data->range); 1440 1442 mutex_unlock(&data->mutex); 1441 1443 1442 1444 return ret;
+1
drivers/iio/adc/ad_sigma_delta.c
··· 121 121 if (sigma_delta->info->has_registers) { 122 122 data[0] = reg << sigma_delta->info->addr_shift; 123 123 data[0] |= sigma_delta->info->read_mask; 124 + data[0] |= sigma_delta->comm; 124 125 spi_message_add_tail(&t[0], &m); 125 126 } 126 127 spi_message_add_tail(&t[1], &m);
+17 -11
drivers/iio/adc/at91_adc.c
··· 704 704 ret = wait_event_interruptible_timeout(st->wq_data_avail, 705 705 st->done, 706 706 msecs_to_jiffies(1000)); 707 - if (ret == 0) 708 - ret = -ETIMEDOUT; 709 - if (ret < 0) { 710 - mutex_unlock(&st->lock); 711 - return ret; 712 - } 713 707 714 - *val = st->last_value; 715 - 708 + /* Disable interrupts, regardless if adc conversion was 709 + * successful or not 710 + */ 716 711 at91_adc_writel(st, AT91_ADC_CHDR, 717 712 AT91_ADC_CH(chan->channel)); 718 713 at91_adc_writel(st, AT91_ADC_IDR, BIT(chan->channel)); 719 714 720 - st->last_value = 0; 721 - st->done = false; 715 + if (ret > 0) { 716 + /* a valid conversion took place */ 717 + *val = st->last_value; 718 + st->last_value = 0; 719 + st->done = false; 720 + ret = IIO_VAL_INT; 721 + } else if (ret == 0) { 722 + /* conversion timeout */ 723 + dev_err(&idev->dev, "ADC Channel %d timeout.\n", 724 + chan->channel); 725 + ret = -ETIMEDOUT; 726 + } 727 + 722 728 mutex_unlock(&st->lock); 723 - return IIO_VAL_INT; 729 + return ret; 724 730 725 731 case IIO_CHAN_INFO_SCALE: 726 732 *val = st->vref_mv;
+2 -1
drivers/iio/adc/xilinx-xadc-core.c
··· 1292 1292 1293 1293 err_free_irq: 1294 1294 free_irq(xadc->irq, indio_dev); 1295 + cancel_delayed_work_sync(&xadc->zynq_unmask_work); 1295 1296 err_clk_disable_unprepare: 1296 1297 clk_disable_unprepare(xadc->clk); 1297 1298 err_free_samplerate_trigger: ··· 1322 1321 iio_triggered_buffer_cleanup(indio_dev); 1323 1322 } 1324 1323 free_irq(xadc->irq, indio_dev); 1324 + cancel_delayed_work_sync(&xadc->zynq_unmask_work); 1325 1325 clk_disable_unprepare(xadc->clk); 1326 - cancel_delayed_work(&xadc->zynq_unmask_work); 1327 1326 kfree(xadc->data); 1328 1327 kfree(indio_dev->channels); 1329 1328
+14
drivers/iio/chemical/Kconfig
··· 64 64 config PMS7003 65 65 tristate "Plantower PMS7003 particulate matter sensor" 66 66 depends on SERIAL_DEV_BUS 67 + select IIO_TRIGGERED_BUFFER 67 68 help 68 69 Say Y here to build support for the Plantower PMS7003 particulate 69 70 matter sensor. 70 71 71 72 To compile this driver as a module, choose M here: the module will 72 73 be called pms7003. 74 + 75 + config SENSIRION_SGP30 76 + tristate "Sensirion SGPxx gas sensors" 77 + depends on I2C 78 + select CRC8 79 + help 80 + Say Y here to build I2C interface support for the following 81 + Sensirion SGP gas sensors: 82 + * SGP30 gas sensor 83 + * SGPC3 low power gas sensor 84 + 85 + To compile this driver as module, choose M here: the 86 + module will be called sgp30. 73 87 74 88 config SPS30 75 89 tristate "SPS30 particulate matter sensor"
+2 -4
drivers/iio/chemical/bme680.h
··· 2 2 #ifndef BME680_H_ 3 3 #define BME680_H_ 4 4 5 - #define BME680_REG_CHIP_I2C_ID 0xD0 6 - #define BME680_REG_CHIP_SPI_ID 0x50 5 + #define BME680_REG_CHIP_ID 0xD0 7 6 #define BME680_CHIP_ID_VAL 0x61 8 - #define BME680_REG_SOFT_RESET_I2C 0xE0 9 - #define BME680_REG_SOFT_RESET_SPI 0x60 7 + #define BME680_REG_SOFT_RESET 0xE0 10 8 #define BME680_CMD_SOFTRESET 0xB6 11 9 #define BME680_REG_STATUS 0x73 12 10 #define BME680_SPI_MEM_PAGE_BIT BIT(4)
+45 -9
drivers/iio/chemical/bme680_core.c
··· 63 63 s32 t_fine; 64 64 }; 65 65 66 + static const struct regmap_range bme680_volatile_ranges[] = { 67 + regmap_reg_range(BME680_REG_MEAS_STAT_0, BME680_REG_GAS_R_LSB), 68 + regmap_reg_range(BME680_REG_STATUS, BME680_REG_STATUS), 69 + regmap_reg_range(BME680_T2_LSB_REG, BME680_GH3_REG), 70 + }; 71 + 72 + static const struct regmap_access_table bme680_volatile_table = { 73 + .yes_ranges = bme680_volatile_ranges, 74 + .n_yes_ranges = ARRAY_SIZE(bme680_volatile_ranges), 75 + }; 76 + 66 77 const struct regmap_config bme680_regmap_config = { 67 78 .reg_bits = 8, 68 79 .val_bits = 8, 80 + .max_register = 0xef, 81 + .volatile_table = &bme680_volatile_table, 82 + .cache_type = REGCACHE_RBTREE, 69 83 }; 70 84 EXPORT_SYMBOL(bme680_regmap_config); 71 85 ··· 329 315 struct bme680_calib *calib = &data->bme680; 330 316 s64 var1, var2, var3; 331 317 s16 calc_temp; 318 + 319 + /* If the calibration is invalid, attempt to reload it */ 320 + if (!calib->par_t2) 321 + bme680_read_calib(data, calib); 332 322 333 323 var1 = (adc_temp >> 3) - (calib->par_t1 << 1); 334 324 var2 = (var1 * calib->par_t2) >> 11; ··· 601 583 return ret; 602 584 } 603 585 604 - static int bme680_read_temp(struct bme680_data *data, 605 - int *val, int *val2) 586 + static int bme680_read_temp(struct bme680_data *data, int *val) 606 587 { 607 588 struct device *dev = regmap_get_device(data->regmap); 608 589 int ret; ··· 634 617 * compensate_press/compensate_humid to get compensated 635 618 * pressure/humidity readings. 636 619 */ 637 - if (val && val2) { 638 - *val = comp_temp; 639 - *val2 = 100; 640 - return IIO_VAL_FRACTIONAL; 620 + if (val) { 621 + *val = comp_temp * 10; /* Centidegrees to millidegrees */ 622 + return IIO_VAL_INT; 641 623 } 642 624 643 625 return ret; ··· 651 635 s32 adc_press; 652 636 653 637 /* Read and compensate temperature to get a reading of t_fine */ 654 - ret = bme680_read_temp(data, NULL, NULL); 638 + ret = bme680_read_temp(data, NULL); 655 639 if (ret < 0) 656 640 return ret; 657 641 ··· 684 668 u32 comp_humidity; 685 669 686 670 /* Read and compensate temperature to get a reading of t_fine */ 687 - ret = bme680_read_temp(data, NULL, NULL); 671 + ret = bme680_read_temp(data, NULL); 688 672 if (ret < 0) 689 673 return ret; 690 674 ··· 777 761 case IIO_CHAN_INFO_PROCESSED: 778 762 switch (chan->type) { 779 763 case IIO_TEMP: 780 - return bme680_read_temp(data, val, val2); 764 + return bme680_read_temp(data, val); 781 765 case IIO_PRESSURE: 782 766 return bme680_read_press(data, val, val2); 783 767 case IIO_HUMIDITYRELATIVE: ··· 883 867 { 884 868 struct iio_dev *indio_dev; 885 869 struct bme680_data *data; 870 + unsigned int val; 886 871 int ret; 872 + 873 + ret = regmap_write(regmap, BME680_REG_SOFT_RESET, 874 + BME680_CMD_SOFTRESET); 875 + if (ret < 0) { 876 + dev_err(dev, "Failed to reset chip\n"); 877 + return ret; 878 + } 879 + 880 + ret = regmap_read(regmap, BME680_REG_CHIP_ID, &val); 881 + if (ret < 0) { 882 + dev_err(dev, "Error reading chip ID\n"); 883 + return ret; 884 + } 885 + 886 + if (val != BME680_CHIP_ID_VAL) { 887 + dev_err(dev, "Wrong chip ID, got %x expected %x\n", 888 + val, BME680_CHIP_ID_VAL); 889 + return -ENODEV; 890 + } 887 891 888 892 indio_dev = devm_iio_device_alloc(dev, sizeof(*data)); 889 893 if (!indio_dev)
-21
drivers/iio/chemical/bme680_i2c.c
··· 23 23 { 24 24 struct regmap *regmap; 25 25 const char *name = NULL; 26 - unsigned int val; 27 - int ret; 28 26 29 27 regmap = devm_regmap_init_i2c(client, &bme680_regmap_config); 30 28 if (IS_ERR(regmap)) { 31 29 dev_err(&client->dev, "Failed to register i2c regmap %d\n", 32 30 (int)PTR_ERR(regmap)); 33 31 return PTR_ERR(regmap); 34 - } 35 - 36 - ret = regmap_write(regmap, BME680_REG_SOFT_RESET_I2C, 37 - BME680_CMD_SOFTRESET); 38 - if (ret < 0) { 39 - dev_err(&client->dev, "Failed to reset chip\n"); 40 - return ret; 41 - } 42 - 43 - ret = regmap_read(regmap, BME680_REG_CHIP_I2C_ID, &val); 44 - if (ret < 0) { 45 - dev_err(&client->dev, "Error reading I2C chip ID\n"); 46 - return ret; 47 - } 48 - 49 - if (val != BME680_CHIP_ID_VAL) { 50 - dev_err(&client->dev, "Wrong chip ID, got %x expected %x\n", 51 - val, BME680_CHIP_ID_VAL); 52 - return -ENODEV; 53 32 } 54 33 55 34 if (id)
+78 -37
drivers/iio/chemical/bme680_spi.c
··· 12 12 13 13 #include "bme680.h" 14 14 15 + struct bme680_spi_bus_context { 16 + struct spi_device *spi; 17 + u8 current_page; 18 + }; 19 + 20 + /* 21 + * In SPI mode there are only 7 address bits, a "page" register determines 22 + * which part of the 8-bit range is active. This function looks at the address 23 + * and writes the page selection bit if needed 24 + */ 25 + static int bme680_regmap_spi_select_page( 26 + struct bme680_spi_bus_context *ctx, u8 reg) 27 + { 28 + struct spi_device *spi = ctx->spi; 29 + int ret; 30 + u8 buf[2]; 31 + u8 page = (reg & 0x80) ? 0 : 1; /* Page "1" is low range */ 32 + 33 + if (page == ctx->current_page) 34 + return 0; 35 + 36 + /* 37 + * Data sheet claims we're only allowed to change bit 4, so we must do 38 + * a read-modify-write on each and every page select 39 + */ 40 + buf[0] = BME680_REG_STATUS; 41 + ret = spi_write_then_read(spi, buf, 1, buf + 1, 1); 42 + if (ret < 0) { 43 + dev_err(&spi->dev, "failed to set page %u\n", page); 44 + return ret; 45 + } 46 + 47 + buf[0] = BME680_REG_STATUS; 48 + if (page) 49 + buf[1] |= BME680_SPI_MEM_PAGE_BIT; 50 + else 51 + buf[1] &= ~BME680_SPI_MEM_PAGE_BIT; 52 + 53 + ret = spi_write(spi, buf, 2); 54 + if (ret < 0) { 55 + dev_err(&spi->dev, "failed to set page %u\n", page); 56 + return ret; 57 + } 58 + 59 + ctx->current_page = page; 60 + 61 + return 0; 62 + } 63 + 15 64 static int bme680_regmap_spi_write(void *context, const void *data, 16 65 size_t count) 17 66 { 18 - struct spi_device *spi = context; 67 + struct bme680_spi_bus_context *ctx = context; 68 + struct spi_device *spi = ctx->spi; 69 + int ret; 19 70 u8 buf[2]; 20 71 21 72 memcpy(buf, data, 2); 73 + 74 + ret = bme680_regmap_spi_select_page(ctx, buf[0]); 75 + if (ret) 76 + return ret; 77 + 22 78 /* 23 79 * The SPI register address (= full register address without bit 7) 24 80 * and the write command (bit7 = RW = '0') 25 81 */ 26 82 buf[0] &= ~0x80; 27 83 28 - return spi_write_then_read(spi, buf, 2, NULL, 0); 84 + return spi_write(spi, buf, 2); 29 85 } 30 86 31 87 static int bme680_regmap_spi_read(void *context, const void *reg, 32 88 size_t reg_size, void *val, size_t val_size) 33 89 { 34 - struct spi_device *spi = context; 90 + struct bme680_spi_bus_context *ctx = context; 91 + struct spi_device *spi = ctx->spi; 92 + int ret; 93 + u8 addr = *(const u8 *)reg; 35 94 36 - return spi_write_then_read(spi, reg, reg_size, val, val_size); 95 + ret = bme680_regmap_spi_select_page(ctx, addr); 96 + if (ret) 97 + return ret; 98 + 99 + addr |= 0x80; /* bit7 = RW = '1' */ 100 + 101 + return spi_write_then_read(spi, &addr, 1, val, val_size); 37 102 } 38 103 39 104 static struct regmap_bus bme680_regmap_bus = { ··· 111 46 static int bme680_spi_probe(struct spi_device *spi) 112 47 { 113 48 const struct spi_device_id *id = spi_get_device_id(spi); 49 + struct bme680_spi_bus_context *bus_context; 114 50 struct regmap *regmap; 115 - unsigned int val; 116 51 int ret; 117 52 118 53 spi->bits_per_word = 8; ··· 122 57 return ret; 123 58 } 124 59 60 + bus_context = devm_kzalloc(&spi->dev, sizeof(*bus_context), GFP_KERNEL); 61 + if (!bus_context) 62 + return -ENOMEM; 63 + 64 + bus_context->spi = spi; 65 + bus_context->current_page = 0xff; /* Undefined on warm boot */ 66 + 125 67 regmap = devm_regmap_init(&spi->dev, &bme680_regmap_bus, 126 - &spi->dev, &bme680_regmap_config); 68 + bus_context, &bme680_regmap_config); 127 69 if (IS_ERR(regmap)) { 128 70 dev_err(&spi->dev, "Failed to register spi regmap %d\n", 129 71 (int)PTR_ERR(regmap)); 130 72 return PTR_ERR(regmap); 131 - } 132 - 133 - ret = regmap_write(regmap, BME680_REG_SOFT_RESET_SPI, 134 - BME680_CMD_SOFTRESET); 135 - if (ret < 0) { 136 - dev_err(&spi->dev, "Failed to reset chip\n"); 137 - return ret; 138 - } 139 - 140 - /* after power-on reset, Page 0(0x80-0xFF) of spi_mem_page is active */ 141 - ret = regmap_read(regmap, BME680_REG_CHIP_SPI_ID, &val); 142 - if (ret < 0) { 143 - dev_err(&spi->dev, "Error reading SPI chip ID\n"); 144 - return ret; 145 - } 146 - 147 - if (val != BME680_CHIP_ID_VAL) { 148 - dev_err(&spi->dev, "Wrong chip ID, got %x expected %x\n", 149 - val, BME680_CHIP_ID_VAL); 150 - return -ENODEV; 151 - } 152 - /* 153 - * select Page 1 of spi_mem_page to enable access to 154 - * to registers from address 0x00 to 0x7F. 155 - */ 156 - ret = regmap_write_bits(regmap, BME680_REG_STATUS, 157 - BME680_SPI_MEM_PAGE_BIT, 158 - BME680_SPI_MEM_PAGE_1_VAL); 159 - if (ret < 0) { 160 - dev_err(&spi->dev, "failed to set page 1 of spi_mem_page\n"); 161 - return ret; 162 73 } 163 74 164 75 return bme680_core_probe(&spi->dev, regmap, id->name);
+4 -3
drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c
··· 103 103 * Do not use IIO_DEGREE_TO_RAD to avoid precision 104 104 * loss. Round to the nearest integer. 105 105 */ 106 - *val = div_s64(val64 * 314159 + 9000000ULL, 1000); 107 - *val2 = 18000 << (CROS_EC_SENSOR_BITS - 1); 108 - ret = IIO_VAL_FRACTIONAL; 106 + *val = 0; 107 + *val2 = div_s64(val64 * 3141592653ULL, 108 + 180 << (CROS_EC_SENSOR_BITS - 1)); 109 + ret = IIO_VAL_INT_PLUS_NANO; 109 110 break; 110 111 case MOTIONSENSE_TYPE_MAG: 111 112 /*
+1
drivers/iio/dac/mcp4725.c
··· 92 92 93 93 inoutbuf[0] = 0x60; /* write EEPROM */ 94 94 inoutbuf[0] |= data->ref_mode << 3; 95 + inoutbuf[0] |= data->powerdown ? ((data->powerdown_mode + 1) << 1) : 0; 95 96 inoutbuf[1] = data->dac_value >> 4; 96 97 inoutbuf[2] = (data->dac_value & 0xf) << 4; 97 98
+3 -3
drivers/iio/gyro/bmg160_core.c
··· 582 582 case IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY: 583 583 return bmg160_get_filter(data, val); 584 584 case IIO_CHAN_INFO_SCALE: 585 - *val = 0; 586 585 switch (chan->type) { 587 586 case IIO_TEMP: 588 - *val2 = 500000; 589 - return IIO_VAL_INT_PLUS_MICRO; 587 + *val = 500; 588 + return IIO_VAL_INT; 590 589 case IIO_ANGL_VEL: 591 590 { 592 591 int i; ··· 593 594 for (i = 0; i < ARRAY_SIZE(bmg160_scale_table); ++i) { 594 595 if (bmg160_scale_table[i].dps_range == 595 596 data->dps_range) { 597 + *val = 0; 596 598 *val2 = bmg160_scale_table[i].scale; 597 599 return IIO_VAL_INT_PLUS_MICRO; 598 600 }
+5 -3
drivers/iio/gyro/mpu3050-core.c
··· 29 29 30 30 #include "mpu3050.h" 31 31 32 - #define MPU3050_CHIP_ID 0x69 32 + #define MPU3050_CHIP_ID 0x68 33 + #define MPU3050_CHIP_ID_MASK 0x7E 33 34 34 35 /* 35 36 * Register map: anything suffixed *_H is a big-endian high byte and always ··· 1177 1176 goto err_power_down; 1178 1177 } 1179 1178 1180 - if (val != MPU3050_CHIP_ID) { 1181 - dev_err(dev, "unsupported chip id %02x\n", (u8)val); 1179 + if ((val & MPU3050_CHIP_ID_MASK) != MPU3050_CHIP_ID) { 1180 + dev_err(dev, "unsupported chip id %02x\n", 1181 + (u8)(val & MPU3050_CHIP_ID_MASK)); 1182 1182 ret = -ENODEV; 1183 1183 goto err_power_down; 1184 1184 }
+2 -3
drivers/iio/industrialio-buffer.c
··· 320 320 const unsigned long *mask; 321 321 unsigned long *trialmask; 322 322 323 - trialmask = kmalloc_array(BITS_TO_LONGS(indio_dev->masklength), 324 - sizeof(*trialmask), 325 - GFP_KERNEL); 323 + trialmask = kcalloc(BITS_TO_LONGS(indio_dev->masklength), 324 + sizeof(*trialmask), GFP_KERNEL); 326 325 if (trialmask == NULL) 327 326 return -ENOMEM; 328 327 if (!indio_dev->masklength) {
+2 -2
drivers/iio/industrialio-core.c
··· 1743 1743 **/ 1744 1744 void iio_device_unregister(struct iio_dev *indio_dev) 1745 1745 { 1746 - mutex_lock(&indio_dev->info_exist_lock); 1747 - 1748 1746 cdev_device_del(&indio_dev->chrdev, &indio_dev->dev); 1747 + 1748 + mutex_lock(&indio_dev->info_exist_lock); 1749 1749 1750 1750 iio_device_unregister_debugfs(indio_dev); 1751 1751
+4 -6
drivers/staging/comedi/drivers/ni_usb6501.c
··· 463 463 464 464 size = usb_endpoint_maxp(devpriv->ep_tx); 465 465 devpriv->usb_tx_buf = kzalloc(size, GFP_KERNEL); 466 - if (!devpriv->usb_tx_buf) { 467 - kfree(devpriv->usb_rx_buf); 466 + if (!devpriv->usb_tx_buf) 468 467 return -ENOMEM; 469 - } 470 468 471 469 return 0; 472 470 } ··· 516 518 if (!devpriv) 517 519 return -ENOMEM; 518 520 521 + mutex_init(&devpriv->mut); 522 + usb_set_intfdata(intf, devpriv); 523 + 519 524 ret = ni6501_find_endpoints(dev); 520 525 if (ret) 521 526 return ret; ··· 526 525 ret = ni6501_alloc_usb_buffers(dev); 527 526 if (ret) 528 527 return ret; 529 - 530 - mutex_init(&devpriv->mut); 531 - usb_set_intfdata(intf, devpriv); 532 528 533 529 ret = comedi_alloc_subdevices(dev, 2); 534 530 if (ret)
+3 -5
drivers/staging/comedi/drivers/vmk80xx.c
··· 682 682 683 683 size = usb_endpoint_maxp(devpriv->ep_tx); 684 684 devpriv->usb_tx_buf = kzalloc(size, GFP_KERNEL); 685 - if (!devpriv->usb_tx_buf) { 686 - kfree(devpriv->usb_rx_buf); 685 + if (!devpriv->usb_tx_buf) 687 686 return -ENOMEM; 688 - } 689 687 690 688 return 0; 691 689 } ··· 798 800 799 801 devpriv->model = board->model; 800 802 803 + sema_init(&devpriv->limit_sem, 8); 804 + 801 805 ret = vmk80xx_find_usb_endpoints(dev); 802 806 if (ret) 803 807 return ret; ··· 807 807 ret = vmk80xx_alloc_usb_buffers(dev); 808 808 if (ret) 809 809 return ret; 810 - 811 - sema_init(&devpriv->limit_sem, 8); 812 810 813 811 usb_set_intfdata(intf, devpriv); 814 812
+1 -1
drivers/staging/erofs/data.c
··· 298 298 *last_block = current_block; 299 299 300 300 /* shift in advance in case of it followed by too many gaps */ 301 - if (unlikely(bio->bi_vcnt >= bio->bi_max_vecs)) { 301 + if (bio->bi_iter.bi_size >= bio->bi_max_vecs * PAGE_SIZE) { 302 302 /* err should reassign to 0 after submitting */ 303 303 err = 0; 304 304 goto submit_bio_out;
+4 -4
drivers/staging/iio/adc/ad7192.c
··· 109 109 #define AD7192_CH_AIN3 BIT(6) /* AIN3 - AINCOM */ 110 110 #define AD7192_CH_AIN4 BIT(7) /* AIN4 - AINCOM */ 111 111 112 - #define AD7193_CH_AIN1P_AIN2M 0x000 /* AIN1(+) - AIN2(-) */ 113 - #define AD7193_CH_AIN3P_AIN4M 0x001 /* AIN3(+) - AIN4(-) */ 114 - #define AD7193_CH_AIN5P_AIN6M 0x002 /* AIN5(+) - AIN6(-) */ 115 - #define AD7193_CH_AIN7P_AIN8M 0x004 /* AIN7(+) - AIN8(-) */ 112 + #define AD7193_CH_AIN1P_AIN2M 0x001 /* AIN1(+) - AIN2(-) */ 113 + #define AD7193_CH_AIN3P_AIN4M 0x002 /* AIN3(+) - AIN4(-) */ 114 + #define AD7193_CH_AIN5P_AIN6M 0x004 /* AIN5(+) - AIN6(-) */ 115 + #define AD7193_CH_AIN7P_AIN8M 0x008 /* AIN7(+) - AIN8(-) */ 116 116 #define AD7193_CH_TEMP 0x100 /* Temp senseor */ 117 117 #define AD7193_CH_AIN2P_AIN2M 0x200 /* AIN2(+) - AIN2(-) */ 118 118 #define AD7193_CH_AIN1 0x401 /* AIN1 - AINCOM */
+1 -1
drivers/staging/iio/meter/ade7854.c
··· 269 269 static IIO_DEV_ATTR_IPEAK(0644, 270 270 ade7854_read_32bit, 271 271 ade7854_write_32bit, 272 - ADE7854_VPEAK); 272 + ADE7854_IPEAK); 273 273 static IIO_DEV_ATTR_APHCAL(0644, 274 274 ade7854_read_16bit, 275 275 ade7854_write_16bit,
+1 -1
drivers/staging/most/core.c
··· 1431 1431 1432 1432 INIT_LIST_HEAD(&iface->p->channel_list); 1433 1433 iface->p->dev_id = id; 1434 - snprintf(iface->p->name, STRING_SIZE, "mdev%d", id); 1434 + strcpy(iface->p->name, iface->description); 1435 1435 iface->dev.init_name = iface->p->name; 1436 1436 iface->dev.bus = &mc.bus; 1437 1437 iface->dev.parent = &mc.dev;