Skip to content

Commit e2e5ebe

Browse files
committed
Merge tag 'char-misc-5.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char/misc driver fixes from Greg KH: "Here are a small number of char/misc/other driver fixes for 5.18-rc5 Nothing major in here, this is mostly IIO driver fixes along with some other small things: - at25 driver fix for systems without a dma-able stack - phy driver fixes for reported issues - binder driver fixes for reported issues All of these have been in linux-next without any reported problems" * tag 'char-misc-5.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (31 commits) eeprom: at25: Use DMA safe buffers binder: Gracefully handle BINDER_TYPE_FDA objects with num_fds=0 binder: Address corner cases in deferred copy and fixup phy: amlogic: fix error path in phy_g12a_usb3_pcie_probe() iio: imu: inv_icm42600: Fix I2C init possible nack iio: dac: ltc2688: fix voltage scale read interconnect: qcom: sdx55: Drop IP0 interconnects interconnect: qcom: sc7180: Drop IP0 interconnects phy: ti: Add missing pm_runtime_disable() in serdes_am654_probe phy: mapphone-mdm6600: Fix PM error handling in phy_mdm6600_probe phy: ti: omap-usb2: Fix error handling in omap_usb2_enable_clocks bus: mhi: host: pci_generic: Flush recovery worker during freeze bus: mhi: host: pci_generic: Add missing poweroff() PM callback phy: ti: tusb1210: Fix an error handling path in tusb1210_probe() phy: samsung: exynos5250-sata: fix missing device put in probe error paths phy: samsung: Fix missing of_node_put() in exynos_sata_phy_probe phy: ti: Fix missing of_node_put in ti_pipe3_get_sysctrl() phy: ti: tusb1210: Make tusb1210_chg_det_states static iio:dac:ad3552r: Fix an IS_ERR() vs NULL check iio: sx9324: Fix default precharge internal resistance register ...
2 parents a6b5c5d + fda0573 commit e2e5ebe

File tree

25 files changed

+148
-113
lines changed

25 files changed

+148
-113
lines changed

