Merge tag 'char-misc-6.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc

Pull char/misc/iio driver fixes from Greg KH:
"Here are some small char/misc/iio and some other minor driver
subsystem fixes for 6.19-rc7. Nothing huge here, just some fixes for
reported issues including:

- lots of little iio driver fixes

- comedi driver fixes

- mux driver fix

- w1 driver fixes

- uio driver fix

- slimbus driver fixes

- hwtracing bugfix

- other tiny bugfixes

All of these have been in linux-next for a while with no reported
issues"

* tag 'char-misc-6.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (36 commits)
comedi: dmm32at: serialize use of paged registers
mei: trace: treat reg parameter as string
uio: pci_sva: correct '-ENODEV' check logic
uacce: ensure safe queue release with state management
uacce: implement mremap in uacce_vm_ops to return -EPERM
uacce: fix isolate sysfs check condition
uacce: fix cdev handling in the cleanup path
slimbus: core: clean up of_slim_get_device()
slimbus: core: fix of_slim_get_device() kernel doc
slimbus: core: amend slim_get_device() kernel doc
slimbus: core: fix device reference leak on report present
slimbus: core: fix runtime PM imbalance on report present
slimbus: core: fix OF node leak on registration failure
intel_th: rename error label
intel_th: fix device leak on output open()
comedi: Fix getting range information for subdevices 16 to 255
mux: mmio: Fix IS_ERR() vs NULL check in probe()
interconnect: debugfs: initialize src_node and dst_node to empty strings
iio: dac: ad3552r-hs: fix out-of-bound write in ad3552r_hs_write_data_source
iio: accel: iis328dq: fix gain values
...

