mirror of
https://github.com/torvalds/linux.git
synced 2024-11-21 19:41:42 +00:00
Char/Misc driver fixes for 6.10-rc4
Here are a number of small char/misc and iio driver fixes for 6.10-rc4. Included in here are the following: - iio driver fixes for a bunch of reported problems. - mei driver fixes for a number of reported issues. - amiga parport driver build fix. - .editorconfig fix that was causing lots of unintended whitespace changes to happen to files when they were being edited. Unless we want to sweep the whole tree and remove all trailing whitespace at once, this is needed for the .editorconfig file to be able to be used at all. This change is required because the original submitters never touched older files in the tree. - jfs bugfix for a buffer overflow The jfs bugfix is in here as I didn't know where else to put it, and it's been ignored for a while as the filesystem seems to be abandoned and I'm tired of seeing the same issue reported in multiple places. All of these have been in linux-next with no reported issues. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> -----BEGIN PGP SIGNATURE----- iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCZm7C7A8cZ3JlZ0Brcm9h aC5jb20ACgkQMUfUDdst+ymdEACfcZAcnD6Z7WAcTJ7GfFfNT9ph0+EAnAtQUO8j CxuaurBncWfcNeHkaYbB =Px6n -----END PGP SIGNATURE----- Merge tag 'char-misc-6.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Pull char/misc driver fixes from Greg KH: "Here are a number of small char/misc and iio driver fixes for 6.10-rc4. Included in here are the following: - iio driver fixes for a bunch of reported problems. - mei driver fixes for a number of reported issues. - amiga parport driver build fix. - .editorconfig fix that was causing lots of unintended whitespace changes to happen to files when they were being edited. Unless we want to sweep the whole tree and remove all trailing whitespace at once, this is needed for the .editorconfig file to be able to be used at all. This change is required because the original submitters never touched older files in the tree. - jfs bugfix for a buffer overflow The jfs bugfix is in here as I didn't know where else to put it, and it's been ignored for a while as the filesystem seems to be abandoned and I'm tired of seeing the same issue reported in multiple places. All of these have been in linux-next with no reported issues" * tag 'char-misc-6.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (25 commits) .editorconfig: remove trim_trailing_whitespace option jfs: xattr: fix buffer overflow for invalid xattr misc: microchip: pci1xxxx: Fix a memory leak in the error handling of gp_aux_bus_probe() misc: microchip: pci1xxxx: fix double free in the error handling of gp_aux_bus_probe() parport: amiga: Mark driver struct with __refdata to prevent section mismatch mei: vsc: Fix wrong invocation of ACPI SID method mei: vsc: Don't stop/restart mei device during system suspend/resume mei: me: release irq in mei_me_pci_resume error path mei: demote client disconnect warning on suspend to debug iio: inkern: fix channel read regression iio: imu: inv_mpu6050: stabilized timestamping in interrupt iio: adc: ad7173: Fix sampling frequency setting iio: adc: ad7173: Clear append status bit iio: imu: inv_icm42600: delete unneeded update watermark call iio: imu: inv_icm42600: stabilized timestamp in interrupt iio: invensense: fix odr switching to same value iio: adc: ad7173: Remove index from temp channel iio: adc: ad7173: Add ad7173_device_info names iio: adc: ad7173: fix buffers enablement for ad7176-2 iio: temperature: mlx90635: Fix ERR_PTR dereference in mlx90635_probe() ...
This commit is contained in:
commit
33f855cbb7
@ -5,7 +5,6 @@ root = true
|
||||
[{*.{awk,c,dts,dtsi,dtso,h,mk,s,S},Kconfig,Makefile,Makefile.*}]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
indent_style = tab
|
||||
indent_size = 8
|
||||
@ -13,7 +12,6 @@ indent_size = 8
|
||||
[*.{json,py,rs}]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
@ -26,7 +24,6 @@ indent_size = 8
|
||||
[*.yaml]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
trim_trailing_whitespace = unset
|
||||
insert_final_newline = true
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
@ -139,7 +139,7 @@ allOf:
|
||||
Voltage output range of the channel as <minimum, maximum>
|
||||
Required connections:
|
||||
Rfb1x for: 0 to 2.5 V; 0 to 3V; 0 to 5 V;
|
||||
Rfb2x for: 0 to 10 V; 2.5 to 7.5V; -5 to 5 V;
|
||||
Rfb2x for: 0 to 10 V; -2.5 to 7.5V; -5 to 5 V;
|
||||
oneOf:
|
||||
- items:
|
||||
- const: 0
|
||||
|
@ -145,6 +145,7 @@ struct ad7173_device_info {
|
||||
unsigned int id;
|
||||
char *name;
|
||||
bool has_temp;
|
||||
bool has_input_buf;
|
||||
bool has_int_ref;
|
||||
bool has_ref2;
|
||||
u8 num_gpios;
|
||||
@ -212,18 +213,21 @@ static const struct ad7173_device_info ad7173_device_info[] = {
|
||||
.num_configs = 4,
|
||||
.num_gpios = 2,
|
||||
.has_temp = true,
|
||||
.has_input_buf = true,
|
||||
.has_int_ref = true,
|
||||
.clock = 2 * HZ_PER_MHZ,
|
||||
.sinc5_data_rates = ad7173_sinc5_data_rates,
|
||||
.num_sinc5_data_rates = ARRAY_SIZE(ad7173_sinc5_data_rates),
|
||||
},
|
||||
[ID_AD7172_4] = {
|
||||
.name = "ad7172-4",
|
||||
.id = AD7172_4_ID,
|
||||
.num_inputs = 9,
|
||||
.num_channels = 8,
|
||||
.num_configs = 8,
|
||||
.num_gpios = 4,
|
||||
.has_temp = false,
|
||||
.has_input_buf = true,
|
||||
.has_ref2 = true,
|
||||
.clock = 2 * HZ_PER_MHZ,
|
||||
.sinc5_data_rates = ad7173_sinc5_data_rates,
|
||||
@ -237,6 +241,7 @@ static const struct ad7173_device_info ad7173_device_info[] = {
|
||||
.num_configs = 8,
|
||||
.num_gpios = 4,
|
||||
.has_temp = true,
|
||||
.has_input_buf = true,
|
||||
.has_int_ref = true,
|
||||
.has_ref2 = true,
|
||||
.clock = 2 * HZ_PER_MHZ,
|
||||
@ -251,18 +256,21 @@ static const struct ad7173_device_info ad7173_device_info[] = {
|
||||
.num_configs = 4,
|
||||
.num_gpios = 2,
|
||||
.has_temp = true,
|
||||
.has_input_buf = true,
|
||||
.has_int_ref = true,
|
||||
.clock = 16 * HZ_PER_MHZ,
|
||||
.sinc5_data_rates = ad7175_sinc5_data_rates,
|
||||
.num_sinc5_data_rates = ARRAY_SIZE(ad7175_sinc5_data_rates),
|
||||
},
|
||||
[ID_AD7175_8] = {
|
||||
.name = "ad7175-8",
|
||||
.id = AD7175_8_ID,
|
||||
.num_inputs = 17,
|
||||
.num_channels = 16,
|
||||
.num_configs = 8,
|
||||
.num_gpios = 4,
|
||||
.has_temp = true,
|
||||
.has_input_buf = true,
|
||||
.has_int_ref = true,
|
||||
.has_ref2 = true,
|
||||
.clock = 16 * HZ_PER_MHZ,
|
||||
@ -277,18 +285,21 @@ static const struct ad7173_device_info ad7173_device_info[] = {
|
||||
.num_configs = 4,
|
||||
.num_gpios = 2,
|
||||
.has_temp = false,
|
||||
.has_input_buf = false,
|
||||
.has_int_ref = true,
|
||||
.clock = 16 * HZ_PER_MHZ,
|
||||
.sinc5_data_rates = ad7175_sinc5_data_rates,
|
||||
.num_sinc5_data_rates = ARRAY_SIZE(ad7175_sinc5_data_rates),
|
||||
},
|
||||
[ID_AD7177_2] = {
|
||||
.name = "ad7177-2",
|
||||
.id = AD7177_ID,
|
||||
.num_inputs = 5,
|
||||
.num_channels = 4,
|
||||
.num_configs = 4,
|
||||
.num_gpios = 2,
|
||||
.has_temp = true,
|
||||
.has_input_buf = true,
|
||||
.has_int_ref = true,
|
||||
.clock = 16 * HZ_PER_MHZ,
|
||||
.odr_start_value = AD7177_ODR_START_VALUE,
|
||||
@ -532,6 +543,7 @@ static int ad7173_append_status(struct ad_sigma_delta *sd, bool append)
|
||||
unsigned int interface_mode = st->interface_mode;
|
||||
int ret;
|
||||
|
||||
interface_mode &= ~AD7173_INTERFACE_DATA_STAT;
|
||||
interface_mode |= AD7173_INTERFACE_DATA_STAT_EN(append);
|
||||
ret = ad_sd_write_reg(&st->sd, AD7173_REG_INTERFACE_MODE, 2, interface_mode);
|
||||
if (ret)
|
||||
@ -705,7 +717,7 @@ static int ad7173_write_raw(struct iio_dev *indio_dev,
|
||||
{
|
||||
struct ad7173_state *st = iio_priv(indio_dev);
|
||||
struct ad7173_channel_config *cfg;
|
||||
unsigned int freq, i, reg;
|
||||
unsigned int freq, i;
|
||||
int ret;
|
||||
|
||||
ret = iio_device_claim_direct_mode(indio_dev);
|
||||
@ -721,16 +733,7 @@ static int ad7173_write_raw(struct iio_dev *indio_dev,
|
||||
|
||||
cfg = &st->channels[chan->address].cfg;
|
||||
cfg->odr = i;
|
||||
|
||||
if (!cfg->live)
|
||||
break;
|
||||
|
||||
ret = ad_sd_read_reg(&st->sd, AD7173_REG_FILTER(cfg->cfg_slot), 2, ®);
|
||||
if (ret)
|
||||
break;
|
||||
reg &= ~AD7173_FILTER_ODR0_MASK;
|
||||
reg |= FIELD_PREP(AD7173_FILTER_ODR0_MASK, i);
|
||||
ret = ad_sd_write_reg(&st->sd, AD7173_REG_FILTER(cfg->cfg_slot), 2, reg);
|
||||
cfg->live = false;
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -792,8 +795,7 @@ static const struct iio_chan_spec ad7173_channel_template = {
|
||||
.type = IIO_VOLTAGE,
|
||||
.indexed = 1,
|
||||
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |
|
||||
BIT(IIO_CHAN_INFO_SCALE),
|
||||
.info_mask_shared_by_all = BIT(IIO_CHAN_INFO_SAMP_FREQ),
|
||||
BIT(IIO_CHAN_INFO_SCALE) | BIT(IIO_CHAN_INFO_SAMP_FREQ),
|
||||
.scan_type = {
|
||||
.sign = 'u',
|
||||
.realbits = 24,
|
||||
@ -804,12 +806,11 @@ static const struct iio_chan_spec ad7173_channel_template = {
|
||||
|
||||
static const struct iio_chan_spec ad7173_temp_iio_channel_template = {
|
||||
.type = IIO_TEMP,
|
||||
.indexed = 1,
|
||||
.channel = AD7173_AIN_TEMP_POS,
|
||||
.channel2 = AD7173_AIN_TEMP_NEG,
|
||||
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |
|
||||
BIT(IIO_CHAN_INFO_SCALE) | BIT(IIO_CHAN_INFO_OFFSET),
|
||||
.info_mask_shared_by_all = BIT(IIO_CHAN_INFO_SAMP_FREQ),
|
||||
BIT(IIO_CHAN_INFO_SCALE) | BIT(IIO_CHAN_INFO_OFFSET) |
|
||||
BIT(IIO_CHAN_INFO_SAMP_FREQ),
|
||||
.scan_type = {
|
||||
.sign = 'u',
|
||||
.realbits = 24,
|
||||
@ -932,7 +933,7 @@ static int ad7173_fw_parse_channel_config(struct iio_dev *indio_dev)
|
||||
AD7173_CH_ADDRESS(chan_arr[chan_index].channel,
|
||||
chan_arr[chan_index].channel2);
|
||||
chan_st_priv->cfg.bipolar = false;
|
||||
chan_st_priv->cfg.input_buf = true;
|
||||
chan_st_priv->cfg.input_buf = st->info->has_input_buf;
|
||||
chan_st_priv->cfg.ref_sel = AD7173_SETUP_REF_SEL_INT_REF;
|
||||
st->adc_mode |= AD7173_ADC_MODE_REF_EN;
|
||||
|
||||
@ -989,7 +990,7 @@ static int ad7173_fw_parse_channel_config(struct iio_dev *indio_dev)
|
||||
|
||||
chan_st_priv->ain = AD7173_CH_ADDRESS(ain[0], ain[1]);
|
||||
chan_st_priv->chan_reg = chan_index;
|
||||
chan_st_priv->cfg.input_buf = true;
|
||||
chan_st_priv->cfg.input_buf = st->info->has_input_buf;
|
||||
chan_st_priv->cfg.odr = 0;
|
||||
|
||||
chan_st_priv->cfg.bipolar = fwnode_property_read_bool(child, "bipolar");
|
||||
|
@ -243,11 +243,11 @@ static void __ad9467_get_scale(struct ad9467_state *st, int index,
|
||||
}
|
||||
|
||||
static const struct iio_chan_spec ad9434_channels[] = {
|
||||
AD9467_CHAN(0, 0, 12, 'S'),
|
||||
AD9467_CHAN(0, 0, 12, 's'),
|
||||
};
|
||||
|
||||
static const struct iio_chan_spec ad9467_channels[] = {
|
||||
AD9467_CHAN(0, 0, 16, 'S'),
|
||||
AD9467_CHAN(0, 0, 16, 's'),
|
||||
};
|
||||
|
||||
static const struct ad9467_chip_info ad9467_chip_tbl = {
|
||||
|
@ -60,11 +60,15 @@ EXPORT_SYMBOL_NS_GPL(inv_sensors_timestamp_init, IIO_INV_SENSORS_TIMESTAMP);
|
||||
int inv_sensors_timestamp_update_odr(struct inv_sensors_timestamp *ts,
|
||||
uint32_t period, bool fifo)
|
||||
{
|
||||
uint32_t mult;
|
||||
|
||||
/* when FIFO is on, prevent odr change if one is already pending */
|
||||
if (fifo && ts->new_mult != 0)
|
||||
return -EAGAIN;
|
||||
|
||||
ts->new_mult = period / ts->chip.clock_period;
|
||||
mult = period / ts->chip.clock_period;
|
||||
if (mult != ts->mult)
|
||||
ts->new_mult = mult;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -415,7 +415,7 @@ static int ad5592r_read_raw(struct iio_dev *iio_dev,
|
||||
s64 tmp = *val * (3767897513LL / 25LL);
|
||||
*val = div_s64_rem(tmp, 1000000000LL, val2);
|
||||
|
||||
return IIO_VAL_INT_PLUS_MICRO;
|
||||
return IIO_VAL_INT_PLUS_NANO;
|
||||
}
|
||||
|
||||
mutex_lock(&st->lock);
|
||||
|
@ -1391,7 +1391,7 @@ static irqreturn_t bmi323_trigger_handler(int irq, void *p)
|
||||
&data->buffer.channels,
|
||||
ARRAY_SIZE(data->buffer.channels));
|
||||
if (ret)
|
||||
return IRQ_NONE;
|
||||
goto out;
|
||||
} else {
|
||||
for_each_set_bit(bit, indio_dev->active_scan_mask,
|
||||
BMI323_CHAN_MAX) {
|
||||
@ -1400,13 +1400,14 @@ static irqreturn_t bmi323_trigger_handler(int irq, void *p)
|
||||
&data->buffer.channels[index++],
|
||||
BMI323_BYTES_PER_SAMPLE);
|
||||
if (ret)
|
||||
return IRQ_NONE;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
iio_push_to_buffers_with_timestamp(indio_dev, &data->buffer,
|
||||
iio_get_time_ns(indio_dev));
|
||||
|
||||
out:
|
||||
iio_trigger_notify_done(indio_dev->trig);
|
||||
|
||||
return IRQ_HANDLED;
|
||||
|
@ -130,10 +130,6 @@ static int inv_icm42600_accel_update_scan_mode(struct iio_dev *indio_dev,
|
||||
/* update data FIFO write */
|
||||
inv_sensors_timestamp_apply_odr(ts, 0, 0, 0);
|
||||
ret = inv_icm42600_buffer_set_fifo_en(st, fifo_en | st->fifo.en);
|
||||
if (ret)
|
||||
goto out_unlock;
|
||||
|
||||
ret = inv_icm42600_buffer_update_watermark(st);
|
||||
|
||||
out_unlock:
|
||||
mutex_unlock(&st->lock);
|
||||
|
@ -222,10 +222,15 @@ int inv_icm42600_buffer_update_watermark(struct inv_icm42600_state *st)
|
||||
latency_accel = period_accel * wm_accel;
|
||||
|
||||
/* 0 value for watermark means that the sensor is turned off */
|
||||
if (wm_gyro == 0 && wm_accel == 0)
|
||||
return 0;
|
||||
|
||||
if (latency_gyro == 0) {
|
||||
watermark = wm_accel;
|
||||
st->fifo.watermark.eff_accel = wm_accel;
|
||||
} else if (latency_accel == 0) {
|
||||
watermark = wm_gyro;
|
||||
st->fifo.watermark.eff_gyro = wm_gyro;
|
||||
} else {
|
||||
/* compute the smallest latency that is a multiple of both */
|
||||
if (latency_gyro <= latency_accel)
|
||||
@ -241,6 +246,13 @@ int inv_icm42600_buffer_update_watermark(struct inv_icm42600_state *st)
|
||||
watermark = latency / period;
|
||||
if (watermark < 1)
|
||||
watermark = 1;
|
||||
/* update effective watermark */
|
||||
st->fifo.watermark.eff_gyro = latency / period_gyro;
|
||||
if (st->fifo.watermark.eff_gyro < 1)
|
||||
st->fifo.watermark.eff_gyro = 1;
|
||||
st->fifo.watermark.eff_accel = latency / period_accel;
|
||||
if (st->fifo.watermark.eff_accel < 1)
|
||||
st->fifo.watermark.eff_accel = 1;
|
||||
}
|
||||
|
||||
/* compute watermark value in bytes */
|
||||
@ -514,7 +526,7 @@ int inv_icm42600_buffer_fifo_parse(struct inv_icm42600_state *st)
|
||||
/* handle gyroscope timestamp and FIFO data parsing */
|
||||
if (st->fifo.nb.gyro > 0) {
|
||||
ts = &gyro_st->ts;
|
||||
inv_sensors_timestamp_interrupt(ts, st->fifo.nb.gyro,
|
||||
inv_sensors_timestamp_interrupt(ts, st->fifo.watermark.eff_gyro,
|
||||
st->timestamp.gyro);
|
||||
ret = inv_icm42600_gyro_parse_fifo(st->indio_gyro);
|
||||
if (ret)
|
||||
@ -524,7 +536,7 @@ int inv_icm42600_buffer_fifo_parse(struct inv_icm42600_state *st)
|
||||
/* handle accelerometer timestamp and FIFO data parsing */
|
||||
if (st->fifo.nb.accel > 0) {
|
||||
ts = &accel_st->ts;
|
||||
inv_sensors_timestamp_interrupt(ts, st->fifo.nb.accel,
|
||||
inv_sensors_timestamp_interrupt(ts, st->fifo.watermark.eff_accel,
|
||||
st->timestamp.accel);
|
||||
ret = inv_icm42600_accel_parse_fifo(st->indio_accel);
|
||||
if (ret)
|
||||
@ -577,6 +589,9 @@ int inv_icm42600_buffer_init(struct inv_icm42600_state *st)
|
||||
unsigned int val;
|
||||
int ret;
|
||||
|
||||
st->fifo.watermark.eff_gyro = 1;
|
||||
st->fifo.watermark.eff_accel = 1;
|
||||
|
||||
/*
|
||||
* Default FIFO configuration (bits 7 to 5)
|
||||
* - use invalid value
|
||||
|
@ -32,6 +32,8 @@ struct inv_icm42600_fifo {
|
||||
struct {
|
||||
unsigned int gyro;
|
||||
unsigned int accel;
|
||||
unsigned int eff_gyro;
|
||||
unsigned int eff_accel;
|
||||
} watermark;
|
||||
size_t count;
|
||||
struct {
|
||||
|
@ -537,6 +537,7 @@ static int inv_icm42600_irq_init(struct inv_icm42600_state *st, int irq,
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
irq_type |= IRQF_ONESHOT;
|
||||
return devm_request_threaded_irq(dev, irq, inv_icm42600_irq_timestamp,
|
||||
inv_icm42600_irq_handler, irq_type,
|
||||
"inv_icm42600", st);
|
||||
|
@ -130,10 +130,6 @@ static int inv_icm42600_gyro_update_scan_mode(struct iio_dev *indio_dev,
|
||||
/* update data FIFO write */
|
||||
inv_sensors_timestamp_apply_odr(ts, 0, 0, 0);
|
||||
ret = inv_icm42600_buffer_set_fifo_en(st, fifo_en | st->fifo.en);
|
||||
if (ret)
|
||||
goto out_unlock;
|
||||
|
||||
ret = inv_icm42600_buffer_update_watermark(st);
|
||||
|
||||
out_unlock:
|
||||
mutex_unlock(&st->lock);
|
||||
|
@ -100,8 +100,8 @@ irqreturn_t inv_mpu6050_read_fifo(int irq, void *p)
|
||||
goto end_session;
|
||||
/* Each FIFO data contains all sensors, so same number for FIFO and sensor data */
|
||||
fifo_period = NSEC_PER_SEC / INV_MPU6050_DIVIDER_TO_FIFO_RATE(st->chip_config.divider);
|
||||
inv_sensors_timestamp_interrupt(&st->timestamp, nb, pf->timestamp);
|
||||
inv_sensors_timestamp_apply_odr(&st->timestamp, fifo_period, nb, 0);
|
||||
inv_sensors_timestamp_interrupt(&st->timestamp, 1, pf->timestamp);
|
||||
inv_sensors_timestamp_apply_odr(&st->timestamp, fifo_period, 1, 0);
|
||||
|
||||
/* clear internal data buffer for avoiding kernel data leak */
|
||||
memset(data, 0, sizeof(data));
|
||||
|
@ -300,6 +300,7 @@ int inv_mpu6050_probe_trigger(struct iio_dev *indio_dev, int irq_type)
|
||||
if (!st->trig)
|
||||
return -ENOMEM;
|
||||
|
||||
irq_type |= IRQF_ONESHOT;
|
||||
ret = devm_request_threaded_irq(&indio_dev->dev, st->irq,
|
||||
&inv_mpu6050_interrupt_timestamp,
|
||||
&inv_mpu6050_interrupt_handle,
|
||||
|
@ -721,7 +721,7 @@ int iio_read_channel_processed_scale(struct iio_channel *chan, int *val,
|
||||
return ret;
|
||||
*val *= scale;
|
||||
|
||||
return 0;
|
||||
return ret;
|
||||
} else {
|
||||
ret = iio_channel_read(chan, val, NULL, IIO_CHAN_INFO_RAW);
|
||||
if (ret < 0)
|
||||
|
@ -1394,12 +1394,12 @@ static int bmp580_read_temp(struct bmp280_data *data, int *val, int *val2)
|
||||
|
||||
/*
|
||||
* Temperature is returned in Celsius degrees in fractional
|
||||
* form down 2^16. We rescale by x1000 to return milli Celsius
|
||||
* to respect IIO ABI.
|
||||
* form down 2^16. We rescale by x1000 to return millidegrees
|
||||
* Celsius to respect IIO ABI.
|
||||
*/
|
||||
*val = raw_temp * 1000;
|
||||
*val2 = 16;
|
||||
return IIO_VAL_FRACTIONAL_LOG2;
|
||||
raw_temp = sign_extend32(raw_temp, 23);
|
||||
*val = ((s64)raw_temp * 1000) / (1 << 16);
|
||||
return IIO_VAL_INT;
|
||||
}
|
||||
|
||||
static int bmp580_read_press(struct bmp280_data *data, int *val, int *val2)
|
||||
|
@ -947,9 +947,9 @@ static int mlx90635_probe(struct i2c_client *client)
|
||||
"failed to allocate regmap\n");
|
||||
|
||||
regmap_ee = devm_regmap_init_i2c(client, &mlx90635_regmap_ee);
|
||||
if (IS_ERR(regmap))
|
||||
return dev_err_probe(&client->dev, PTR_ERR(regmap),
|
||||
"failed to allocate regmap\n");
|
||||
if (IS_ERR(regmap_ee))
|
||||
return dev_err_probe(&client->dev, PTR_ERR(regmap_ee),
|
||||
"failed to allocate EEPROM regmap\n");
|
||||
|
||||
mlx90635 = iio_priv(indio_dev);
|
||||
i2c_set_clientdata(client, indio_dev);
|
||||
|
@ -69,8 +69,10 @@ static int gp_aux_bus_probe(struct pci_dev *pdev, const struct pci_device_id *id
|
||||
|
||||
aux_bus->aux_device_wrapper[1] = kzalloc(sizeof(*aux_bus->aux_device_wrapper[1]),
|
||||
GFP_KERNEL);
|
||||
if (!aux_bus->aux_device_wrapper[1])
|
||||
return -ENOMEM;
|
||||
if (!aux_bus->aux_device_wrapper[1]) {
|
||||
retval = -ENOMEM;
|
||||
goto err_aux_dev_add_0;
|
||||
}
|
||||
|
||||
retval = ida_alloc(&gp_client_ida, GFP_KERNEL);
|
||||
if (retval < 0)
|
||||
@ -111,6 +113,7 @@ static int gp_aux_bus_probe(struct pci_dev *pdev, const struct pci_device_id *id
|
||||
|
||||
err_aux_dev_add_1:
|
||||
auxiliary_device_uninit(&aux_bus->aux_device_wrapper[1]->aux_dev);
|
||||
goto err_aux_dev_add_0;
|
||||
|
||||
err_aux_dev_init_1:
|
||||
ida_free(&gp_client_ida, aux_bus->aux_device_wrapper[1]->aux_dev.id);
|
||||
@ -120,6 +123,7 @@ err_ida_alloc_1:
|
||||
|
||||
err_aux_dev_add_0:
|
||||
auxiliary_device_uninit(&aux_bus->aux_device_wrapper[0]->aux_dev);
|
||||
goto err_ret;
|
||||
|
||||
err_aux_dev_init_0:
|
||||
ida_free(&gp_client_ida, aux_bus->aux_device_wrapper[0]->aux_dev.id);
|
||||
@ -127,6 +131,7 @@ err_aux_dev_init_0:
|
||||
err_ida_alloc_0:
|
||||
kfree(aux_bus->aux_device_wrapper[0]);
|
||||
|
||||
err_ret:
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
@ -329,7 +329,7 @@ static ssize_t mei_write(struct file *file, const char __user *ubuf,
|
||||
}
|
||||
|
||||
if (!mei_cl_is_connected(cl)) {
|
||||
cl_err(dev, cl, "is not connected");
|
||||
cl_dbg(dev, cl, "is not connected");
|
||||
rets = -ENODEV;
|
||||
goto out;
|
||||
}
|
||||
|
@ -385,8 +385,10 @@ static int mei_me_pci_resume(struct device *device)
|
||||
}
|
||||
|
||||
err = mei_restart(dev);
|
||||
if (err)
|
||||
if (err) {
|
||||
free_irq(pdev->irq, dev);
|
||||
return err;
|
||||
}
|
||||
|
||||
/* Start timer if stopped in suspend */
|
||||
schedule_delayed_work(&dev->timer_work, HZ);
|
||||
|
@ -399,41 +399,32 @@ static void mei_vsc_remove(struct platform_device *pdev)
|
||||
|
||||
static int mei_vsc_suspend(struct device *dev)
|
||||
{
|
||||
struct mei_device *mei_dev = dev_get_drvdata(dev);
|
||||
struct mei_vsc_hw *hw = mei_dev_to_vsc_hw(mei_dev);
|
||||
struct mei_device *mei_dev;
|
||||
int ret = 0;
|
||||
|
||||
mei_stop(mei_dev);
|
||||
mei_dev = dev_get_drvdata(dev);
|
||||
if (!mei_dev)
|
||||
return -ENODEV;
|
||||
|
||||
mei_disable_interrupts(mei_dev);
|
||||
mutex_lock(&mei_dev->device_lock);
|
||||
|
||||
vsc_tp_free_irq(hw->tp);
|
||||
if (!mei_write_is_idle(mei_dev))
|
||||
ret = -EAGAIN;
|
||||
|
||||
return 0;
|
||||
mutex_unlock(&mei_dev->device_lock);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int mei_vsc_resume(struct device *dev)
|
||||
{
|
||||
struct mei_device *mei_dev = dev_get_drvdata(dev);
|
||||
struct mei_vsc_hw *hw = mei_dev_to_vsc_hw(mei_dev);
|
||||
int ret;
|
||||
struct mei_device *mei_dev;
|
||||
|
||||
ret = vsc_tp_request_irq(hw->tp);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = mei_restart(mei_dev);
|
||||
if (ret)
|
||||
goto err_free;
|
||||
|
||||
/* start timer if stopped in suspend */
|
||||
schedule_delayed_work(&mei_dev->timer_work, HZ);
|
||||
mei_dev = dev_get_drvdata(dev);
|
||||
if (!mei_dev)
|
||||
return -ENODEV;
|
||||
|
||||
return 0;
|
||||
|
||||
err_free:
|
||||
vsc_tp_free_irq(hw->tp);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static DEFINE_SIMPLE_DEV_PM_OPS(mei_vsc_pm_ops, mei_vsc_suspend, mei_vsc_resume);
|
||||
|
@ -252,7 +252,7 @@ static int vsc_get_sensor_name(struct vsc_fw_loader *fw_loader,
|
||||
{
|
||||
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER };
|
||||
union acpi_object obj = {
|
||||
.type = ACPI_TYPE_INTEGER,
|
||||
.integer.type = ACPI_TYPE_INTEGER,
|
||||
.integer.value = 1,
|
||||
};
|
||||
struct acpi_object_list arg_list = {
|
||||
|
@ -229,7 +229,13 @@ static void __exit amiga_parallel_remove(struct platform_device *pdev)
|
||||
parport_put_port(port);
|
||||
}
|
||||
|
||||
static struct platform_driver amiga_parallel_driver = {
|
||||
/*
|
||||
* amiga_parallel_remove() lives in .exit.text. For drivers registered via
|
||||
* module_platform_driver_probe() this is ok because they cannot get unbound at
|
||||
* runtime. So mark the driver struct with __refdata to prevent modpost
|
||||
* triggering a section mismatch warning.
|
||||
*/
|
||||
static struct platform_driver amiga_parallel_driver __refdata = {
|
||||
.remove_new = __exit_p(amiga_parallel_remove),
|
||||
.driver = {
|
||||
.name = "amiga-parallel",
|
||||
|
@ -557,9 +557,11 @@ static int ea_get(struct inode *inode, struct ea_buffer *ea_buf, int min_size)
|
||||
|
||||
size_check:
|
||||
if (EALIST_SIZE(ea_buf->xattr) != ea_size) {
|
||||
int size = min_t(int, EALIST_SIZE(ea_buf->xattr), ea_size);
|
||||
|
||||
printk(KERN_ERR "ea_get: invalid extended attribute\n");
|
||||
print_hex_dump(KERN_ERR, "", DUMP_PREFIX_ADDRESS, 16, 1,
|
||||
ea_buf->xattr, ea_size, 1);
|
||||
ea_buf->xattr, size, 1);
|
||||
ea_release(inode, ea_buf);
|
||||
rc = -EIO;
|
||||
goto clean_up;
|
||||
|
Loading…
Reference in New Issue
Block a user