Commit 12d7aaca authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'staging-3.18-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging fixes from Greg KH:
 "Here are some staging driver fixes for 3.18-rc3.  Mostly iio and
  comedi driver fixes for issues reported by people.

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

* tag 'staging-3.18-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
  staging: comedi: fix memory leak / bad pointer freeing for chanlist
  staging: comedi: Kconfig: fix config COMEDI_ADDI_APCI_3120 dependants
  staging: comedi: widen subdevice number argument in ioctl handlers
  staging: rtl8723au: Fix alignment of mac_addr for ether_addr_copy() usage
  drivers/staging/comedi/Kconfig: Let COMEDI_II_PCI20KC depend on HAS_IOMEM
  staging: comedi: (regression) channel list must be set for COMEDI_CMD ioctl
  iio: adc: mxs-lradc: Disable the clock on probe failure
  iio: st_sensors: Fix buffer copy
  staging:iio:ad5933: Drop "raw" from channel names
  staging:iio:ad5933: Fix NULL pointer deref when enabling buffer
parents 528a506e 238b5ad8
...@@ -71,7 +71,7 @@ int st_sensors_get_buffer_element(struct iio_dev *indio_dev, u8 *buf) ...@@ -71,7 +71,7 @@ int st_sensors_get_buffer_element(struct iio_dev *indio_dev, u8 *buf)
goto st_sensors_free_memory; goto st_sensors_free_memory;
} }
for (i = 0; i < n * num_data_channels; i++) { for (i = 0; i < n * byte_for_channel; i++) {
if (i < n) if (i < n)
buf[i] = rx_array[i]; buf[i] = rx_array[i];
else else
......
...@@ -426,6 +426,7 @@ config COMEDI_AIO_IIRO_16 ...@@ -426,6 +426,7 @@ config COMEDI_AIO_IIRO_16
config COMEDI_II_PCI20KC config COMEDI_II_PCI20KC
tristate "Intelligent Instruments PCI-20001C carrier support" tristate "Intelligent Instruments PCI-20001C carrier support"
depends on HAS_IOMEM
---help--- ---help---
Enable support for Intelligent Instruments PCI-20001C carrier Enable support for Intelligent Instruments PCI-20001C carrier
PCI-20001, PCI-20006 and PCI-20341 PCI-20001, PCI-20006 and PCI-20341
...@@ -667,7 +668,6 @@ config COMEDI_ADDI_APCI_2200 ...@@ -667,7 +668,6 @@ config COMEDI_ADDI_APCI_2200
config COMEDI_ADDI_APCI_3120 config COMEDI_ADDI_APCI_3120
tristate "ADDI-DATA APCI_3120/3001 support" tristate "ADDI-DATA APCI_3120/3001 support"
depends on HAS_DMA depends on HAS_DMA
depends on VIRT_TO_BUS
---help--- ---help---
Enable support for ADDI-DATA APCI_3120/3001 cards Enable support for ADDI-DATA APCI_3120/3001 cards
......
...@@ -1462,10 +1462,7 @@ static int __comedi_get_user_chanlist(struct comedi_device *dev, ...@@ -1462,10 +1462,7 @@ static int __comedi_get_user_chanlist(struct comedi_device *dev,
unsigned int *chanlist; unsigned int *chanlist;
int ret; int ret;
/* user_chanlist could be NULL for do_cmdtest ioctls */ cmd->chanlist = NULL;
if (!user_chanlist)
return 0;
chanlist = memdup_user(user_chanlist, chanlist = memdup_user(user_chanlist,
cmd->chanlist_len * sizeof(unsigned int)); cmd->chanlist_len * sizeof(unsigned int));
if (IS_ERR(chanlist)) if (IS_ERR(chanlist))
...@@ -1609,13 +1606,18 @@ static int do_cmdtest_ioctl(struct comedi_device *dev, ...@@ -1609,13 +1606,18 @@ static int do_cmdtest_ioctl(struct comedi_device *dev,
s = &dev->subdevices[cmd.subdev]; s = &dev->subdevices[cmd.subdev];
/* load channel/gain list */ /* user_chanlist can be NULL for COMEDI_CMDTEST ioctl */
ret = __comedi_get_user_chanlist(dev, s, user_chanlist, &cmd); if (user_chanlist) {
if (ret) /* load channel/gain list */
return ret; ret = __comedi_get_user_chanlist(dev, s, user_chanlist, &cmd);
if (ret)
return ret;
}
ret = s->do_cmdtest(dev, s, &cmd); ret = s->do_cmdtest(dev, s, &cmd);
kfree(cmd.chanlist); /* free kernel copy of user chanlist */
/* restore chanlist pointer before copying back */ /* restore chanlist pointer before copying back */
cmd.chanlist = (unsigned int __force *)user_chanlist; cmd.chanlist = (unsigned int __force *)user_chanlist;
...@@ -1642,7 +1644,7 @@ static int do_cmdtest_ioctl(struct comedi_device *dev, ...@@ -1642,7 +1644,7 @@ static int do_cmdtest_ioctl(struct comedi_device *dev,
*/ */
static int do_lock_ioctl(struct comedi_device *dev, unsigned int arg, static int do_lock_ioctl(struct comedi_device *dev, unsigned long arg,
void *file) void *file)
{ {
int ret = 0; int ret = 0;
...@@ -1679,7 +1681,7 @@ static int do_lock_ioctl(struct comedi_device *dev, unsigned int arg, ...@@ -1679,7 +1681,7 @@ static int do_lock_ioctl(struct comedi_device *dev, unsigned int arg,
This function isn't protected by the semaphore, since This function isn't protected by the semaphore, since
we already own the lock. we already own the lock.
*/ */
static int do_unlock_ioctl(struct comedi_device *dev, unsigned int arg, static int do_unlock_ioctl(struct comedi_device *dev, unsigned long arg,
void *file) void *file)
{ {
struct comedi_subdevice *s; struct comedi_subdevice *s;
...@@ -1714,7 +1716,7 @@ static int do_unlock_ioctl(struct comedi_device *dev, unsigned int arg, ...@@ -1714,7 +1716,7 @@ static int do_unlock_ioctl(struct comedi_device *dev, unsigned int arg,
nothing nothing
*/ */
static int do_cancel_ioctl(struct comedi_device *dev, unsigned int arg, static int do_cancel_ioctl(struct comedi_device *dev, unsigned long arg,
void *file) void *file)
{ {
struct comedi_subdevice *s; struct comedi_subdevice *s;
...@@ -1751,7 +1753,7 @@ static int do_cancel_ioctl(struct comedi_device *dev, unsigned int arg, ...@@ -1751,7 +1753,7 @@ static int do_cancel_ioctl(struct comedi_device *dev, unsigned int arg,
nothing nothing
*/ */
static int do_poll_ioctl(struct comedi_device *dev, unsigned int arg, static int do_poll_ioctl(struct comedi_device *dev, unsigned long arg,
void *file) void *file)
{ {
struct comedi_subdevice *s; struct comedi_subdevice *s;
......
...@@ -1559,14 +1559,16 @@ static int mxs_lradc_probe(struct platform_device *pdev) ...@@ -1559,14 +1559,16 @@ static int mxs_lradc_probe(struct platform_device *pdev)
/* Grab all IRQ sources */ /* Grab all IRQ sources */
for (i = 0; i < of_cfg->irq_count; i++) { for (i = 0; i < of_cfg->irq_count; i++) {
lradc->irq[i] = platform_get_irq(pdev, i); lradc->irq[i] = platform_get_irq(pdev, i);
if (lradc->irq[i] < 0) if (lradc->irq[i] < 0) {
return lradc->irq[i]; ret = lradc->irq[i];
goto err_clk;
}
ret = devm_request_irq(dev, lradc->irq[i], ret = devm_request_irq(dev, lradc->irq[i],
mxs_lradc_handle_irq, 0, mxs_lradc_handle_irq, 0,
of_cfg->irq_name[i], iio); of_cfg->irq_name[i], iio);
if (ret) if (ret)
return ret; goto err_clk;
} }
lradc->vref_mv = of_cfg->vref_mv; lradc->vref_mv = of_cfg->vref_mv;
...@@ -1588,7 +1590,7 @@ static int mxs_lradc_probe(struct platform_device *pdev) ...@@ -1588,7 +1590,7 @@ static int mxs_lradc_probe(struct platform_device *pdev)
&mxs_lradc_trigger_handler, &mxs_lradc_trigger_handler,
&mxs_lradc_buffer_ops); &mxs_lradc_buffer_ops);
if (ret) if (ret)
return ret; goto err_clk;
ret = mxs_lradc_trigger_init(iio); ret = mxs_lradc_trigger_init(iio);
if (ret) if (ret)
...@@ -1643,6 +1645,8 @@ static int mxs_lradc_probe(struct platform_device *pdev) ...@@ -1643,6 +1645,8 @@ static int mxs_lradc_probe(struct platform_device *pdev)
mxs_lradc_trigger_remove(iio); mxs_lradc_trigger_remove(iio);
err_trig: err_trig:
iio_triggered_buffer_cleanup(iio); iio_triggered_buffer_cleanup(iio);
err_clk:
clk_disable_unprepare(lradc->clk);
return ret; return ret;
} }
......
...@@ -115,6 +115,7 @@ static const struct iio_chan_spec ad5933_channels[] = { ...@@ -115,6 +115,7 @@ static const struct iio_chan_spec ad5933_channels[] = {
.channel = 0, .channel = 0,
.info_mask_separate = BIT(IIO_CHAN_INFO_PROCESSED), .info_mask_separate = BIT(IIO_CHAN_INFO_PROCESSED),
.address = AD5933_REG_TEMP_DATA, .address = AD5933_REG_TEMP_DATA,
.scan_index = -1,
.scan_type = { .scan_type = {
.sign = 's', .sign = 's',
.realbits = 14, .realbits = 14,
...@@ -124,9 +125,7 @@ static const struct iio_chan_spec ad5933_channels[] = { ...@@ -124,9 +125,7 @@ static const struct iio_chan_spec ad5933_channels[] = {
.type = IIO_VOLTAGE, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 0, .channel = 0,
.extend_name = "real_raw", .extend_name = "real",
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |
BIT(IIO_CHAN_INFO_SCALE),
.address = AD5933_REG_REAL_DATA, .address = AD5933_REG_REAL_DATA,
.scan_index = 0, .scan_index = 0,
.scan_type = { .scan_type = {
...@@ -138,9 +137,7 @@ static const struct iio_chan_spec ad5933_channels[] = { ...@@ -138,9 +137,7 @@ static const struct iio_chan_spec ad5933_channels[] = {
.type = IIO_VOLTAGE, .type = IIO_VOLTAGE,
.indexed = 1, .indexed = 1,
.channel = 0, .channel = 0,
.extend_name = "imag_raw", .extend_name = "imag",
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |
BIT(IIO_CHAN_INFO_SCALE),
.address = AD5933_REG_IMAG_DATA, .address = AD5933_REG_IMAG_DATA,
.scan_index = 1, .scan_index = 1,
.scan_type = { .scan_type = {
...@@ -749,14 +746,14 @@ static int ad5933_probe(struct i2c_client *client, ...@@ -749,14 +746,14 @@ static int ad5933_probe(struct i2c_client *client,
indio_dev->name = id->name; indio_dev->name = id->name;
indio_dev->modes = INDIO_DIRECT_MODE; indio_dev->modes = INDIO_DIRECT_MODE;
indio_dev->channels = ad5933_channels; indio_dev->channels = ad5933_channels;
indio_dev->num_channels = 1; /* only register temp0_input */ indio_dev->num_channels = ARRAY_SIZE(ad5933_channels);
ret = ad5933_register_ring_funcs_and_init(indio_dev); ret = ad5933_register_ring_funcs_and_init(indio_dev);
if (ret) if (ret)
goto error_disable_reg; goto error_disable_reg;
/* skip temp0_input, register in0_(real|imag)_raw */ ret = iio_buffer_register(indio_dev, ad5933_channels,
ret = iio_buffer_register(indio_dev, &ad5933_channels[1], 2); ARRAY_SIZE(ad5933_channels));
if (ret) if (ret)
goto error_unreg_ring; goto error_unreg_ring;
......
...@@ -107,12 +107,12 @@ enum rt_customer_id ...@@ -107,12 +107,12 @@ enum rt_customer_id
}; };
struct eeprom_priv { struct eeprom_priv {
u8 mac_addr[6]; /* PermanentAddress */
u8 bautoload_fail_flag; u8 bautoload_fail_flag;
u8 bloadfile_fail_flag; u8 bloadfile_fail_flag;
u8 bloadmac_fail_flag; u8 bloadmac_fail_flag;
/* u8 bempty; */ /* u8 bempty; */
/* u8 sys_config; */ /* u8 sys_config; */
u8 mac_addr[6]; /* PermanentAddress */
/* u8 config0; */ /* u8 config0; */
u16 channel_plan; u16 channel_plan;
/* u8 country_string[3]; */ /* u8 country_string[3]; */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment