Skip to content

Commit

Permalink
Merge tag 'staging-3.13-rc2' of git://git.kernel.org/pub/scm/linux/ke…
Browse files Browse the repository at this point in the history
…rnel/git/gregkh/staging

Pull staging fixes from Greg KH:
 "Here are a number of staging, and IIO driver, fixes for 3.13-rc2 that
  resolve issues that have been reported for 3.13-rc1.  All of these
  have been in linux-next for a bit this week"

* tag 'staging-3.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (25 commits)
  Staging: tidspbridge: disable driver
  staging: zsmalloc: Ensure handle is never 0 on success
  staging/lustre/ptlrpc: fix ptlrpc_stop_pinger logic
  staging: r8188eu: Fix AP mode
  Staging: btmtk_usb: Add hdev parameter to hdev->send driver callback
  Staging: go7007: fix up some remaining go->dev issues
  staging: imx-drm: Fix modular build of DRM_IMX_IPUV3
  staging: ft1000: fix use of potentially uninitialized variable
  Revert "staging:media: Use dev_dbg() instead of pr_debug()"
  Staging: zram: Fix memory leak by refcount mismatch
  staging: vt6656: [BUG] Fix for TX USB resets from vendors driver.
  staging: nvec: potential NULL dereference on error path
  Staging: vt6655-6: potential NULL dereference in hostap_disable_hostapd()
  staging: comedi: s626: fix value written by s626_set_dac()
  Staging: comedi: pcl730: fix some bitwise vs logical AND bugs
  staging: comedi: fix potentially uninitialised variable
  iio:accel:kxsd9 fix missing mutex unlock
  iio: adc: ti_am335x_adc: avoid double free of buffer.
  staging:iio: Fix hmc5843 Kconfig dependencies
  iio: Fix tcs3472 Kconfig dependencies
  ...
  • Loading branch information
torvalds committed Nov 28, 2013
2 parents f496863 + 930ba4a commit 0b0f7f1
Show file tree
Hide file tree
Showing 33 changed files with 124 additions and 62 deletions.
5 changes: 3 additions & 2 deletions drivers/iio/accel/hid-sensor-accel-3d.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ static int hid_accel_3d_probe(struct platform_device *pdev)
error_iio_unreg:
iio_device_unregister(indio_dev);
error_remove_trigger:
hid_sensor_remove_trigger(indio_dev);
hid_sensor_remove_trigger(&accel_state->common_attributes);
error_unreg_buffer_funcs:
iio_triggered_buffer_cleanup(indio_dev);
error_free_dev_mem:
Expand All @@ -363,10 +363,11 @@ static int hid_accel_3d_remove(struct platform_device *pdev)
{
struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data;
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
struct accel_3d_state *accel_state = iio_priv(indio_dev);

sensor_hub_remove_callback(hsdev, HID_USAGE_SENSOR_ACCEL_3D);
iio_device_unregister(indio_dev);
hid_sensor_remove_trigger(indio_dev);
hid_sensor_remove_trigger(&accel_state->common_attributes);
iio_triggered_buffer_cleanup(indio_dev);
kfree(indio_dev->channels);

Expand Down
7 changes: 4 additions & 3 deletions drivers/iio/accel/kxsd9.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,10 @@ static int kxsd9_read(struct iio_dev *indio_dev, u8 address)
mutex_lock(&st->buf_lock);
st->tx[0] = KXSD9_READ(address);
ret = spi_sync_transfer(st->us, xfers, ARRAY_SIZE(xfers));
if (ret)
return ret;
return (((u16)(st->rx[0])) << 8) | (st->rx[1] & 0xF0);
if (!ret)
ret = (((u16)(st->rx[0])) << 8) | (st->rx[1] & 0xF0);
mutex_unlock(&st->buf_lock);
return ret;
}