drivers/android/binder.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2295,6 +2295,7 @@ static int binder_do_deferred_txn_copies(struct binder_alloc *alloc,
22952295
{
22962296
int ret = 0;
22972297
struct binder_sg_copy *sgc, *tmpsgc;
2298+
struct binder_ptr_fixup *tmppf;
22982299
struct binder_ptr_fixup *pf =
22992300
list_first_entry_or_null(pf_head, struct binder_ptr_fixup,
23002301
node);
@@ -2349,7 +2350,11 @@ static int binder_do_deferred_txn_copies(struct binder_alloc *alloc,
23492350
list_del(&sgc->node);
23502351
kfree(sgc);
23512352
}
2352-
BUG_ON(!list_empty(pf_head));
2353+
list_for_each_entry_safe(pf, tmppf, pf_head, node) {
2354+
BUG_ON(pf->skip_size == 0);
2355+
list_del(&pf->node);
2356+
kfree(pf);
2357+
}
23532358
BUG_ON(!list_empty(sgc_head));
23542359

23552360
return ret > 0 ? -EINVAL : ret;
@@ -2486,6 +2491,9 @@ static int binder_translate_fd_array(struct list_head *pf_head,
24862491
struct binder_proc *proc = thread->proc;
24872492
int ret;
24882493

2494+
if (fda->num_fds == 0)
2495+
return 0;
2496+
24892497
fd_buf_size = sizeof(u32) * fda->num_fds;
24902498
if (fda->num_fds >= SIZE_MAX / sizeof(u32)) {
24912499
binder_user_error("%d:%d got transaction with invalid number of fds (%lld)\n",

drivers/bus/mhi/host/pci_generic.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,6 +1060,7 @@ static int __maybe_unused mhi_pci_freeze(struct device *dev)
10601060
* the intermediate restore kernel reinitializes MHI device with new
10611061
* context.
10621062
*/
1063+
flush_work(&mhi_pdev->recovery_work);
10631064
if (test_and_clear_bit(MHI_PCI_DEV_STARTED, &mhi_pdev->status)) {
10641065
mhi_power_down(mhi_cntrl, true);
10651066
mhi_unprepare_after_power_down(mhi_cntrl);
@@ -1085,6 +1086,7 @@ static const struct dev_pm_ops mhi_pci_pm_ops = {
10851086
.resume = mhi_pci_resume,
10861087
.freeze = mhi_pci_freeze,
10871088
.thaw = mhi_pci_restore,
1089+
.poweroff = mhi_pci_freeze,
10881090
.restore = mhi_pci_restore,
10891091
#endif
10901092
};

drivers/iio/adc/ad7280a.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -745,15 +745,15 @@ static int ad7280a_write_thresh(struct iio_dev *indio_dev,
745745
case IIO_EV_DIR_RISING:
746746
addr = AD7280A_CELL_OVERVOLTAGE_REG;
747747
ret = ad7280_write(st, AD7280A_DEVADDR_MASTER, addr,
748-
1, val);
748+
1, value);
749749
if (ret)
750750
break;
751751
st->cell_threshhigh = value;
752752
break;
753753
case IIO_EV_DIR_FALLING:
754754
addr = AD7280A_CELL_UNDERVOLTAGE_REG;
755755
ret = ad7280_write(st, AD7280A_DEVADDR_MASTER, addr,
756-
1, val);
756+
1, value);
757757
if (ret)
758758
break;
759759
st->cell_threshlow = value;
@@ -770,18 +770,18 @@ static int ad7280a_write_thresh(struct iio_dev *indio_dev,
770770
case IIO_EV_DIR_RISING:
771771
addr = AD7280A_AUX_ADC_OVERVOLTAGE_REG;
772772
ret = ad7280_write(st, AD7280A_DEVADDR_MASTER, addr,
773-
1, val);
773+
1, value);
774774
if (ret)
775775
break;
776-
st->aux_threshhigh = val;
776+
st->aux_threshhigh = value;
777777
break;
778778
case IIO_EV_DIR_FALLING:
779779
addr = AD7280A_AUX_ADC_UNDERVOLTAGE_REG;
780780
ret = ad7280_write(st, AD7280A_DEVADDR_MASTER, addr,
781-
1, val);
781+
1, value);
782782
if (ret)
783783
break;
784-
st->aux_threshlow = val;
784+
st->aux_threshlow = value;
785785
break;
786786
default:
787787
ret = -EINVAL;

drivers/iio/chemical/scd4x.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,12 +471,15 @@ static ssize_t calibration_forced_value_store(struct device *dev,
471471
ret = scd4x_write_and_fetch(state, CMD_FRC, arg, &val, sizeof(val));
472472
mutex_unlock(&state->lock);
473473

474+
if (ret)
475+
return ret;
476+
474477
if (val == 0xff) {
475478
dev_err(dev, "forced calibration has failed");
476479
return -EINVAL;
477480
}
478481

479-
return ret ?: len;
482+
return len;
480483
}
481484

482485
static IIO_DEVICE_ATTR_RW(calibration_auto_enable, 0);

drivers/iio/dac/ad3552r.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ static int ad3552r_reset(struct ad3552r_desc *dac)
656656
{
657657
struct reg_addr_pool addr;
658658
int ret;
659-
u16 val;
659+
int val;
660660

661661
dac->gpio_reset = devm_gpiod_get_optional(&dac->spi->dev, "reset",
662662
GPIOD_OUT_LOW);
@@ -809,10 +809,10 @@ static int ad3552r_configure_custom_gain(struct ad3552r_desc *dac,
809809

810810
gain_child = fwnode_get_named_child_node(child,
811811
"custom-output-range-config");
812-
if (IS_ERR(gain_child)) {
812+
if (!gain_child) {
813813
dev_err(dev,
814814
"mandatory custom-output-range-config property missing\n");
815-
return PTR_ERR(gain_child);
815+
return -EINVAL;
816816
}
817817

818818
dac->ch_data[ch].range_override = 1;

drivers/iio/dac/ad5446.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ static int ad5446_read_raw(struct iio_dev *indio_dev,
178178

179179
switch (m) {
180180
case IIO_CHAN_INFO_RAW:
181-
*val = st->cached_val;
181+
*val = st->cached_val >> chan->scan_type.shift;
182182
return IIO_VAL_INT;
183183
case IIO_CHAN_INFO_SCALE:
184184
*val = st->vref_mv;

drivers/iio/dac/ad5592r-base.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ static int ad5592r_alloc_channels(struct iio_dev *iio_dev)
522522
if (!ret)
523523
st->channel_modes[reg] = tmp;
524524

525-
fwnode_property_read_u32(child, "adi,off-state", &tmp);
525+
ret = fwnode_property_read_u32(child, "adi,off-state", &tmp);
526526
if (!ret)
527527
st->channel_offstate[reg] = tmp;
528528
}

drivers/iio/dac/ltc2688.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ static int ltc2688_read_raw(struct iio_dev *indio_dev,
298298
if (ret)
299299
return ret;
300300

301-
*val = 16;
301+
*val2 = 16;
302302
return IIO_VAL_FRACTIONAL_LOG2;
303303
case IIO_CHAN_INFO_CALIBBIAS:
304304
ret = regmap_read(st->regmap,

drivers/iio/dac/ti-dac5571.c

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <linux/i2c.h>
2020
#include <linux/module.h>
2121
#include <linux/mod_devicetable.h>
22+
#include <linux/property.h>
2223
#include <linux/regulator/consumer.h>
2324

2425
enum chip_id {
@@ -311,6 +312,7 @@ static int dac5571_probe(struct i2c_client *client,
311312
const struct dac5571_spec *spec;
312313
struct dac5571_data *data;
313314
struct iio_dev *indio_dev;
315+
enum chip_id chip_id;
314316
int ret, i;
315317

316318
indio_dev = devm_iio_device_alloc(dev, sizeof(*data));
@@ -326,7 +328,13 @@ static int dac5571_probe(struct i2c_client *client,
326328
indio_dev->modes = INDIO_DIRECT_MODE;
327329
indio_dev->channels = dac5571_channels;
328330

329-
spec = &dac5571_spec[id->driver_data];
331+
if (dev_fwnode(dev))
332+
chip_id = (uintptr_t)device_get_match_data(dev);
333+
else
334+
chip_id = id->driver_data;
335+
336+
spec = &dac5571_spec[chip_id];
337+
330338
indio_dev->num_channels = spec->num_channels;
331339
data->spec = spec;
332340

@@ -385,15 +393,15 @@ static int dac5571_remove(struct i2c_client *i2c)
385393
}
386394

387395
static const struct of_device_id dac5571_of_id[] = {
388-
{.compatible = "ti,dac5571"},
389-
{.compatible = "ti,dac6571"},
390-
{.compatible = "ti,dac7571"},
391-
{.compatible = "ti,dac5574"},
392-
{.compatible = "ti,dac6574"},
393-
{.compatible = "ti,dac7574"},
394-
{.compatible = "ti,dac5573"},
395-
{.compatible = "ti,dac6573"},
396-
{.compatible = "ti,dac7573"},
396+
{.compatible = "ti,dac5571", .data = (void *)single_8bit},
397+
{.compatible = "ti,dac6571", .data = (void *)single_10bit},
398+
{.compatible = "ti,dac7571", .data = (void *)single_12bit},
399+
{.compatible = "ti,dac5574", .data = (void *)quad_8bit},
400+
{.compatible = "ti,dac6574", .data = (void *)quad_10bit},
401+
{.compatible = "ti,dac7574", .data = (void *)quad_12bit},
402+
{.compatible = "ti,dac5573", .data = (void *)quad_8bit},
403+
{.compatible = "ti,dac6573", .data = (void *)quad_10bit},
404+
{.compatible = "ti,dac7573", .data = (void *)quad_12bit},
397405
{}
398406
};
399407
MODULE_DEVICE_TABLE(of, dac5571_of_id);

drivers/iio/filter/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ menu "Filters"
88
config ADMV8818
99
tristate "Analog Devices ADMV8818 High-Pass and Low-Pass Filter"
1010
depends on SPI && COMMON_CLK && 64BIT
11+
select REGMAP_SPI
1112
help
1213
Say yes here to build support for Analog Devices ADMV8818
1314
2 GHz to 18 GHz, Digitally Tunable, High-Pass and Low-Pass Filter.

0 commit comments

Comments
 (0)