Merge tag 'v3.7-rc3' into next to sync up with recent USB and MFD changes
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 30 Oct 2012 07:20:56 +0000 (00:20 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 30 Oct 2012 07:20:56 +0000 (00:20 -0700)
1  2 
drivers/input/keyboard/Kconfig
drivers/input/keyboard/qt2160.c
drivers/input/touchscreen/edt-ft5x06.c
drivers/input/touchscreen/wm831x-ts.c

@@@ -134,7 -134,7 +134,7 @@@ config KEYBOARD_QT107
  
  config KEYBOARD_QT2160
        tristate "Atmel AT42QT2160 Touch Sensor Chip"
 -      depends on I2C && EXPERIMENTAL
 +      depends on I2C
        help
          If you say yes here you get support for Atmel AT42QT2160 Touch
          Sensor chip as a keyboard input.
@@@ -533,7 -533,7 +533,7 @@@ config KEYBOARD_DAVINC
  
  config KEYBOARD_OMAP
        tristate "TI OMAP keypad support"
-       depends on (ARCH_OMAP1 || ARCH_OMAP2)
+       depends on ARCH_OMAP1
        select INPUT_MATRIXKMAP
        help
          Say Y here if you want to use the OMAP keypad.
@@@ -156,8 -156,7 +156,7 @@@ static irqreturn_t qt2160_irq(int irq, 
  
        spin_lock_irqsave(&qt2160->lock, flags);
  
-       __cancel_delayed_work(&qt2160->dwork);
-       schedule_delayed_work(&qt2160->dwork, 0);
+       mod_delayed_work(system_wq, &qt2160->dwork, 0);
  
        spin_unlock_irqrestore(&qt2160->lock, flags);
  
@@@ -207,14 -206,23 +206,14 @@@ static int __devinit qt2160_read(struc
  
  static int __devinit qt2160_write(struct i2c_client *client, u8 reg, u8 data)
  {
 -      int error;
 -
 -      error = i2c_smbus_write_byte(client, reg);
 -      if (error) {
 -              dev_err(&client->dev,
 -                      "couldn't send request. Returned %d\n", error);
 -              return error;
 -      }
 +      int ret;
  
 -      error = i2c_smbus_write_byte(client, data);
 -      if (error) {
 +      ret = i2c_smbus_write_byte_data(client, reg, data);
 +      if (ret < 0)
                dev_err(&client->dev,
 -                      "couldn't write data. Returned %d\n", error);
 -              return error;
 -      }
 +                      "couldn't write data. Returned %d\n", ret);
  
 -      return error;
 +      return ret;
  }
  
  
@@@ -491,6 -491,14 +491,6 @@@ static int edt_ft5x06_debugfs_mode_set(
  DEFINE_SIMPLE_ATTRIBUTE(debugfs_mode_fops, edt_ft5x06_debugfs_mode_get,
                        edt_ft5x06_debugfs_mode_set, "%llu\n");
  
 -static int edt_ft5x06_debugfs_raw_data_open(struct inode *inode,
 -                                          struct file *file)
 -{
 -      file->private_data = inode->i_private;
 -
 -      return 0;
 -}
 -
  static ssize_t edt_ft5x06_debugfs_raw_data_read(struct file *file,
                                char __user *buf, size_t count, loff_t *off)
  {
        }
  
        read = min_t(size_t, count, tsdata->raw_bufsize - *off);
-       error = copy_to_user(buf, tsdata->raw_buffer + *off, read);
-       if (!error)
-               *off += read;
+       if (copy_to_user(buf, tsdata->raw_buffer + *off, read)) {
+               error = -EFAULT;
+               goto out;
+       }
+       *off += read;
  out:
        mutex_unlock(&tsdata->mutex);
        return error ?: read;
  
  
  static const struct file_operations debugfs_raw_data_fops = {
 -      .open = edt_ft5x06_debugfs_raw_data_open,
 +      .open = simple_open,
        .read = edt_ft5x06_debugfs_raw_data_read,
  };
  
@@@ -594,6 -605,7 +597,7 @@@ edt_ft5x06_ts_teardown_debugfs(struct e
  {
        if (tsdata->debug_dir)
                debugfs_remove_recursive(tsdata->debug_dir);
+       kfree(tsdata->raw_buffer);
  }
  
  #else
@@@ -835,7 -847,6 +839,6 @@@ static int __devexit edt_ft5x06_ts_remo
        if (gpio_is_valid(pdata->reset_pin))
                gpio_free(pdata->reset_pin);
  
-       kfree(tsdata->raw_buffer);
        kfree(tsdata);
  
        return 0;
@@@ -221,7 -221,7 +221,7 @@@ static void wm831x_ts_input_close(struc
        synchronize_irq(wm831x_ts->pd_irq);
  
        /* Make sure the IRQ completion work is quiesced */
-       flush_work_sync(&wm831x_ts->pd_data_work);
+       flush_work(&wm831x_ts->pd_data_work);
  
        /* If we ended up with the pen down then make sure we revert back
         * to pen detection state for the next time we start up.
@@@ -245,8 -245,7 +245,8 @@@ static __devinit int wm831x_ts_probe(st
        if (core_pdata)
                pdata = core_pdata->touch;
  
 -      wm831x_ts = kzalloc(sizeof(struct wm831x_ts), GFP_KERNEL);
 +      wm831x_ts = devm_kzalloc(&pdev->dev, sizeof(struct wm831x_ts),
 +                               GFP_KERNEL);
        input_dev = input_allocate_device();
        if (!wm831x_ts || !input_dev) {
                error = -ENOMEM;
@@@ -377,6 -376,7 +377,6 @@@ err_data_irq
        free_irq(wm831x_ts->data_irq, wm831x_ts);
  err_alloc:
        input_free_device(input_dev);
 -      kfree(wm831x_ts);
  
        return error;
  }
@@@ -388,7 -388,9 +388,7 @@@ static __devexit int wm831x_ts_remove(s
        free_irq(wm831x_ts->pd_irq, wm831x_ts);
        free_irq(wm831x_ts->data_irq, wm831x_ts);
        input_unregister_device(wm831x_ts->input_dev);
 -      kfree(wm831x_ts);
  
 -      platform_set_drvdata(pdev, NULL);
        return 0;
  }