static IIO_CONST_ATTR(accel_scale_available,
Expand Down
1 change: 1 addition & 0 deletions drivers/iio/adc/at91_adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1047,6 +1047,7 @@ static int at91_adc_probe(struct platform_device *pdev)
} else {
if (!st->caps->has_tsmr) {
dev_err(&pdev->dev, "We don't support non-TSMR adc\n");
ret = -ENODEV;
goto error_disable_adc_clk;
}

Expand Down
8 changes: 4 additions & 4 deletions drivers/iio/adc/mcp3422.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ static const int mcp3422_sample_rates[4] = {

/* sample rates to sign extension table */
static const int mcp3422_sign_extend[4] = {
[MCP3422_SRATE_240] = 12,
[MCP3422_SRATE_60] = 14,
[MCP3422_SRATE_15] = 16,
[MCP3422_SRATE_3] = 18 };
[MCP3422_SRATE_240] = 11,
[MCP3422_SRATE_60] = 13,
[MCP3422_SRATE_15] = 15,
[MCP3422_SRATE_3] = 17 };

/* Client data (each client gets its own) */
struct mcp3422 {
Expand Down
7 changes: 5 additions & 2 deletions drivers/iio/adc/ti_am335x_adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,15 @@ static int tiadc_iio_buffered_hardware_setup(struct iio_dev *indio_dev,
unsigned long flags,
const struct iio_buffer_setup_ops *setup_ops)
{
struct iio_buffer *buffer;
int ret;

indio_dev->buffer = iio_kfifo_allocate(indio_dev);
if (!indio_dev->buffer)
buffer = iio_kfifo_allocate(indio_dev);
if (!buffer)
return -ENOMEM;

iio_device_attach_buffer(indio_dev, buffer);

ret = request_threaded_irq(irq, pollfunc_th, pollfunc_bh,
flags, indio_dev->name, indio_dev);
if (ret)
Expand Down
9 changes: 4 additions & 5 deletions drivers/iio/common/hid-sensors/hid-sensor-trigger.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,10 @@ static int hid_sensor_data_rdy_trigger_set_state(struct iio_trigger *trig,
return 0;
}

void hid_sensor_remove_trigger(struct iio_dev *indio_dev)
void hid_sensor_remove_trigger(struct hid_sensor_common *attrb)
{
iio_trigger_unregister(indio_dev->trig);
iio_trigger_free(indio_dev->trig);
indio_dev->trig = NULL;
iio_trigger_unregister(attrb->trigger);
iio_trigger_free(attrb->trigger);
}
EXPORT_SYMBOL(hid_sensor_remove_trigger);

Expand Down Expand Up @@ -90,7 +89,7 @@ int hid_sensor_setup_trigger(struct iio_dev *indio_dev, const char *name,
dev_err(&indio_dev->dev, "Trigger Register Failed\n");
goto error_free_trig;
}
indio_dev->trig = trig;
indio_dev->trig = attrb->trigger = trig;

return ret;

Expand Down
2 changes: 1 addition & 1 deletion drivers/iio/common/hid-sensors/hid-sensor-trigger.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@

int hid_sensor_setup_trigger(struct iio_dev *indio_dev, const char *name,
struct hid_sensor_common *attrb);
void hid_sensor_remove_trigger(struct iio_dev *indio_dev);
void hid_sensor_remove_trigger(struct hid_sensor_common *attrb);

#endif
5 changes: 3 additions & 2 deletions drivers/iio/gyro/hid-sensor-gyro-3d.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ static int hid_gyro_3d_probe(struct platform_device *pdev)
error_iio_unreg:
iio_device_unregister(indio_dev);
error_remove_trigger:
hid_sensor_remove_trigger(indio_dev);
hid_sensor_remove_trigger(&gyro_state->common_attributes);
error_unreg_buffer_funcs:
iio_triggered_buffer_cleanup(indio_dev);
error_free_dev_mem:
Expand All @@ -361,10 +361,11 @@ static int hid_gyro_3d_remove(struct platform_device *pdev)
{
struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data;
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
struct gyro_3d_state *gyro_state = iio_priv(indio_dev);

sensor_hub_remove_callback(hsdev, HID_USAGE_SENSOR_GYRO_3D);
iio_device_unregister(indio_dev);
hid_sensor_remove_trigger(indio_dev);
hid_sensor_remove_trigger(&gyro_state->common_attributes);
iio_triggered_buffer_cleanup(indio_dev);
kfree(indio_dev->channels);

Expand Down
2 changes: 2 additions & 0 deletions drivers/iio/light/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ config SENSORS_LM3533
config TCS3472
tristate "TAOS TCS3472 color light-to-digital converter"
depends on I2C
select IIO_BUFFER
select IIO_TRIGGERED_BUFFER
help
If you say yes here you get support for the TAOS TCS3472
family of color light-to-digital converters with IR filter.
Expand Down
5 changes: 3 additions & 2 deletions drivers/iio/light/hid-sensor-als.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ static int hid_als_probe(struct platform_device *pdev)
error_iio_unreg:
iio_device_unregister(indio_dev);
error_remove_trigger:
hid_sensor_remove_trigger(indio_dev);
hid_sensor_remove_trigger(&als_state->common_attributes);
error_unreg_buffer_funcs:
iio_triggered_buffer_cleanup(indio_dev);
error_free_dev_mem:
Expand All @@ -327,10 +327,11 @@ static int hid_als_remove(struct platform_device *pdev)
{
struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data;
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
struct als_state *als_state = iio_priv(indio_dev);

sensor_hub_remove_callback(hsdev, HID_USAGE_SENSOR_ALS);
iio_device_unregister(indio_dev);
hid_sensor_remove_trigger(indio_dev);
hid_sensor_remove_trigger(&als_state->common_attributes);
iio_triggered_buffer_cleanup(indio_dev);
kfree(indio_dev->channels);

Expand Down
2 changes: 2 additions & 0 deletions drivers/iio/magnetometer/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ config AK8975
config MAG3110
tristate "Freescale MAG3110 3-Axis Magnetometer"
depends on I2C
select IIO_BUFFER
select IIO_TRIGGERED_BUFFER
help
Say yes here to build support for the Freescale MAG3110 3-Axis
magnetometer.
Expand Down
5 changes: 3 additions & 2 deletions drivers/iio/magnetometer/hid-sensor-magn-3d.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ static int hid_magn_3d_probe(struct platform_device *pdev)
error_iio_unreg:
iio_device_unregister(indio_dev);
error_remove_trigger:
hid_sensor_remove_trigger(indio_dev);
hid_sensor_remove_trigger(&magn_state->common_attributes);
error_unreg_buffer_funcs:
iio_triggered_buffer_cleanup(indio_dev);
error_free_dev_mem:
Expand All @@ -364,10 +364,11 @@ static int hid_magn_3d_remove(struct platform_device *pdev)
{
struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data;
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
struct magn_3d_state *magn_state = iio_priv(indio_dev);

sensor_hub_remove_callback(hsdev, HID_USAGE_SENSOR_COMPASS_3D);
iio_device_unregister(indio_dev);
hid_sensor_remove_trigger(indio_dev);
hid_sensor_remove_trigger(&magn_state->common_attributes);
iio_triggered_buffer_cleanup(indio_dev);
kfree(indio_dev->channels);

Expand Down
7 changes: 6 additions & 1 deletion drivers/iio/magnetometer/mag3110.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,12 @@ static irqreturn_t mag3110_trigger_handler(int irq, void *p)
.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SAMP_FREQ) | \
BIT(IIO_CHAN_INFO_SCALE), \
.scan_index = idx, \
.scan_type = IIO_ST('s', 16, 16, IIO_BE), \
.scan_type = { \
.sign = 's', \
.realbits = 16, \
.storagebits = 16, \
.endianness = IIO_BE, \
}, \
}

static const struct iio_chan_spec mag3110_channels[] = {
Expand Down
3 changes: 1 addition & 2 deletions drivers/staging/btmtk_usb/btmtk_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1284,9 +1284,8 @@ static void btmtk_usb_isoc_tx_complete(struct urb *urb)
kfree_skb(skb);
}

static int btmtk_usb_send_frame(struct sk_buff *skb)
static int btmtk_usb_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
{
struct hci_dev *hdev = (struct hci_dev *)skb->dev;
struct btmtk_usb_data *data = hci_get_drvdata(hdev);
struct usb_ctrlrequest *dr;
struct urb *urb;
Expand Down
6 changes: 3 additions & 3 deletions drivers/staging/comedi/drivers/pcl730.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,11 @@ static int pcl730_do_insn_bits(struct comedi_device *dev,
if (mask) {
if (mask & 0x00ff)
outb(s->state & 0xff, dev->iobase + reg);
if ((mask & 0xff00) & (s->n_chan > 8))
if ((mask & 0xff00) && (s->n_chan > 8))
outb((s->state >> 8) & 0xff, dev->iobase + reg + 1);
if ((mask & 0xff0000) & (s->n_chan > 16))
if ((mask & 0xff0000) && (s->n_chan > 16))
outb((s->state >> 16) & 0xff, dev->iobase + reg + 2);
if ((mask & 0xff000000) & (s->n_chan > 24))
if ((mask & 0xff000000) && (s->n_chan > 24))
outb((s->state >> 24) & 0xff, dev->iobase + reg + 3);
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/comedi/drivers/s626.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ static void s626_send_dac(struct comedi_device *dev, uint32_t val)
* Private helper function: Write setpoint to an application DAC channel.
*/
static void s626_set_dac(struct comedi_device *dev, uint16_t chan,
unsigned short dacdata)
int16_t dacdata)
{
struct s626_private *devpriv = dev->private;
uint16_t signmask;
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/comedi/drivers/vmk80xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ static int vmk80xx_do_insn_bits(struct comedi_device *dev,
unsigned char *rx_buf = devpriv->usb_rx_buf;
unsigned char *tx_buf = devpriv->usb_tx_buf;
int reg, cmd;
int ret;
int ret = 0;

if (devpriv->model == VMK8061_MODEL) {
reg = VMK8061_DO_REG;
Expand Down
3 changes: 1 addition & 2 deletions drivers/staging/ft1000/ft1000-usb/ft1000_download.c
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ static int request_code_segment(struct ft1000_usb *ft1000dev, u16 **s_file,
u8 **c_file, const u8 *endpoint, bool boot_case)
{
long word_length;
int status;
int status = 0;

/*DEBUG("FT1000:REQUEST_CODE_SEGMENT\n");i*/
word_length = get_request_value(ft1000dev);
Expand Down Expand Up @@ -1074,4 +1074,3 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart,

return status;
}

2 changes: 2 additions & 0 deletions drivers/staging/iio/magnetometer/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ menu "Magnetometer sensors"
config SENSORS_HMC5843
tristate "Honeywell HMC5843/5883/5883L 3-Axis Magnetometer"
depends on I2C
select IIO_BUFFER
select IIO_TRIGGERED_BUFFER
help
Say Y here to add support for the Honeywell HMC5843, HMC5883 and
HMC5883L 3-Axis Magnetometer (digital compass).
Expand Down
4 changes: 3 additions & 1 deletion drivers/staging/imx-drm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ obj-$(CONFIG_DRM_IMX_TVE) += imx-tve.o
obj-$(CONFIG_DRM_IMX_LDB) += imx-ldb.o
obj-$(CONFIG_DRM_IMX_FB_HELPER) += imx-fbdev.o
obj-$(CONFIG_DRM_IMX_IPUV3_CORE) += ipu-v3/
obj-$(CONFIG_DRM_IMX_IPUV3) += ipuv3-crtc.o ipuv3-plane.o

imx-ipuv3-crtc-objs := ipuv3-crtc.o ipuv3-plane.o
obj-$(CONFIG_DRM_IMX_IPUV3) += imx-ipuv3-crtc.o
1 change: 1 addition & 0 deletions drivers/staging/imx-drm/imx-drm-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ int imx_drm_crtc_id(struct imx_drm_crtc *crtc)
{
return crtc->pipe;
}
EXPORT_SYMBOL_GPL(imx_drm_crtc_id);

static void imx_drm_driver_lastclose(struct drm_device *drm)
{
Expand Down
4 changes: 2 additions & 2 deletions drivers/staging/lustre/lustre/ptlrpc/pinger.c
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,8 @@ int ptlrpc_stop_pinger(void)
struct l_wait_info lwi = { 0 };
int rc = 0;

if (!thread_is_init(&pinger_thread) &&
!thread_is_stopped(&pinger_thread))
if (thread_is_init(&pinger_thread) ||
thread_is_stopped(&pinger_thread))
return -EALREADY;

ptlrpc_pinger_remove_timeouts();
Expand Down
Loading

0 comments on commit 0b0f7f1

Please sign in to comment.