+312 -138
+31
Documentation/devicetree/bindings/interconnect/qcom,sa8775p-rpmh.yaml
··· 74 - description: aggre UFS CARD AXI clock 75 - description: RPMH CC IPA clock 76 77 unevaluatedProperties: false 78 79 examples:
··· 74 - description: aggre UFS CARD AXI clock 75 - description: RPMH CC IPA clock 76 77 + - if: 78 + properties: 79 + compatible: 80 + contains: 81 + enum: 82 + - qcom,sa8775p-config-noc 83 + - qcom,sa8775p-dc-noc 84 + - qcom,sa8775p-gem-noc 85 + - qcom,sa8775p-gpdsp-anoc 86 + - qcom,sa8775p-lpass-ag-noc 87 + - qcom,sa8775p-mmss-noc 88 + - qcom,sa8775p-nspa-noc 89 + - qcom,sa8775p-nspb-noc 90 + - qcom,sa8775p-pcie-anoc 91 + - qcom,sa8775p-system-noc 92 + then: 93 + properties: 94 + clocks: false 95 + 96 + - if: 97 + properties: 98 + compatible: 99 + contains: 100 + enum: 101 + - qcom,sa8775p-clk-virt 102 + - qcom,sa8775p-mc-virt 103 + then: 104 + properties: 105 + reg: false 106 + clocks: false 107 + 108 unevaluatedProperties: false 109 110 examples:
+1
MAINTAINERS
··· 13172 F: Documentation/driver-api/interconnect.rst 13173 F: drivers/interconnect/ 13174 F: include/dt-bindings/interconnect/ 13175 F: include/linux/interconnect-provider.h 13176 F: include/linux/interconnect.h 13177
··· 13172 F: Documentation/driver-api/interconnect.rst 13173 F: drivers/interconnect/ 13174 F: include/dt-bindings/interconnect/ 13175 + F: include/linux/interconnect-clk.h 13176 F: include/linux/interconnect-provider.h 13177 F: include/linux/interconnect.h 13178
+1 -1
drivers/comedi/comedi_fops.c
··· 1155 for (i = 0; i < s->n_chan; i++) { 1156 int x; 1157 1158 - x = (dev->minor << 28) | (it->subdev << 24) | (i << 16) | 1159 (s->range_table_list[i]->length); 1160 if (put_user(x, it->rangelist + i)) 1161 return -EFAULT;
··· 1155 for (i = 0; i < s->n_chan; i++) { 1156 int x; 1157 1158 + x = (it->subdev << 24) | (i << 16) | 1159 (s->range_table_list[i]->length); 1160 if (put_user(x, it->rangelist + i)) 1161 return -EFAULT;
+30 -2
drivers/comedi/drivers/dmm32at.c
··· 330 331 static void dmm32at_setaitimer(struct comedi_device *dev, unsigned int nansec) 332 { 333 unsigned char lo1, lo2, hi2; 334 unsigned short both2; 335 ··· 342 343 /* set counter clocks to 10MHz, disable all aux dio */ 344 outb(0, dev->iobase + DMM32AT_CTRDIO_CFG_REG); 345 346 /* get access to the clock regs */ 347 outb(DMM32AT_CTRL_PAGE_8254, dev->iobase + DMM32AT_CTRL_REG); ··· 358 outb(lo2, dev->iobase + DMM32AT_CLK2); 359 outb(hi2, dev->iobase + DMM32AT_CLK2); 360 361 /* enable the ai conversion interrupt and the clock to start scans */ 362 outb(DMM32AT_INTCLK_ADINT | 363 DMM32AT_INTCLK_CLKEN | DMM32AT_INTCLK_CLKSEL, ··· 369 static int dmm32at_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) 370 { 371 struct comedi_cmd *cmd = &s->async->cmd; 372 int ret; 373 374 dmm32at_ai_set_chanspec(dev, s, cmd->chanlist[0], cmd->chanlist_len); 375 376 /* reset the interrupt just in case */ 377 outb(DMM32AT_CTRL_INTRST, dev->iobase + DMM32AT_CTRL_REG); 378 379 /* 380 * wait for circuit to settle ··· 441 comedi_handle_events(dev, s); 442 } 443 444 /* reset the interrupt */ 445 outb(DMM32AT_CTRL_INTRST, dev->iobase + DMM32AT_CTRL_REG); 446 return IRQ_HANDLED; 447 } 448 ··· 498 static int dmm32at_8255_io(struct comedi_device *dev, 499 int dir, int port, int data, unsigned long regbase) 500 { 501 /* get access to the DIO regs */ 502 outb(DMM32AT_CTRL_PAGE_8255, dev->iobase + DMM32AT_CTRL_REG); 503 504 if (dir) { 505 outb(data, dev->iobase + regbase + port); 506 - return 0; 507 } 508 - return inb(dev->iobase + regbase + port); 509 } 510 511 /* Make sure the board is there and put it to a known state */
··· 330 331 static void dmm32at_setaitimer(struct comedi_device *dev, unsigned int nansec) 332 { 333 + unsigned long irq_flags; 334 unsigned char lo1, lo2, hi2; 335 unsigned short both2; 336 ··· 341 342 /* set counter clocks to 10MHz, disable all aux dio */ 343 outb(0, dev->iobase + DMM32AT_CTRDIO_CFG_REG); 344 + 345 + /* serialize access to control register and paged registers */ 346 + spin_lock_irqsave(&dev->spinlock, irq_flags); 347 348 /* get access to the clock regs */ 349 outb(DMM32AT_CTRL_PAGE_8254, dev->iobase + DMM32AT_CTRL_REG); ··· 354 outb(lo2, dev->iobase + DMM32AT_CLK2); 355 outb(hi2, dev->iobase + DMM32AT_CLK2); 356 357 + spin_unlock_irqrestore(&dev->spinlock, irq_flags); 358 + 359 /* enable the ai conversion interrupt and the clock to start scans */ 360 outb(DMM32AT_INTCLK_ADINT | 361 DMM32AT_INTCLK_CLKEN | DMM32AT_INTCLK_CLKSEL, ··· 363 static int dmm32at_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) 364 { 365 struct comedi_cmd *cmd = &s->async->cmd; 366 + unsigned long irq_flags; 367 int ret; 368 369 dmm32at_ai_set_chanspec(dev, s, cmd->chanlist[0], cmd->chanlist_len); 370 371 + /* serialize access to control register and paged registers */ 372 + spin_lock_irqsave(&dev->spinlock, irq_flags); 373 + 374 /* reset the interrupt just in case */ 375 outb(DMM32AT_CTRL_INTRST, dev->iobase + DMM32AT_CTRL_REG); 376 + 377 + spin_unlock_irqrestore(&dev->spinlock, irq_flags); 378 379 /* 380 * wait for circuit to settle ··· 429 comedi_handle_events(dev, s); 430 } 431 432 + /* serialize access to control register and paged registers */ 433 + spin_lock(&dev->spinlock); 434 + 435 /* reset the interrupt */ 436 outb(DMM32AT_CTRL_INTRST, dev->iobase + DMM32AT_CTRL_REG); 437 + 438 + spin_unlock(&dev->spinlock); 439 return IRQ_HANDLED; 440 } 441 ··· 481 static int dmm32at_8255_io(struct comedi_device *dev, 482 int dir, int port, int data, unsigned long regbase) 483 { 484 + unsigned long irq_flags; 485 + int ret; 486 + 487 + /* serialize access to control register and paged registers */ 488 + spin_lock_irqsave(&dev->spinlock, irq_flags); 489 + 490 /* get access to the DIO regs */ 491 outb(DMM32AT_CTRL_PAGE_8255, dev->iobase + DMM32AT_CTRL_REG); 492 493 if (dir) { 494 outb(data, dev->iobase + regbase + port); 495 + ret = 0; 496 + } else { 497 + ret = inb(dev->iobase + regbase + port); 498 } 499 + 500 + spin_unlock_irqrestore(&dev->spinlock, irq_flags); 501 + 502 + return ret; 503 } 504 505 /* Make sure the board is there and put it to a known state */
+1 -1
drivers/comedi/range.c
··· 52 const struct comedi_lrange *lr; 53 struct comedi_subdevice *s; 54 55 - subd = (it->range_type >> 24) & 0xf; 56 chan = (it->range_type >> 16) & 0xff; 57 58 if (!dev->attached)
··· 52 const struct comedi_lrange *lr; 53 struct comedi_subdevice *s; 54 55 + subd = (it->range_type >> 24) & 0xff; 56 chan = (it->range_type >> 16) & 0xff; 57 58 if (!dev->attached)
+19 -6
drivers/hwtracing/intel_th/core.c
··· 810 int err; 811 812 dev = bus_find_device_by_devt(&intel_th_bus, inode->i_rdev); 813 - if (!dev || !dev->driver) { 814 err = -ENODEV; 815 - goto out_no_device; 816 } 817 818 thdrv = to_intel_th_driver(dev->driver); 819 fops = fops_get(thdrv->fops); 820 if (!fops) { 821 err = -ENODEV; 822 - goto out_put_device; 823 } 824 825 replace_fops(file, fops); ··· 832 if (file->f_op->open) { 833 err = file->f_op->open(inode, file); 834 if (err) 835 - goto out_put_device; 836 } 837 838 return 0; 839 840 - out_put_device: 841 put_device(dev); 842 - out_no_device: 843 return err; 844 } 845 846 static const struct file_operations intel_th_output_fops = { 847 .open = intel_th_output_open, 848 .llseek = noop_llseek, 849 }; 850
··· 810 int err; 811 812 dev = bus_find_device_by_devt(&intel_th_bus, inode->i_rdev); 813 + if (!dev) 814 + return -ENODEV; 815 + 816 + if (!dev->driver) { 817 err = -ENODEV; 818 + goto err_put_dev; 819 } 820 821 thdrv = to_intel_th_driver(dev->driver); 822 fops = fops_get(thdrv->fops); 823 if (!fops) { 824 err = -ENODEV; 825 + goto err_put_dev; 826 } 827 828 replace_fops(file, fops); ··· 829 if (file->f_op->open) { 830 err = file->f_op->open(inode, file); 831 if (err) 832 + goto err_put_dev; 833 } 834 835 return 0; 836 837 + err_put_dev: 838 put_device(dev); 839 + 840 return err; 841 + } 842 + 843 + static int intel_th_output_release(struct inode *inode, struct file *file) 844 + { 845 + struct intel_th_device *thdev = file->private_data; 846 + 847 + put_device(&thdev->dev); 848 + 849 + return 0; 850 } 851 852 static const struct file_operations intel_th_output_fops = { 853 .open = intel_th_output_open, 854 + .release = intel_th_output_release, 855 .llseek = noop_llseek, 856 }; 857
+3 -3
drivers/iio/accel/adxl380.c
··· 1784 st->int_map[1] = ADXL380_INT0_MAP1_REG; 1785 } else { 1786 st->irq = fwnode_irq_get_byname(dev_fwnode(st->dev), "INT1"); 1787 - if (st->irq > 0) 1788 - return dev_err_probe(st->dev, -ENODEV, 1789 - "no interrupt name specified"); 1790 st->int_map[0] = ADXL380_INT1_MAP0_REG; 1791 st->int_map[1] = ADXL380_INT1_MAP1_REG; 1792 }
··· 1784 st->int_map[1] = ADXL380_INT0_MAP1_REG; 1785 } else { 1786 st->irq = fwnode_irq_get_byname(dev_fwnode(st->dev), "INT1"); 1787 + if (st->irq < 0) 1788 + return dev_err_probe(st->dev, st->irq, 1789 + "no interrupt name specified\n"); 1790 st->int_map[0] = ADXL380_INT1_MAP0_REG; 1791 st->int_map[1] = ADXL380_INT1_MAP1_REG; 1792 }
+71 -1
drivers/iio/accel/st_accel_core.c
··· 517 .wai_addr = ST_SENSORS_DEFAULT_WAI_ADDRESS, 518 .sensors_supported = { 519 [0] = H3LIS331DL_ACCEL_DEV_NAME, 520 - [1] = IIS328DQ_ACCEL_DEV_NAME, 521 }, 522 .ch = (struct iio_chan_spec *)st_accel_12bit_channels, 523 .odr = { ··· 557 .num = ST_ACCEL_FS_AVL_400G, 558 .value = 0x03, 559 .gain = IIO_G_TO_M_S_2(195000), 560 }, 561 }, 562 },
··· 517 .wai_addr = ST_SENSORS_DEFAULT_WAI_ADDRESS, 518 .sensors_supported = { 519 [0] = H3LIS331DL_ACCEL_DEV_NAME, 520 }, 521 .ch = (struct iio_chan_spec *)st_accel_12bit_channels, 522 .odr = { ··· 558 .num = ST_ACCEL_FS_AVL_400G, 559 .value = 0x03, 560 .gain = IIO_G_TO_M_S_2(195000), 561 + }, 562 + }, 563 + }, 564 + .bdu = { 565 + .addr = 0x23, 566 + .mask = 0x80, 567 + }, 568 + .drdy_irq = { 569 + .int1 = { 570 + .addr = 0x22, 571 + .mask = 0x02, 572 + }, 573 + .int2 = { 574 + .addr = 0x22, 575 + .mask = 0x10, 576 + }, 577 + .addr_ihl = 0x22, 578 + .mask_ihl = 0x80, 579 + }, 580 + .sim = { 581 + .addr = 0x23, 582 + .value = BIT(0), 583 + }, 584 + .multi_read_bit = true, 585 + .bootime = 2, 586 + }, 587 + { 588 + .wai = 0x32, 589 + .wai_addr = ST_SENSORS_DEFAULT_WAI_ADDRESS, 590 + .sensors_supported = { 591 + [0] = IIS328DQ_ACCEL_DEV_NAME, 592 + }, 593 + .ch = (struct iio_chan_spec *)st_accel_12bit_channels, 594 + .odr = { 595 + .addr = 0x20, 596 + .mask = 0x18, 597 + .odr_avl = { 598 + { .hz = 50, .value = 0x00, }, 599 + { .hz = 100, .value = 0x01, }, 600 + { .hz = 400, .value = 0x02, }, 601 + { .hz = 1000, .value = 0x03, }, 602 + }, 603 + }, 604 + .pw = { 605 + .addr = 0x20, 606 + .mask = 0x20, 607 + .value_on = ST_SENSORS_DEFAULT_POWER_ON_VALUE, 608 + .value_off = ST_SENSORS_DEFAULT_POWER_OFF_VALUE, 609 + }, 610 + .enable_axis = { 611 + .addr = ST_SENSORS_DEFAULT_AXIS_ADDR, 612 + .mask = ST_SENSORS_DEFAULT_AXIS_MASK, 613 + }, 614 + .fs = { 615 + .addr = 0x23, 616 + .mask = 0x30, 617 + .fs_avl = { 618 + [0] = { 619 + .num = ST_ACCEL_FS_AVL_100G, 620 + .value = 0x00, 621 + .gain = IIO_G_TO_M_S_2(980), 622 + }, 623 + [1] = { 624 + .num = ST_ACCEL_FS_AVL_200G, 625 + .value = 0x01, 626 + .gain = IIO_G_TO_M_S_2(1950), 627 + }, 628 + [2] = { 629 + .num = ST_ACCEL_FS_AVL_400G, 630 + .value = 0x03, 631 + .gain = IIO_G_TO_M_S_2(3910), 632 }, 633 }, 634 },
+3 -1
drivers/iio/adc/ad7280a.c
··· 1024 1025 st->spi->max_speed_hz = AD7280A_MAX_SPI_CLK_HZ; 1026 st->spi->mode = SPI_MODE_1; 1027 - spi_setup(st->spi); 1028 1029 st->ctrl_lb = FIELD_PREP(AD7280A_CTRL_LB_ACQ_TIME_MSK, st->acquisition_time) | 1030 FIELD_PREP(AD7280A_CTRL_LB_THERMISTOR_MSK, st->thermistor_term_en);
··· 1024 1025 st->spi->max_speed_hz = AD7280A_MAX_SPI_CLK_HZ; 1026 st->spi->mode = SPI_MODE_1; 1027 + ret = spi_setup(st->spi); 1028 + if (ret < 0) 1029 + return ret; 1030 1031 st->ctrl_lb = FIELD_PREP(AD7280A_CTRL_LB_ACQ_TIME_MSK, st->acquisition_time) | 1032 FIELD_PREP(AD7280A_CTRL_LB_THERMISTOR_MSK, st->thermistor_term_en);
+2 -1
drivers/iio/adc/ad7606_par.c
··· 43 struct iio_dev *indio_dev) 44 { 45 struct ad7606_state *st = iio_priv(indio_dev); 46 - unsigned int ret, c; 47 struct iio_backend_data_fmt data = { 48 .sign_extend = true, 49 .enable = true,
··· 43 struct iio_dev *indio_dev) 44 { 45 struct ad7606_state *st = iio_priv(indio_dev); 46 + unsigned int c; 47 + int ret; 48 struct iio_backend_data_fmt data = { 49 .sign_extend = true, 50 .enable = true,
+1 -1
drivers/iio/adc/ad9467.c
··· 95 96 #define CHIPID_AD9434 0x6A 97 #define AD9434_DEF_OUTPUT_MODE 0x00 98 - #define AD9434_REG_VREF_MASK 0xC0 99 100 /* 101 * Analog Devices AD9467 16-Bit, 200/250 MSPS ADC
··· 95 96 #define CHIPID_AD9434 0x6A 97 #define AD9434_DEF_OUTPUT_MODE 0x00 98 + #define AD9434_REG_VREF_MASK GENMASK(4, 0) 99 100 /* 101 * Analog Devices AD9467 16-Bit, 200/250 MSPS ADC
+1
drivers/iio/adc/at91-sama5d2_adc.c
··· 2481 struct at91_adc_state *st = iio_priv(indio_dev); 2482 2483 iio_device_unregister(indio_dev); 2484 2485 at91_adc_dma_disable(st); 2486
··· 2481 struct at91_adc_state *st = iio_priv(indio_dev); 2482 2483 iio_device_unregister(indio_dev); 2484 + cancel_work_sync(&st->touch_st.workq); 2485 2486 at91_adc_dma_disable(st); 2487
+2 -13
drivers/iio/adc/exynos_adc.c
··· 540 ADC_CHANNEL(9, "adc9"), 541 }; 542 543 - static int exynos_adc_remove_devices(struct device *dev, void *c) 544 - { 545 - struct platform_device *pdev = to_platform_device(dev); 546 - 547 - platform_device_unregister(pdev); 548 - 549 - return 0; 550 - } 551 - 552 static int exynos_adc_probe(struct platform_device *pdev) 553 { 554 struct exynos_adc *info = NULL; ··· 651 return 0; 652 653 err_of_populate: 654 - device_for_each_child(&indio_dev->dev, NULL, 655 - exynos_adc_remove_devices); 656 iio_device_unregister(indio_dev); 657 err_irq: 658 free_irq(info->irq, info); ··· 671 struct iio_dev *indio_dev = platform_get_drvdata(pdev); 672 struct exynos_adc *info = iio_priv(indio_dev); 673 674 - device_for_each_child(&indio_dev->dev, NULL, 675 - exynos_adc_remove_devices); 676 iio_device_unregister(indio_dev); 677 free_irq(info->irq, info); 678 if (info->data->exit_hw)
··· 540 ADC_CHANNEL(9, "adc9"), 541 }; 542 543 static int exynos_adc_probe(struct platform_device *pdev) 544 { 545 struct exynos_adc *info = NULL; ··· 660 return 0; 661 662 err_of_populate: 663 + of_platform_depopulate(&indio_dev->dev); 664 iio_device_unregister(indio_dev); 665 err_irq: 666 free_irq(info->irq, info); ··· 681 struct iio_dev *indio_dev = platform_get_drvdata(pdev); 682 struct exynos_adc *info = iio_priv(indio_dev); 683 684 + of_platform_depopulate(&indio_dev->dev); 685 iio_device_unregister(indio_dev); 686 free_irq(info->irq, info); 687 if (info->data->exit_hw)
+3 -3
drivers/iio/adc/pac1934.c
··· 665 /* add the power_acc field */ 666 curr_energy += inc; 667 668 - clamp(curr_energy, PAC_193X_MIN_POWER_ACC, PAC_193X_MAX_POWER_ACC); 669 - 670 - reg_data->energy_sec_acc[cnt] = curr_energy; 671 } 672 673 offset_reg_data_p += PAC1934_VPOWER_ACC_REG_LEN;
··· 665 /* add the power_acc field */ 666 curr_energy += inc; 667 668 + reg_data->energy_sec_acc[cnt] = clamp(curr_energy, 669 + PAC_193X_MIN_POWER_ACC, 670 + PAC_193X_MAX_POWER_ACC); 671 } 672 673 offset_reg_data_p += PAC1934_VPOWER_ACC_REG_LEN;
+3 -3
drivers/iio/chemical/scd4x.c
··· 584 .sign = 'u', 585 .realbits = 16, 586 .storagebits = 16, 587 - .endianness = IIO_BE, 588 }, 589 }, 590 { ··· 599 .sign = 'u', 600 .realbits = 16, 601 .storagebits = 16, 602 - .endianness = IIO_BE, 603 }, 604 }, 605 { ··· 612 .sign = 'u', 613 .realbits = 16, 614 .storagebits = 16, 615 - .endianness = IIO_BE, 616 }, 617 }, 618 };
··· 584 .sign = 'u', 585 .realbits = 16, 586 .storagebits = 16, 587 + .endianness = IIO_CPU, 588 }, 589 }, 590 { ··· 599 .sign = 'u', 600 .realbits = 16, 601 .storagebits = 16, 602 + .endianness = IIO_CPU, 603 }, 604 }, 605 { ··· 612 .sign = 'u', 613 .realbits = 16, 614 .storagebits = 16, 615 + .endianness = IIO_CPU, 616 }, 617 }, 618 };
+4 -1
drivers/iio/dac/ad3552r-hs.c
··· 549 550 guard(mutex)(&st->lock); 551 552 ret = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, userbuf, 553 count); 554 if (ret < 0) 555 return ret; 556 557 - buf[count] = '\0'; 558 559 ret = match_string(dbgfs_attr_source, ARRAY_SIZE(dbgfs_attr_source), 560 buf);
··· 549 550 guard(mutex)(&st->lock); 551 552 + if (count >= sizeof(buf)) 553 + return -ENOSPC; 554 + 555 ret = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, userbuf, 556 count); 557 if (ret < 0) 558 return ret; 559 560 + buf[ret] = '\0'; 561 562 ret = match_string(dbgfs_attr_source, ARRAY_SIZE(dbgfs_attr_source), 563 buf);
+6
drivers/iio/dac/ad5686.c
··· 434 .num_channels = 4, 435 .regmap_type = AD5686_REGMAP, 436 }, 437 [ID_AD5696] = { 438 .channels = ad5686_channels, 439 .num_channels = 4,
··· 434 .num_channels = 4, 435 .regmap_type = AD5686_REGMAP, 436 }, 437 + [ID_AD5695R] = { 438 + .channels = ad5685r_channels, 439 + .int_vref_mv = 2500, 440 + .num_channels = 4, 441 + .regmap_type = AD5686_REGMAP, 442 + }, 443 [ID_AD5696] = { 444 .channels = ad5686_channels, 445 .num_channels = 4,
+5 -4
drivers/iio/imu/inv_icm45600/inv_icm45600_core.c
··· 960 return IIO_VAL_INT; 961 /* 962 * T°C = (temp / 128) + 25 963 - * Tm°C = 1000 * ((temp * 100 / 12800) + 25) 964 - * scale: 100000 / 13248 = 7.8125 965 - * offset: 25000 966 */ 967 case IIO_CHAN_INFO_SCALE: 968 *val = 7; 969 *val2 = 812500; 970 return IIO_VAL_INT_PLUS_MICRO; 971 case IIO_CHAN_INFO_OFFSET: 972 - *val = 25000; 973 return IIO_VAL_INT; 974 default: 975 return -EINVAL;
··· 960 return IIO_VAL_INT; 961 /* 962 * T°C = (temp / 128) + 25 963 + * Tm°C = ((temp + 25 * 128) / 128)) * 1000 964 + * Tm°C = (temp + 3200) * (1000 / 128) 965 + * scale: 1000 / 128 = 7.8125 966 + * offset: 3200 967 */ 968 case IIO_CHAN_INFO_SCALE: 969 *val = 7; 970 *val2 = 812500; 971 return IIO_VAL_INT_PLUS_MICRO; 972 case IIO_CHAN_INFO_OFFSET: 973 + *val = 3200; 974 return IIO_VAL_INT; 975 default: 976 return -EINVAL;
+11 -4
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
··· 101 IIO_CHAN_SOFT_TIMESTAMP(3), 102 }; 103 104 static const struct iio_chan_spec st_lsm6dsx_gyro_channels[] = { 105 ST_LSM6DSX_CHANNEL(IIO_ANGL_VEL, 0x22, IIO_MOD_X, 0), 106 ST_LSM6DSX_CHANNEL(IIO_ANGL_VEL, 0x24, IIO_MOD_Y, 1), ··· 149 }, 150 .channels = { 151 [ST_LSM6DSX_ID_ACC] = { 152 - .chan = st_lsm6dsx_acc_channels, 153 - .len = ARRAY_SIZE(st_lsm6dsx_acc_channels), 154 }, 155 [ST_LSM6DSX_ID_GYRO] = { 156 .chan = st_lsm6ds0_gyro_channels, ··· 1456 }, 1457 .channels = { 1458 [ST_LSM6DSX_ID_ACC] = { 1459 - .chan = st_lsm6dsx_acc_channels, 1460 - .len = ARRAY_SIZE(st_lsm6dsx_acc_channels), 1461 }, 1462 [ST_LSM6DSX_ID_GYRO] = { 1463 .chan = st_lsm6dsx_gyro_channels,
··· 101 IIO_CHAN_SOFT_TIMESTAMP(3), 102 }; 103 104 + static const struct iio_chan_spec st_lsm6ds0_acc_channels[] = { 105 + ST_LSM6DSX_CHANNEL(IIO_ACCEL, 0x28, IIO_MOD_X, 0), 106 + ST_LSM6DSX_CHANNEL(IIO_ACCEL, 0x2a, IIO_MOD_Y, 1), 107 + ST_LSM6DSX_CHANNEL(IIO_ACCEL, 0x2c, IIO_MOD_Z, 2), 108 + IIO_CHAN_SOFT_TIMESTAMP(3), 109 + }; 110 + 111 static const struct iio_chan_spec st_lsm6dsx_gyro_channels[] = { 112 ST_LSM6DSX_CHANNEL(IIO_ANGL_VEL, 0x22, IIO_MOD_X, 0), 113 ST_LSM6DSX_CHANNEL(IIO_ANGL_VEL, 0x24, IIO_MOD_Y, 1), ··· 142 }, 143 .channels = { 144 [ST_LSM6DSX_ID_ACC] = { 145 + .chan = st_lsm6ds0_acc_channels, 146 + .len = ARRAY_SIZE(st_lsm6ds0_acc_channels), 147 }, 148 [ST_LSM6DSX_ID_GYRO] = { 149 .chan = st_lsm6ds0_gyro_channels, ··· 1449 }, 1450 .channels = { 1451 [ST_LSM6DSX_ID_ACC] = { 1452 + .chan = st_lsm6ds0_acc_channels, 1453 + .len = ARRAY_SIZE(st_lsm6ds0_acc_channels), 1454 }, 1455 [ST_LSM6DSX_ID_GYRO] = { 1456 .chan = st_lsm6dsx_gyro_channels,
+3 -1
drivers/iio/industrialio-core.c
··· 1657 mutex_destroy(&iio_dev_opaque->info_exist_lock); 1658 mutex_destroy(&iio_dev_opaque->mlock); 1659 1660 lockdep_unregister_key(&iio_dev_opaque->mlock_key); 1661 1662 ida_free(&iio_ida, iio_dev_opaque->id); ··· 1718 INIT_LIST_HEAD(&iio_dev_opaque->ioctl_handlers); 1719 1720 lockdep_register_key(&iio_dev_opaque->mlock_key); 1721 1722 mutex_init_with_key(&iio_dev_opaque->mlock, &iio_dev_opaque->mlock_key); 1723 - mutex_init(&iio_dev_opaque->info_exist_lock); 1724 1725 indio_dev->dev.parent = parent; 1726 indio_dev->dev.type = &iio_device_type;
··· 1657 mutex_destroy(&iio_dev_opaque->info_exist_lock); 1658 mutex_destroy(&iio_dev_opaque->mlock); 1659 1660 + lockdep_unregister_key(&iio_dev_opaque->info_exist_key); 1661 lockdep_unregister_key(&iio_dev_opaque->mlock_key); 1662 1663 ida_free(&iio_ida, iio_dev_opaque->id); ··· 1717 INIT_LIST_HEAD(&iio_dev_opaque->ioctl_handlers); 1718 1719 lockdep_register_key(&iio_dev_opaque->mlock_key); 1720 + lockdep_register_key(&iio_dev_opaque->info_exist_key); 1721 1722 mutex_init_with_key(&iio_dev_opaque->mlock, &iio_dev_opaque->mlock_key); 1723 + mutex_init_with_key(&iio_dev_opaque->info_exist_lock, &iio_dev_opaque->info_exist_key); 1724 1725 indio_dev->dev.parent = parent; 1726 indio_dev->dev.type = &iio_device_type;
+5
drivers/interconnect/debugfs-client.c
··· 150 return ret; 151 } 152 153 client_dir = debugfs_create_dir("test_client", icc_dir); 154 155 debugfs_create_str("src_node", 0600, client_dir, &src_node);
··· 150 return ret; 151 } 152 153 + src_node = devm_kstrdup(&pdev->dev, "", GFP_KERNEL); 154 + dst_node = devm_kstrdup(&pdev->dev, "", GFP_KERNEL); 155 + if (!src_node || !dst_node) 156 + return -ENOMEM; 157 + 158 client_dir = debugfs_create_dir("test_client", icc_dir); 159 160 debugfs_create_str("src_node", 0600, client_dir, &src_node);
+9 -9
drivers/misc/mei/mei-trace.h
··· 21 TP_ARGS(dev, reg, offs, val), 22 TP_STRUCT__entry( 23 __string(dev, dev_name(dev)) 24 - __field(const char *, reg) 25 __field(u32, offs) 26 __field(u32, val) 27 ), 28 TP_fast_assign( 29 __assign_str(dev); 30 - __entry->reg = reg; 31 __entry->offs = offs; 32 __entry->val = val; 33 ), 34 TP_printk("[%s] read %s:[%#x] = %#x", 35 - __get_str(dev), __entry->reg, __entry->offs, __entry->val) 36 ); 37 38 TRACE_EVENT(mei_reg_write, ··· 40 TP_ARGS(dev, reg, offs, val), 41 TP_STRUCT__entry( 42 __string(dev, dev_name(dev)) 43 - __field(const char *, reg) 44 __field(u32, offs) 45 __field(u32, val) 46 ), 47 TP_fast_assign( 48 __assign_str(dev); 49 - __entry->reg = reg; 50 __entry->offs = offs; 51 __entry->val = val; 52 ), 53 TP_printk("[%s] write %s[%#x] = %#x", 54 - __get_str(dev), __entry->reg, __entry->offs, __entry->val) 55 ); 56 57 TRACE_EVENT(mei_pci_cfg_read, ··· 59 TP_ARGS(dev, reg, offs, val), 60 TP_STRUCT__entry( 61 __string(dev, dev_name(dev)) 62 - __field(const char *, reg) 63 __field(u32, offs) 64 __field(u32, val) 65 ), 66 TP_fast_assign( 67 __assign_str(dev); 68 - __entry->reg = reg; 69 __entry->offs = offs; 70 __entry->val = val; 71 ), 72 TP_printk("[%s] pci cfg read %s:[%#x] = %#x", 73 - __get_str(dev), __entry->reg, __entry->offs, __entry->val) 74 ); 75 76 #endif /* _MEI_TRACE_H_ */
··· 21 TP_ARGS(dev, reg, offs, val), 22 TP_STRUCT__entry( 23 __string(dev, dev_name(dev)) 24 + __string(reg, reg) 25 __field(u32, offs) 26 __field(u32, val) 27 ), 28 TP_fast_assign( 29 __assign_str(dev); 30 + __assign_str(reg); 31 __entry->offs = offs; 32 __entry->val = val; 33 ), 34 TP_printk("[%s] read %s:[%#x] = %#x", 35 + __get_str(dev), __get_str(reg), __entry->offs, __entry->val) 36 ); 37 38 TRACE_EVENT(mei_reg_write, ··· 40 TP_ARGS(dev, reg, offs, val), 41 TP_STRUCT__entry( 42 __string(dev, dev_name(dev)) 43 + __string(reg, reg) 44 __field(u32, offs) 45 __field(u32, val) 46 ), 47 TP_fast_assign( 48 __assign_str(dev); 49 + __assign_str(reg); 50 __entry->offs = offs; 51 __entry->val = val; 52 ), 53 TP_printk("[%s] write %s[%#x] = %#x", 54 + __get_str(dev), __get_str(reg), __entry->offs, __entry->val) 55 ); 56 57 TRACE_EVENT(mei_pci_cfg_read, ··· 59 TP_ARGS(dev, reg, offs, val), 60 TP_STRUCT__entry( 61 __string(dev, dev_name(dev)) 62 + __string(reg, reg) 63 __field(u32, offs) 64 __field(u32, val) 65 ), 66 TP_fast_assign( 67 __assign_str(dev); 68 + __assign_str(reg); 69 __entry->offs = offs; 70 __entry->val = val; 71 ), 72 TP_printk("[%s] pci cfg read %s:[%#x] = %#x", 73 + __get_str(dev), __get_str(reg), __entry->offs, __entry->val) 74 ); 75 76 #endif /* _MEI_TRACE_H_ */
+40 -8
drivers/misc/uacce/uacce.c
··· 40 return 0; 41 } 42 43 - static int uacce_put_queue(struct uacce_queue *q) 44 { 45 struct uacce_device *uacce = q->uacce; 46 47 - if ((q->state == UACCE_Q_STARTED) && uacce->ops->stop_queue) 48 uacce->ops->stop_queue(q); 49 50 - if ((q->state == UACCE_Q_INIT || q->state == UACCE_Q_STARTED) && 51 - uacce->ops->put_queue) 52 uacce->ops->put_queue(q); 53 54 q->state = UACCE_Q_ZOMBIE; 55 - 56 - return 0; 57 } 58 59 static long uacce_fops_unl_ioctl(struct file *filep, ··· 94 ret = uacce_start_queue(q); 95 break; 96 case UACCE_CMD_PUT_Q: 97 - ret = uacce_put_queue(q); 98 break; 99 default: 100 if (uacce->ops->ioctl) ··· 228 } 229 } 230 231 static const struct vm_operations_struct uacce_vm_ops = { 232 .close = uacce_vma_close, 233 }; 234 235 static int uacce_fops_mmap(struct file *filep, struct vm_area_struct *vma) ··· 402 struct uacce_device *uacce = to_uacce_device(dev); 403 u32 val; 404 405 val = uacce->ops->isolate_err_threshold_read(uacce); 406 407 return sysfs_emit(buf, "%u\n", val); ··· 416 struct uacce_device *uacce = to_uacce_device(dev); 417 unsigned long val; 418 int ret; 419 420 if (kstrtoul(buf, 0, &val) < 0) 421 return -EINVAL; ··· 545 */ 546 int uacce_register(struct uacce_device *uacce) 547 { 548 if (!uacce) 549 return -ENODEV; 550 ··· 557 uacce->cdev->ops = &uacce_fops; 558 uacce->cdev->owner = THIS_MODULE; 559 560 - return cdev_device_add(uacce->cdev, &uacce->dev); 561 } 562 EXPORT_SYMBOL_GPL(uacce_register); 563
··· 40 return 0; 41 } 42 43 + static int uacce_stop_queue(struct uacce_queue *q) 44 { 45 struct uacce_device *uacce = q->uacce; 46 47 + if (q->state != UACCE_Q_STARTED) 48 + return 0; 49 + 50 + if (uacce->ops->stop_queue) 51 uacce->ops->stop_queue(q); 52 53 + q->state = UACCE_Q_INIT; 54 + 55 + return 0; 56 + } 57 + 58 + static void uacce_put_queue(struct uacce_queue *q) 59 + { 60 + struct uacce_device *uacce = q->uacce; 61 + 62 + uacce_stop_queue(q); 63 + 64 + if (q->state != UACCE_Q_INIT) 65 + return; 66 + 67 + if (uacce->ops->put_queue) 68 uacce->ops->put_queue(q); 69 70 q->state = UACCE_Q_ZOMBIE; 71 } 72 73 static long uacce_fops_unl_ioctl(struct file *filep, ··· 80 ret = uacce_start_queue(q); 81 break; 82 case UACCE_CMD_PUT_Q: 83 + ret = uacce_stop_queue(q); 84 break; 85 default: 86 if (uacce->ops->ioctl) ··· 214 } 215 } 216 217 + static int uacce_vma_mremap(struct vm_area_struct *area) 218 + { 219 + return -EPERM; 220 + } 221 + 222 static const struct vm_operations_struct uacce_vm_ops = { 223 .close = uacce_vma_close, 224 + .mremap = uacce_vma_mremap, 225 }; 226 227 static int uacce_fops_mmap(struct file *filep, struct vm_area_struct *vma) ··· 382 struct uacce_device *uacce = to_uacce_device(dev); 383 u32 val; 384 385 + if (!uacce->ops->isolate_err_threshold_read) 386 + return -ENOENT; 387 + 388 val = uacce->ops->isolate_err_threshold_read(uacce); 389 390 return sysfs_emit(buf, "%u\n", val); ··· 393 struct uacce_device *uacce = to_uacce_device(dev); 394 unsigned long val; 395 int ret; 396 + 397 + if (!uacce->ops->isolate_err_threshold_write) 398 + return -ENOENT; 399 400 if (kstrtoul(buf, 0, &val) < 0) 401 return -EINVAL; ··· 519 */ 520 int uacce_register(struct uacce_device *uacce) 521 { 522 + int ret; 523 + 524 if (!uacce) 525 return -ENODEV; 526 ··· 529 uacce->cdev->ops = &uacce_fops; 530 uacce->cdev->owner = THIS_MODULE; 531 532 + ret = cdev_device_add(uacce->cdev, &uacce->dev); 533 + if (ret) 534 + uacce->cdev = NULL; 535 + 536 + return ret; 537 } 538 EXPORT_SYMBOL_GPL(uacce_register); 539
+4 -4
drivers/mux/mmio.c
··· 101 mux_mmio = mux_chip_priv(mux_chip); 102 103 mux_mmio->fields = devm_kmalloc(dev, num_fields * sizeof(*mux_mmio->fields), GFP_KERNEL); 104 - if (IS_ERR(mux_mmio->fields)) 105 - return PTR_ERR(mux_mmio->fields); 106 107 mux_mmio->hardware_states = devm_kmalloc(dev, num_fields * 108 sizeof(*mux_mmio->hardware_states), GFP_KERNEL); 109 - if (IS_ERR(mux_mmio->hardware_states)) 110 - return PTR_ERR(mux_mmio->hardware_states); 111 112 for (i = 0; i < num_fields; i++) { 113 struct mux_control *mux = &mux_chip->mux[i];
··· 101 mux_mmio = mux_chip_priv(mux_chip); 102 103 mux_mmio->fields = devm_kmalloc(dev, num_fields * sizeof(*mux_mmio->fields), GFP_KERNEL); 104 + if (!mux_mmio->fields) 105 + return -ENOMEM; 106 107 mux_mmio->hardware_states = devm_kmalloc(dev, num_fields * 108 sizeof(*mux_mmio->hardware_states), GFP_KERNEL); 109 + if (!mux_mmio->hardware_states) 110 + return -ENOMEM; 111 112 for (i = 0; i < num_fields; i++) { 113 struct mux_control *mux = &mux_chip->mux[i];
+29 -25
drivers/slimbus/core.c
··· 146 { 147 struct slim_device *sbdev = to_slim_device(dev); 148 149 kfree(sbdev); 150 } 151 ··· 281 /* slim_remove_device: Remove the effect of slim_add_device() */ 282 static void slim_remove_device(struct slim_device *sbdev) 283 { 284 - of_node_put(sbdev->dev.of_node); 285 device_unregister(&sbdev->dev); 286 } 287 ··· 366 * @ctrl: Controller on which this device will be added/queried 367 * @e_addr: Enumeration address of the device to be queried 368 * 369 * Return: pointer to a device if it has already reported. Creates a new 370 * device and returns pointer to it if the device has not yet enumerated. 371 */ ··· 382 sbdev = slim_alloc_device(ctrl, e_addr, NULL); 383 if (!sbdev) 384 return ERR_PTR(-ENOMEM); 385 } 386 387 return sbdev; 388 } 389 EXPORT_SYMBOL_GPL(slim_get_device); 390 391 - static struct slim_device *of_find_slim_device(struct slim_controller *ctrl, 392 - struct device_node *np) 393 { 394 struct slim_device *sbdev; 395 struct device *dev; ··· 414 } 415 416 return NULL; 417 - } 418 - 419 - /** 420 - * of_slim_get_device() - get handle to a device using dt node. 421 - * 422 - * @ctrl: Controller on which this device will be added/queried 423 - * @np: node pointer to device 424 - * 425 - * Return: pointer to a device if it has already reported. Creates a new 426 - * device and returns pointer to it if the device has not yet enumerated. 427 - */ 428 - struct slim_device *of_slim_get_device(struct slim_controller *ctrl, 429 - struct device_node *np) 430 - { 431 - return of_find_slim_device(ctrl, np); 432 } 433 EXPORT_SYMBOL_GPL(of_slim_get_device); 434 ··· 490 if (ctrl->sched.clk_state != SLIM_CLK_ACTIVE) { 491 dev_err(ctrl->dev, "slim ctrl not active,state:%d, ret:%d\n", 492 ctrl->sched.clk_state, ret); 493 - goto slimbus_not_active; 494 } 495 496 sbdev = slim_get_device(ctrl, e_addr); 497 - if (IS_ERR(sbdev)) 498 - return -ENODEV; 499 500 if (sbdev->is_laddr_valid) { 501 *laddr = sbdev->laddr; 502 - return 0; 503 } 504 505 - ret = slim_device_alloc_laddr(sbdev, true); 506 - 507 - slimbus_not_active: 508 pm_runtime_mark_last_busy(ctrl->dev); 509 pm_runtime_put_autosuspend(ctrl->dev); 510 return ret;
··· 146 { 147 struct slim_device *sbdev = to_slim_device(dev); 148 149 + of_node_put(sbdev->dev.of_node); 150 kfree(sbdev); 151 } 152 ··· 280 /* slim_remove_device: Remove the effect of slim_add_device() */ 281 static void slim_remove_device(struct slim_device *sbdev) 282 { 283 device_unregister(&sbdev->dev); 284 } 285 ··· 366 * @ctrl: Controller on which this device will be added/queried 367 * @e_addr: Enumeration address of the device to be queried 368 * 369 + * Takes a reference to the embedded struct device which needs to be dropped 370 + * after use. 371 + * 372 * Return: pointer to a device if it has already reported. Creates a new 373 * device and returns pointer to it if the device has not yet enumerated. 374 */ ··· 379 sbdev = slim_alloc_device(ctrl, e_addr, NULL); 380 if (!sbdev) 381 return ERR_PTR(-ENOMEM); 382 + 383 + get_device(&sbdev->dev); 384 } 385 386 return sbdev; 387 } 388 EXPORT_SYMBOL_GPL(slim_get_device); 389 390 + /** 391 + * of_slim_get_device() - get handle to a device using dt node. 392 + * 393 + * @ctrl: Controller on which this device will be queried 394 + * @np: node pointer to device 395 + * 396 + * Takes a reference to the embedded struct device which needs to be dropped 397 + * after use. 398 + * 399 + * Return: pointer to a device if it has been registered, otherwise NULL. 400 + */ 401 + struct slim_device *of_slim_get_device(struct slim_controller *ctrl, 402 + struct device_node *np) 403 { 404 struct slim_device *sbdev; 405 struct device *dev; ··· 398 } 399 400 return NULL; 401 } 402 EXPORT_SYMBOL_GPL(of_slim_get_device); 403 ··· 489 if (ctrl->sched.clk_state != SLIM_CLK_ACTIVE) { 490 dev_err(ctrl->dev, "slim ctrl not active,state:%d, ret:%d\n", 491 ctrl->sched.clk_state, ret); 492 + goto out_put_rpm; 493 } 494 495 sbdev = slim_get_device(ctrl, e_addr); 496 + if (IS_ERR(sbdev)) { 497 + ret = -ENODEV; 498 + goto out_put_rpm; 499 + } 500 501 if (sbdev->is_laddr_valid) { 502 *laddr = sbdev->laddr; 503 + ret = 0; 504 + } else { 505 + ret = slim_device_alloc_laddr(sbdev, true); 506 } 507 508 + put_device(&sbdev->dev); 509 + out_put_rpm: 510 pm_runtime_mark_last_busy(ctrl->dev); 511 pm_runtime_put_autosuspend(ctrl->dev); 512 return ret;
+2 -2
drivers/uio/uio_pci_generic_sva.c
··· 29 struct uio_pci_sva_dev *udev = info->priv; 30 struct iommu_domain *domain; 31 32 - if (!udev && !udev->pdev) 33 return -ENODEV; 34 35 domain = iommu_get_domain_for_dev(&udev->pdev->dev); ··· 51 { 52 struct uio_pci_sva_dev *udev = info->priv; 53 54 - if (!udev && !udev->pdev) 55 return -ENODEV; 56 57 iommu_sva_unbind_device(udev->sva_handle);
··· 29 struct uio_pci_sva_dev *udev = info->priv; 30 struct iommu_domain *domain; 31 32 + if (!udev || !udev->pdev) 33 return -ENODEV; 34 35 domain = iommu_get_domain_for_dev(&udev->pdev->dev); ··· 51 { 52 struct uio_pci_sva_dev *udev = info->priv; 53 54 + if (!udev || !udev->pdev) 55 return -ENODEV; 56 57 iommu_sva_unbind_device(udev->sva_handle);
+19 -41
drivers/w1/slaves/w1_therm.c
··· 1836 struct w1_slave *sl = dev_to_w1_slave(device); 1837 struct therm_info info; 1838 u8 new_config_register[3]; /* array of data to be written */ 1839 - int temp, ret; 1840 - char *token = NULL; 1841 s8 tl, th; /* 1 byte per value + temp ring order */ 1842 - char *p_args, *orig; 1843 1844 - p_args = orig = kmalloc(size, GFP_KERNEL); 1845 - /* Safe string copys as buf is const */ 1846 - if (!p_args) { 1847 - dev_warn(device, 1848 - "%s: error unable to allocate memory %d\n", 1849 - __func__, -ENOMEM); 1850 - return size; 1851 - } 1852 - strcpy(p_args, buf); 1853 - 1854 - /* Split string using space char */ 1855 - token = strsep(&p_args, " "); 1856 - 1857 - if (!token) { 1858 - dev_info(device, 1859 - "%s: error parsing args %d\n", __func__, -EINVAL); 1860 - goto free_m; 1861 - } 1862 - 1863 - /* Convert 1st entry to int */ 1864 - ret = kstrtoint (token, 10, &temp); 1865 if (ret) { 1866 dev_info(device, 1867 "%s: error parsing args %d\n", __func__, ret); 1868 - goto free_m; 1869 } 1870 1871 tl = int_to_short(temp); 1872 1873 - /* Split string using space char */ 1874 - token = strsep(&p_args, " "); 1875 - if (!token) { 1876 - dev_info(device, 1877 - "%s: error parsing args %d\n", __func__, -EINVAL); 1878 - goto free_m; 1879 - } 1880 - /* Convert 2nd entry to int */ 1881 - ret = kstrtoint (token, 10, &temp); 1882 if (ret) { 1883 dev_info(device, 1884 "%s: error parsing args %d\n", __func__, ret); 1885 - goto free_m; 1886 } 1887 1888 /* Prepare to cast to short by eliminating out of range values */ ··· 1887 dev_info(device, 1888 "%s: error reading from the slave device %d\n", 1889 __func__, ret); 1890 - goto free_m; 1891 } 1892 1893 /* Write data in the device RAM */ ··· 1895 dev_info(device, 1896 "%s: Device not supported by the driver %d\n", 1897 __func__, -ENODEV); 1898 - goto free_m; 1899 } 1900 1901 ret = SLAVE_SPECIFIC_FUNC(sl)->write_data(sl, new_config_register); ··· 1903 dev_info(device, 1904 "%s: error writing to the slave device %d\n", 1905 __func__, ret); 1906 - 1907 - free_m: 1908 - /* free allocated memory */ 1909 - kfree(orig); 1910 1911 return size; 1912 }
··· 1836 struct w1_slave *sl = dev_to_w1_slave(device); 1837 struct therm_info info; 1838 u8 new_config_register[3]; /* array of data to be written */ 1839 + long long temp; 1840 + int ret = 0; 1841 s8 tl, th; /* 1 byte per value + temp ring order */ 1842 + const char *p = buf; 1843 + char *endp; 1844 1845 + temp = simple_strtoll(p, &endp, 10); 1846 + if (p == endp || *endp != ' ') 1847 + ret = -EINVAL; 1848 + else if (temp < INT_MIN || temp > INT_MAX) 1849 + ret = -ERANGE; 1850 if (ret) { 1851 dev_info(device, 1852 "%s: error parsing args %d\n", __func__, ret); 1853 + return size; 1854 } 1855 1856 tl = int_to_short(temp); 1857 1858 + p = endp + 1; 1859 + temp = simple_strtoll(p, &endp, 10); 1860 + if (p == endp) 1861 + ret = -EINVAL; 1862 + else if (temp < INT_MIN || temp > INT_MAX) 1863 + ret = -ERANGE; 1864 if (ret) { 1865 dev_info(device, 1866 "%s: error parsing args %d\n", __func__, ret); 1867 + return size; 1868 } 1869 1870 /* Prepare to cast to short by eliminating out of range values */ ··· 1905 dev_info(device, 1906 "%s: error reading from the slave device %d\n", 1907 __func__, ret); 1908 + return size; 1909 } 1910 1911 /* Write data in the device RAM */ ··· 1913 dev_info(device, 1914 "%s: Device not supported by the driver %d\n", 1915 __func__, -ENODEV); 1916 + return size; 1917 } 1918 1919 ret = SLAVE_SPECIFIC_FUNC(sl)->write_data(sl, new_config_register); ··· 1921 dev_info(device, 1922 "%s: error writing to the slave device %d\n", 1923 __func__, ret); 1924 1925 return size; 1926 }
-2
drivers/w1/w1.c
··· 758 if (err < 0) { 759 dev_err(&dev->dev, "%s: Attaching %s failed.\n", __func__, 760 sl->name); 761 - dev->slave_count--; 762 - w1_family_put(sl->family); 763 atomic_dec(&sl->master->refcnt); 764 kfree(sl); 765 return err;
··· 758 if (err < 0) { 759 dev_err(&dev->dev, "%s: Attaching %s failed.\n", __func__, 760 sl->name); 761 atomic_dec(&sl->master->refcnt); 762 kfree(sl); 763 return err;
+2
include/linux/iio/iio-opaque.h
··· 14 * @mlock: lock used to prevent simultaneous device state changes 15 * @mlock_key: lockdep class for iio_dev lock 16 * @info_exist_lock: lock to prevent use during removal 17 * @trig_readonly: mark the current trigger immutable 18 * @event_interface: event chrdevs associated with interrupt lines 19 * @attached_buffers: array of buffers statically attached by the driver ··· 48 struct mutex mlock; 49 struct lock_class_key mlock_key; 50 struct mutex info_exist_lock; 51 bool trig_readonly; 52 struct iio_event_interface *event_interface; 53 struct iio_buffer **attached_buffers;
··· 14 * @mlock: lock used to prevent simultaneous device state changes 15 * @mlock_key: lockdep class for iio_dev lock 16 * @info_exist_lock: lock to prevent use during removal 17 + * @info_exist_key: lockdep class for info_exist lock 18 * @trig_readonly: mark the current trigger immutable 19 * @event_interface: event chrdevs associated with interrupt lines 20 * @attached_buffers: array of buffers statically attached by the driver ··· 47 struct mutex mlock; 48 struct lock_class_key mlock_key; 49 struct mutex info_exist_lock; 50 + struct lock_class_key info_exist_key; 51 bool trig_readonly; 52 struct iio_event_interface *event_interface; 53 struct iio_buffer **attached_buffers;
+1 -1
include/uapi/linux/comedi.h
··· 640 641 /** 642 * struct comedi_rangeinfo - used to retrieve the range table for a channel 643 - * @range_type: Encodes subdevice index (bits 27:24), channel index 644 * (bits 23:16) and range table length (bits 15:0). 645 * @range_ptr: Pointer to array of @struct comedi_krange to be filled 646 * in with the range table for the channel or subdevice.
··· 640 641 /** 642 * struct comedi_rangeinfo - used to retrieve the range table for a channel 643 + * @range_type: Encodes subdevice index (bits 31:24), channel index 644 * (bits 23:16) and range table length (bits 15:0). 645 * @range_ptr: Pointer to array of @struct comedi_krange to be filled 646 * in with the range table for the channel or subdevice.