All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/33] Input: Automated coccinelle cleanup
@ 2017-01-18 17:46 Guenter Roeck
  2017-01-18 17:46 ` [PATCH 01/33] Input: adp5520-keys - Drop unnecessary error messages and other changes Guenter Roeck
                   ` (30 more replies)
  0 siblings, 31 replies; 68+ messages in thread
From: Guenter Roeck @ 2017-01-18 17:46 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, linux-kernel, Guenter Roeck

This patch series is the result of applying a set of coccinelle semantic
patches to the input subsystem. The patches are only cleanup patches;
there is little or no change in functionality.

A more complex series of patches making actual code changes will be sent
separately. This patch series is a fallout from this more complex series.
It may be questionable if the patches in this series, or any of them,
are worth it. I'll leave that up to the maintainers to decide.

A surprising aspect of this patch series is the number of removed calls
to platform_set_drvdata() and i2c_set_clientdata(). While I have not found
any problems with those removals, this deserves some extra scrutiny from
reviewers.

The conversion was done automatically with coccinelle using several semantic
patches. The semantic patches and the scripts used to generate this commit
log are available at https://github.com/groeck/coccinelle-patches.
A few files had to be edited manually to fix checkpatch issues.
Those edits were also handled automatically with fixup patches included
in the repository.

The series was build tested on kerneltests.org and by the 0day build system.

To reproduce this series of patches, checkout the tree above, then run
the following commands from the Linux source tree.

sh ~coccinelle-patches/input/make-base.sh
sh ~coccinelle-patches/input/do-commit-base.sh

The patch series is based on v4.10-rc3. For convenience, the series
is available at:
	git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git input-base

The semantic patches used in this series were written with substantial help
from Julia Lawall. Without her support, this effort would not have been
possible.

----------------------------------------------------------------
Guenter Roeck (33):
      Input: adp5520-keys - Drop unnecessary error messages and other changes
      Input: bcm-keypad - Drop unnecessary call to platform_set_drvdata and other changes
      Input: cap11xx - Drop unnecessary call to i2c_set_clientdata and other changes
      Input: cros_ec_keyb - Drop unnecessary call to dev_set_drvdata and other changes
      Input: imx_keypad - Drop unnecessary error messages and other changes
      Input: samsung-keypad - Drop unnecessary error messages and other changes
      Input: sh_keysc - Drop unnecessary error messages and other changes
      Input: spear-keyboard - Drop unnecessary error messages and other changes
      Input: sun4i-lradc-keys - Drop unnecessary call to platform_set_drvdata and other changes
      Input: twl4030_keypad - Drop unnecessary call to platform_set_drvdata and other changes
      Input: ab8500-ponkey - Drop unnecessary call to platform_set_drvdata and other changes
      Input: axp20x-pek - Use devm_add_action_or_reset and other changes
      Input: bfin_rotary - Use 'dev' instead of dereferencing it and other changes
      Input: gpio_decoder - Drop unnecessary call to platform_set_drvdata and other changes
      Input: kxtj9 - Drop unnecessary error messages and other changes
      Input: mma8450 - Drop unnecessary call to i2c_set_clientdata and other changes
      Input: retu-pwrbutton - Simplify error return and other changes
      Input: soc_button_array - Use 'dev' instead of dereferencing it and other changes
      Input: tps65218-pwrbutton - Drop unnecessary call to platform_set_drvdata and other changes
      Input: elan_i2c_core - Use 'dev' instead of dereferencing it and other changes
      Input: arc_ps2 - Drop unnecessary error messages and other changes
      Input: at32psif - Drop unnecessary error messages and other changes
      Input: xilinx_ps2 - Use 'dev' instead of dereferencing it and other changes
      Input: ar1021_i2c - Drop unnecessary call to i2c_set_clientdata and other changes
      Input: atmel-wm97xx - Drop unnecessary error messages and other changes
      Input: atmel_mxt_ts - Drop unnecessary error messages and other changes
      Input: eeti_ts - Drop unnecessary error messages and other changes
      Input: egalax_ts - Drop unnecessary call to i2c_set_clientdata and other changes
      Input: melfas_mip4 - Use devm_add_action_or_reset and other changes
      Input: raydium_i2c_ts - Simplify error return and other changes
      Input: rohm_bu21023 - Use 'dev' instead of dereferencing it and other changes
      Input: sis_i2c - Drop unnecessary call to i2c_set_clientdata and other changes
      Input: sx8654 - Drop unnecessary call to i2c_set_clientdata and other changes

 drivers/input/keyboard/adp5520-keys.c      |  4 +-
 drivers/input/keyboard/bcm-keypad.c        |  2 -
 drivers/input/keyboard/cap11xx.c           | 14 ++-----
 drivers/input/keyboard/cros_ec_keyb.c      |  3 +-
 drivers/input/keyboard/imx_keypad.c        |  4 +-
 drivers/input/keyboard/samsung-keypad.c    | 12 ++----
 drivers/input/keyboard/sh_keysc.c          | 15 +++-----
 drivers/input/keyboard/spear-keyboard.c    |  4 +-
 drivers/input/keyboard/sun4i-lradc-keys.c  |  7 +---
 drivers/input/keyboard/twl4030_keypad.c    |  1 -
 drivers/input/misc/ab8500-ponkey.c         |  1 -
 drivers/input/misc/axp20x-pek.c            |  6 +--
 drivers/input/misc/bfin_rotary.c           | 18 ++++-----
 drivers/input/misc/gpio_decoder.c          |  1 -
 drivers/input/misc/kxtj9.c                 | 12 ++----
 drivers/input/misc/mma8450.c               |  2 -
 drivers/input/misc/retu-pwrbutton.c        | 12 +-----
 drivers/input/misc/soc_button_array.c      |  6 +--
 drivers/input/misc/tps65218-pwrbutton.c    | 11 ++----
 drivers/input/mouse/elan_i2c_core.c        | 59 +++++++++++-------------------
 drivers/input/serio/arc_ps2.c              |  4 +-
 drivers/input/serio/at32psif.c             | 12 ++----
 drivers/input/serio/xilinx_ps2.c           |  7 ++--
 drivers/input/touchscreen/ar1021_i2c.c     |  6 +--
 drivers/input/touchscreen/atmel-wm97xx.c   |  4 +-
 drivers/input/touchscreen/atmel_mxt_ts.c   | 47 +++++-------------------
 drivers/input/touchscreen/eeti_ts.c        |  7 +---
 drivers/input/touchscreen/egalax_ts.c      | 21 ++---------
 drivers/input/touchscreen/melfas_mip4.c    | 10 ++---
 drivers/input/touchscreen/raydium_i2c_ts.c | 18 +++------
 drivers/input/touchscreen/rohm_bu21023.c   | 12 +++---
 drivers/input/touchscreen/sis_i2c.c        |  1 -
 drivers/input/touchscreen/sx8654.c         | 14 ++-----
 33 files changed, 105 insertions(+), 252 deletions(-)

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [PATCH 01/33] Input: adp5520-keys - Drop unnecessary error messages and other changes
  2017-01-18 17:46 [PATCH 00/33] Input: Automated coccinelle cleanup Guenter Roeck
@ 2017-01-18 17:46 ` Guenter Roeck
  2017-01-18 17:46 ` [PATCH 02/33] Input: bcm-keypad - Drop unnecessary call to platform_set_drvdata " Guenter Roeck
                   ` (29 subsequent siblings)
  30 siblings, 0 replies; 68+ messages in thread
From: Guenter Roeck @ 2017-01-18 17:46 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: linux-input, linux-kernel, Guenter Roeck, Michael Hennerich

Error messages after memory allocation failures are unnecessary and
can be dropped.

This conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts
used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches

- Drop unnecessary braces around conditional return statements
- Drop error message after devm_kzalloc() failure

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/input/keyboard/adp5520-keys.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/input/keyboard/adp5520-keys.c b/drivers/input/keyboard/adp5520-keys.c
index db1004dad108..de69d415c2b5 100644
--- a/drivers/input/keyboard/adp5520-keys.c
+++ b/drivers/input/keyboard/adp5520-keys.c
@@ -91,10 +91,8 @@ static int adp5520_keys_probe(struct platform_device *pdev)
 		return -EINVAL;
 
 	dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL);
-	if (!dev) {
-		dev_err(&pdev->dev, "failed to alloc memory\n");
+	if (!dev)
 		return -ENOMEM;
-	}
 
 	input = devm_input_allocate_device(&pdev->dev);
 	if (!input)
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 02/33] Input: bcm-keypad - Drop unnecessary call to platform_set_drvdata and other changes
  2017-01-18 17:46 [PATCH 00/33] Input: Automated coccinelle cleanup Guenter Roeck
  2017-01-18 17:46 ` [PATCH 01/33] Input: adp5520-keys - Drop unnecessary error messages and other changes Guenter Roeck
@ 2017-01-18 17:46 ` Guenter Roeck
  2017-01-18 17:46 ` [PATCH 03/33] Input: cap11xx - Drop unnecessary call to i2c_set_clientdata " Guenter Roeck
                   ` (28 subsequent siblings)
  30 siblings, 0 replies; 68+ messages in thread
From: Guenter Roeck @ 2017-01-18 17:46 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, linux-kernel, Guenter Roeck

There is no call to platform_get_drvdata() or dev_get_drvdata().
Drop the unnecessary call to platform_set_drvdata().

This conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts
used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches

- Drop platform_set_drvdata()

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/input/keyboard/bcm-keypad.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/input/keyboard/bcm-keypad.c b/drivers/input/keyboard/bcm-keypad.c
index 86a8b723ae15..2b4e63d81e6d 100644
--- a/drivers/input/keyboard/bcm-keypad.c
+++ b/drivers/input/keyboard/bcm-keypad.c
@@ -352,8 +352,6 @@ static int bcm_kp_probe(struct platform_device *pdev)
 
 	kp->input_dev = input_dev;
 
-	platform_set_drvdata(pdev, kp);
-
 	error = bcm_kp_matrix_key_parse_dt(kp);
 	if (error)
 		return error;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 03/33] Input: cap11xx - Drop unnecessary call to i2c_set_clientdata and other changes
  2017-01-18 17:46 [PATCH 00/33] Input: Automated coccinelle cleanup Guenter Roeck
  2017-01-18 17:46 ` [PATCH 01/33] Input: adp5520-keys - Drop unnecessary error messages and other changes Guenter Roeck
  2017-01-18 17:46 ` [PATCH 02/33] Input: bcm-keypad - Drop unnecessary call to platform_set_drvdata " Guenter Roeck
@ 2017-01-18 17:46 ` Guenter Roeck
  2017-01-18 17:46 ` [PATCH 04/33] Input: cros_ec_keyb - Drop unnecessary call to dev_set_drvdata " Guenter Roeck
                   ` (27 subsequent siblings)
  30 siblings, 0 replies; 68+ messages in thread
From: Guenter Roeck @ 2017-01-18 17:46 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: linux-input, linux-kernel, Guenter Roeck, Amitoj Kaur Chawla

There is no call to i2c_get_clientdata() or dev_get_drvdata().
Drop the unnecessary call to i2c_set_clientdata().
Other relevant changes:
  Simplify error return

This conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts
used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches

- Replace 'goto l; ... l: return e;' with 'return e;'
- Replace 'if (e) return e; return 0;' with 'return e;'
- Drop i2c_set_clientdata()

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/input/keyboard/cap11xx.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/input/keyboard/cap11xx.c b/drivers/input/keyboard/cap11xx.c
index 4401be225d64..9cbba2dd0e29 100644
--- a/drivers/input/keyboard/cap11xx.c
+++ b/drivers/input/keyboard/cap11xx.c
@@ -189,11 +189,11 @@ static irqreturn_t cap11xx_thread_func(int irq_num, void *data)
 	 */
 	ret = regmap_update_bits(priv->regmap, CAP11XX_REG_MAIN_CONTROL, 1, 0);
 	if (ret < 0)
-		goto out;
+		return IRQ_HANDLED;
 
 	ret = regmap_read(priv->regmap, CAP11XX_REG_SENSOR_INPUT, &status);
 	if (ret < 0)
-		goto out;
+		return IRQ_HANDLED;
 
 	for (i = 0; i < priv->idev->keycodemax; i++)
 		input_report_key(priv->idev, priv->keycodes[i],
@@ -201,7 +201,6 @@ static irqreturn_t cap11xx_thread_func(int irq_num, void *data)
 
 	input_sync(priv->idev);
 
-out:
 	return IRQ_HANDLED;
 }
 
@@ -392,7 +391,6 @@ static int cap11xx_i2c_probe(struct i2c_client *i2c_client,
 		return error;
 
 	dev_info(dev, "CAP11XX detected, revision 0x%02x\n", rev);
-	i2c_set_clientdata(i2c_client, priv);
 	node = dev->of_node;
 
 	if (!of_property_read_u32(node, "microchip,sensor-gain", &gain32)) {
@@ -476,12 +474,8 @@ static int cap11xx_i2c_probe(struct i2c_client *i2c_client,
 		return -ENXIO;
 	}
 
-	error = devm_request_threaded_irq(dev, irq, NULL, cap11xx_thread_func,
-					  IRQF_ONESHOT, dev_name(dev), priv);
-	if (error)
-		return error;
-
-	return 0;
+	return devm_request_threaded_irq(dev, irq, NULL, cap11xx_thread_func,
+					 IRQF_ONESHOT, dev_name(dev), priv);
 }
 
 static const struct of_device_id cap11xx_dt_ids[] = {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 04/33] Input: cros_ec_keyb - Drop unnecessary call to dev_set_drvdata and other changes
  2017-01-18 17:46 [PATCH 00/33] Input: Automated coccinelle cleanup Guenter Roeck
                   ` (2 preceding siblings ...)
  2017-01-18 17:46 ` [PATCH 03/33] Input: cap11xx - Drop unnecessary call to i2c_set_clientdata " Guenter Roeck
@ 2017-01-18 17:46 ` Guenter Roeck
  2017-01-18 18:39   ` Dmitry Torokhov
  2017-01-18 17:46 ` [PATCH 05/33] Input: imx_keypad - Drop unnecessary error messages " Guenter Roeck
                   ` (26 subsequent siblings)
  30 siblings, 1 reply; 68+ messages in thread
From: Guenter Roeck @ 2017-01-18 17:46 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: linux-input, linux-kernel, Guenter Roeck, Brian Norris,
	Douglas Anderson, Lee Jones, Vic Yang

There is no call to platform_get_drvdata() or dev_get_drvdata().
Drop the unnecessary call to dev_set_drvdata().
Other relevant changes:
  Use existing variable 'dev' instead of dereferencing it several times

This conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts
used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches

- Drop dev_set_drvdata()
- Use local variable 'struct device *dev' consistently

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/input/keyboard/cros_ec_keyb.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c
index 25943e9bc8bf..87d071ae21da 100644
--- a/drivers/input/keyboard/cros_ec_keyb.c
+++ b/drivers/input/keyboard/cros_ec_keyb.c
@@ -222,7 +222,7 @@ static int cros_ec_keyb_probe(struct platform_device *pdev)
 	struct device_node *np;
 	int err;
 
-	np = pdev->dev.of_node;
+	np = dev->of_node;
 	if (!np)
 		return -ENODEV;
 
@@ -248,7 +248,6 @@ static int cros_ec_keyb_probe(struct platform_device *pdev)
 	ckdev->ec = ec;
 	ckdev->notifier.notifier_call = cros_ec_keyb_work;
 	ckdev->dev = dev;
-	dev_set_drvdata(dev, ckdev);
 
 	idev->name = CROS_EC_DEV_NAME;
 	idev->phys = ec->phys_name;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 05/33] Input: imx_keypad - Drop unnecessary error messages and other changes
  2017-01-18 17:46 [PATCH 00/33] Input: Automated coccinelle cleanup Guenter Roeck
                   ` (3 preceding siblings ...)
  2017-01-18 17:46 ` [PATCH 04/33] Input: cros_ec_keyb - Drop unnecessary call to dev_set_drvdata " Guenter Roeck
@ 2017-01-18 17:46 ` Guenter Roeck
  2017-01-18 17:46 ` [PATCH 06/33] Input: samsung-keypad " Guenter Roeck
                   ` (25 subsequent siblings)
  30 siblings, 0 replies; 68+ messages in thread
From: Guenter Roeck @ 2017-01-18 17:46 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, linux-kernel, Guenter Roeck

Error messages after memory allocation failures are unnecessary and
can be dropped.

This conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts
used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches

- Drop unnecessary braces around conditional return statements
- Drop error message after devm_kzalloc() failure

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/input/keyboard/imx_keypad.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/input/keyboard/imx_keypad.c b/drivers/input/keyboard/imx_keypad.c
index 2165f3dd328b..eb273ade822f 100644
--- a/drivers/input/keyboard/imx_keypad.c
+++ b/drivers/input/keyboard/imx_keypad.c
@@ -447,10 +447,8 @@ static int imx_keypad_probe(struct platform_device *pdev)
 	}
 
 	keypad = devm_kzalloc(&pdev->dev, sizeof(*keypad), GFP_KERNEL);
-	if (!keypad) {
-		dev_err(&pdev->dev, "not enough memory for driver data\n");
+	if (!keypad)
 		return -ENOMEM;
-	}
 
 	keypad->input_dev = input_dev;
 	keypad->irq = irq;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 06/33] Input: samsung-keypad - Drop unnecessary error messages and other changes
  2017-01-18 17:46 [PATCH 00/33] Input: Automated coccinelle cleanup Guenter Roeck
                   ` (4 preceding siblings ...)
  2017-01-18 17:46 ` [PATCH 05/33] Input: imx_keypad - Drop unnecessary error messages " Guenter Roeck
@ 2017-01-18 17:46 ` Guenter Roeck
  2017-01-18 17:46 ` [PATCH 07/33] Input: sh_keysc " Guenter Roeck
                   ` (24 subsequent siblings)
  30 siblings, 0 replies; 68+ messages in thread
From: Guenter Roeck @ 2017-01-18 17:46 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, linux-kernel, Guenter Roeck

Error messages after memory allocation failures are unnecessary and
can be dropped.

This conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts
used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches

- Drop unnecessary braces around conditional return statements
- Drop error message after devm_kzalloc() failure

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/input/keyboard/samsung-keypad.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/input/keyboard/samsung-keypad.c b/drivers/input/keyboard/samsung-keypad.c
index 4e319eb9e19d..b6ea0cd3542b 100644
--- a/drivers/input/keyboard/samsung-keypad.c
+++ b/drivers/input/keyboard/samsung-keypad.c
@@ -258,10 +258,8 @@ samsung_keypad_parse_dt(struct device *dev)
 	}
 
 	pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
-	if (!pdata) {
-		dev_err(dev, "could not allocate memory for platform data\n");
+	if (!pdata)
 		return ERR_PTR(-ENOMEM);
-	}
 
 	of_property_read_u32(np, "samsung,keypad-num-rows", &num_rows);
 	of_property_read_u32(np, "samsung,keypad-num-columns", &num_cols);
@@ -273,19 +271,15 @@ samsung_keypad_parse_dt(struct device *dev)
 	pdata->cols = num_cols;
 
 	keymap_data = devm_kzalloc(dev, sizeof(*keymap_data), GFP_KERNEL);
-	if (!keymap_data) {
-		dev_err(dev, "could not allocate memory for keymap data\n");
+	if (!keymap_data)
 		return ERR_PTR(-ENOMEM);
-	}
 	pdata->keymap_data = keymap_data;
 
 	key_count = of_get_child_count(np);
 	keymap_data->keymap_size = key_count;
 	keymap = devm_kzalloc(dev, sizeof(uint32_t) * key_count, GFP_KERNEL);
-	if (!keymap) {
-		dev_err(dev, "could not allocate memory for keymap\n");
+	if (!keymap)
 		return ERR_PTR(-ENOMEM);
-	}
 	keymap_data->keymap = keymap;
 
 	for_each_child_of_node(np, key_np) {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 07/33] Input: sh_keysc - Drop unnecessary error messages and other changes
  2017-01-18 17:46 [PATCH 00/33] Input: Automated coccinelle cleanup Guenter Roeck
                   ` (5 preceding siblings ...)
  2017-01-18 17:46 ` [PATCH 06/33] Input: samsung-keypad " Guenter Roeck
@ 2017-01-18 17:46 ` Guenter Roeck
  2017-01-18 17:46 ` [PATCH 08/33] Input: spear-keyboard " Guenter Roeck
                   ` (23 subsequent siblings)
  30 siblings, 0 replies; 68+ messages in thread
From: Guenter Roeck @ 2017-01-18 17:46 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, linux-kernel, Guenter Roeck

Error messages after memory allocation failures are unnecessary and
can be dropped.

This conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts
used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches

- Drop unnecessary braces around conditional return statements
- Drop error message after devm_kzalloc() failure
- Replace 'goto l; ... l: return e;' with 'return e;'
- Replace 'val = e; return val;' with 'return e;'

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/input/keyboard/sh_keysc.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/drivers/input/keyboard/sh_keysc.c b/drivers/input/keyboard/sh_keysc.c
index 7abf03b4cc9c..63ea707df193 100644
--- a/drivers/input/keyboard/sh_keysc.c
+++ b/drivers/input/keyboard/sh_keysc.c
@@ -172,29 +172,25 @@ static int sh_keysc_probe(struct platform_device *pdev)
 
 	if (!dev_get_platdata(&pdev->dev)) {
 		dev_err(&pdev->dev, "no platform data defined\n");
-		error = -EINVAL;
-		goto err0;
+		return -EINVAL;
 	}
 
 	error = -ENXIO;
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (res == NULL) {
 		dev_err(&pdev->dev, "failed to get I/O memory\n");
-		goto err0;
+		return error;
 	}
 
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0) {
 		dev_err(&pdev->dev, "failed to get irq\n");
-		goto err0;
+		return error;
 	}
 
 	priv = kzalloc(sizeof(*priv), GFP_KERNEL);
-	if (priv == NULL) {
-		dev_err(&pdev->dev, "failed to allocate driver data\n");
-		error = -ENOMEM;
-		goto err0;
-	}
+	if (priv == NULL)
+		return -ENOMEM;
 
 	platform_set_drvdata(pdev, priv);
 	memcpy(&priv->pdata, dev_get_platdata(&pdev->dev), sizeof(priv->pdata));
@@ -266,7 +262,6 @@ static int sh_keysc_probe(struct platform_device *pdev)
 	iounmap(priv->iomem_base);
  err1:
 	kfree(priv);
- err0:
 	return error;
 }
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 08/33] Input: spear-keyboard - Drop unnecessary error messages and other changes
  2017-01-18 17:46 [PATCH 00/33] Input: Automated coccinelle cleanup Guenter Roeck
                   ` (6 preceding siblings ...)
  2017-01-18 17:46 ` [PATCH 07/33] Input: sh_keysc " Guenter Roeck
@ 2017-01-18 17:46 ` Guenter Roeck
  2017-01-19  3:56   ` Viresh Kumar
  2017-01-18 17:46   ` Guenter Roeck
                   ` (22 subsequent siblings)
  30 siblings, 1 reply; 68+ messages in thread
From: Guenter Roeck @ 2017-01-18 17:46 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, linux-kernel, Guenter Roeck, Arnd Bergmann

Error messages after memory allocation failures are unnecessary and
can be dropped.

This conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts
used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches

- Drop unnecessary braces around conditional return statements
- Drop error message after devm_kzalloc() failure

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/input/keyboard/spear-keyboard.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/input/keyboard/spear-keyboard.c b/drivers/input/keyboard/spear-keyboard.c
index 8083eaa0524a..21357ee854c9 100644
--- a/drivers/input/keyboard/spear-keyboard.c
+++ b/drivers/input/keyboard/spear-keyboard.c
@@ -197,10 +197,8 @@ static int spear_kbd_probe(struct platform_device *pdev)
 	}
 
 	kbd = devm_kzalloc(&pdev->dev, sizeof(*kbd), GFP_KERNEL);
-	if (!kbd) {
-		dev_err(&pdev->dev, "not enough memory for driver data\n");
+	if (!kbd)
 		return -ENOMEM;
-	}
 
 	input_dev = devm_input_allocate_device(&pdev->dev);
 	if (!input_dev) {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 09/33] Input: sun4i-lradc-keys - Drop unnecessary call to platform_set_drvdata and other changes
  2017-01-18 17:46 [PATCH 00/33] Input: Automated coccinelle cleanup Guenter Roeck
@ 2017-01-18 17:46   ` Guenter Roeck
  2017-01-18 17:46 ` [PATCH 02/33] Input: bcm-keypad - Drop unnecessary call to platform_set_drvdata " Guenter Roeck
                     ` (29 subsequent siblings)
  30 siblings, 0 replies; 68+ messages in thread
From: Guenter Roeck @ 2017-01-18 17:46 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: linux-input, linux-kernel, Guenter Roeck, Chen-Yu Tsai,
	Hans de Goede, linux-arm-kernel, Maxime Ripard

There is no call to platform_get_drvdata() or dev_get_drvdata().
Drop the unnecessary call to platform_set_drvdata().
Other relevant changes:
  Simplify error return

This conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts
used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches

- Replace 'if (e) return e; return 0;' with 'return e;'
- Drop platform_set_drvdata()

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/input/keyboard/sun4i-lradc-keys.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/input/keyboard/sun4i-lradc-keys.c b/drivers/input/keyboard/sun4i-lradc-keys.c
index cc8f7ddcee53..c153d956778c 100644
--- a/drivers/input/keyboard/sun4i-lradc-keys.c
+++ b/drivers/input/keyboard/sun4i-lradc-keys.c
@@ -257,12 +257,7 @@ static int sun4i_lradc_probe(struct platform_device *pdev)
 	if (error)
 		return error;
 
-	error = input_register_device(lradc->input);
-	if (error)
-		return error;
-
-	platform_set_drvdata(pdev, lradc);
-	return 0;
+	return input_register_device(lradc->input);
 }
 
 static const struct of_device_id sun4i_lradc_of_match[] = {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 09/33] Input: sun4i-lradc-keys - Drop unnecessary call to platform_set_drvdata and other changes
@ 2017-01-18 17:46   ` Guenter Roeck
  0 siblings, 0 replies; 68+ messages in thread
From: Guenter Roeck @ 2017-01-18 17:46 UTC (permalink / raw)
  To: linux-arm-kernel

There is no call to platform_get_drvdata() or dev_get_drvdata().
Drop the unnecessary call to platform_set_drvdata().
Other relevant changes:
  Simplify error return

This conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts
used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches

- Replace 'if (e) return e; return 0;' with 'return e;'
- Drop platform_set_drvdata()

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/input/keyboard/sun4i-lradc-keys.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/input/keyboard/sun4i-lradc-keys.c b/drivers/input/keyboard/sun4i-lradc-keys.c
index cc8f7ddcee53..c153d956778c 100644
--- a/drivers/input/keyboard/sun4i-lradc-keys.c
+++ b/drivers/input/keyboard/sun4i-lradc-keys.c
@@ -257,12 +257,7 @@ static int sun4i_lradc_probe(struct platform_device *pdev)
 	if (error)
 		return error;
 
-	error = input_register_device(lradc->input);
-	if (error)
-		return error;
-
-	platform_set_drvdata(pdev, lradc);
-	return 0;
+	return input_register_device(lradc->input);
 }
 
 static const struct of_device_id sun4i_lradc_of_match[] = {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 10/33] Input: twl4030_keypad - Drop unnecessary call to platform_set_drvdata and other changes
  2017-01-18 17:46 [PATCH 00/33] Input: Automated coccinelle cleanup Guenter Roeck
                   ` (8 preceding siblings ...)
  2017-01-18 17:46   ` Guenter Roeck
@ 2017-01-18 17:46 ` Guenter Roeck
  2017-01-18 19:45   ` Dmitry Torokhov
  2017-01-18 17:46 ` [PATCH 11/33] Input: ab8500-ponkey " Guenter Roeck
                   ` (20 subsequent siblings)
  30 siblings, 1 reply; 68+ messages in thread
From: Guenter Roeck @ 2017-01-18 17:46 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, linux-kernel, Guenter Roeck, Rui Teng

There is no call to platform_get_drvdata() or dev_get_drvdata().
Drop the unnecessary call to platform_set_drvdata().

This conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts
used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches

- Drop platform_set_drvdata()

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/input/keyboard/twl4030_keypad.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/input/keyboard/twl4030_keypad.c b/drivers/input/keyboard/twl4030_keypad.c
index 323a0fb575a4..29396ca69416 100644
--- a/drivers/input/keyboard/twl4030_keypad.c
+++ b/drivers/input/keyboard/twl4030_keypad.c
@@ -441,7 +441,6 @@ static int twl4030_kp_probe(struct platform_device *pdev)
 		return -EIO;
 	}
 
-	platform_set_drvdata(pdev, kp);
 	return 0;
 }
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 11/33] Input: ab8500-ponkey - Drop unnecessary call to platform_set_drvdata and other changes
  2017-01-18 17:46 [PATCH 00/33] Input: Automated coccinelle cleanup Guenter Roeck
                   ` (9 preceding siblings ...)
  2017-01-18 17:46 ` [PATCH 10/33] Input: twl4030_keypad " Guenter Roeck
@ 2017-01-18 17:46 ` Guenter Roeck
  2017-01-18 19:45   ` Dmitry Torokhov
  2017-01-18 17:46 ` [PATCH 12/33] Input: axp20x-pek - Use devm_add_action_or_reset " Guenter Roeck
                   ` (19 subsequent siblings)
  30 siblings, 1 reply; 68+ messages in thread
From: Guenter Roeck @ 2017-01-18 17:46 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, linux-kernel, Guenter Roeck

There is no call to platform_get_drvdata() or dev_get_drvdata().
Drop the unnecessary call to platform_set_drvdata().

This conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts
used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches

- Drop platform_set_drvdata()

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/input/misc/ab8500-ponkey.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/input/misc/ab8500-ponkey.c b/drivers/input/misc/ab8500-ponkey.c
index 4f5ef5bb535b..a33ed5710b15 100644
--- a/drivers/input/misc/ab8500-ponkey.c
+++ b/drivers/input/misc/ab8500-ponkey.c
@@ -109,7 +109,6 @@ static int ab8500_ponkey_probe(struct platform_device *pdev)
 		return error;
 	}
 
-	platform_set_drvdata(pdev, ponkey);
 	return 0;
 }
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 12/33] Input: axp20x-pek - Use devm_add_action_or_reset and other changes
  2017-01-18 17:46 [PATCH 00/33] Input: Automated coccinelle cleanup Guenter Roeck
                   ` (10 preceding siblings ...)
  2017-01-18 17:46 ` [PATCH 11/33] Input: ab8500-ponkey " Guenter Roeck
@ 2017-01-18 17:46 ` Guenter Roeck
  2017-02-02  7:43   ` Chen-Yu Tsai
  2017-01-18 17:46 ` [PATCH 13/33] Input: bfin_rotary - Use 'dev' instead of dereferencing it " Guenter Roeck
                   ` (18 subsequent siblings)
  30 siblings, 1 reply; 68+ messages in thread
From: Guenter Roeck @ 2017-01-18 17:46 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, linux-kernel, Guenter Roeck, Chen-Yu Tsai

Replace devm_add_action() followed by failure action with
devm_add_action_or_reset()

This conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts
used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches

- Replace devm_add_action() followed by failure action with
  devm_add_action_or_reset()

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/input/misc/axp20x-pek.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/input/misc/axp20x-pek.c b/drivers/input/misc/axp20x-pek.c
index 1ac898db303a..419ca97b051b 100644
--- a/drivers/input/misc/axp20x-pek.c
+++ b/drivers/input/misc/axp20x-pek.c
@@ -260,10 +260,10 @@ static int axp20x_pek_probe(struct platform_device *pdev)
 		return error;
 	}
 
-	error = devm_add_action(&pdev->dev,
-				axp20x_remove_sysfs_group, &pdev->dev);
+	error = devm_add_action_or_reset(&pdev->dev,
+					 axp20x_remove_sysfs_group,
+					 &pdev->dev);
 	if (error) {
-		axp20x_remove_sysfs_group(&pdev->dev);
 		dev_err(&pdev->dev, "Failed to add sysfs cleanup action: %d\n",
 			error);
 		return error;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 13/33] Input: bfin_rotary - Use 'dev' instead of dereferencing it and other changes
  2017-01-18 17:46 [PATCH 00/33] Input: Automated coccinelle cleanup Guenter Roeck
                   ` (11 preceding siblings ...)
  2017-01-18 17:46 ` [PATCH 12/33] Input: axp20x-pek - Use devm_add_action_or_reset " Guenter Roeck
@ 2017-01-18 17:46 ` Guenter Roeck
  2017-01-18 19:39   ` Dmitry Torokhov
  2017-01-18 17:46 ` [PATCH 14/33] Input: gpio_decoder - Drop unnecessary call to platform_set_drvdata " Guenter Roeck
                   ` (17 subsequent siblings)
  30 siblings, 1 reply; 68+ messages in thread
From: Guenter Roeck @ 2017-01-18 17:46 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, linux-kernel, Guenter Roeck

Use local variable 'dev' instead of dereferencing it several times.
Other relevant changes:
  Replace devm_add_action() with devm_add_action_or_reset()

This conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts
used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches

- Replace devm_add_action() followed by failure action with
  devm_add_action_or_reset()
- Drop unnecessary braces around conditional return statements
- Use local variable 'struct device *dev' consistently

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/input/misc/bfin_rotary.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/drivers/input/misc/bfin_rotary.c b/drivers/input/misc/bfin_rotary.c
index a0fc18fdfc0c..9f5790c6e06b 100644
--- a/drivers/input/misc/bfin_rotary.c
+++ b/drivers/input/misc/bfin_rotary.c
@@ -141,25 +141,23 @@ static int bfin_rotary_probe(struct platform_device *pdev)
 
 	/* Basic validation */
 	if ((pdata->rotary_up_key && !pdata->rotary_down_key) ||
-	    (!pdata->rotary_up_key && pdata->rotary_down_key)) {
+	    (!pdata->rotary_up_key && pdata->rotary_down_key))
 		return -EINVAL;
-	}
 
 	if (pdata->pin_list) {
 		error = peripheral_request_list(pdata->pin_list,
-						dev_name(&pdev->dev));
+						dev_name(dev));
 		if (error) {
 			dev_err(dev, "requesting peripherals failed: %d\n",
 				error);
 			return error;
 		}
 
-		error = devm_add_action(dev, bfin_rotary_free_action,
-					pdata->pin_list);
+		error = devm_add_action_or_reset(dev, bfin_rotary_free_action,
+						 pdata->pin_list);
 		if (error) {
 			dev_err(dev, "setting cleanup action failed: %d\n",
 				error);
-			peripheral_free_list(pdata->pin_list);
 			return error;
 		}
 	}
@@ -189,7 +187,7 @@ static int bfin_rotary_probe(struct platform_device *pdev)
 
 	input->name = pdev->name;
 	input->phys = "bfin-rotary/input0";
-	input->dev.parent = &pdev->dev;
+	input->dev.parent = dev;
 
 	input_set_drvdata(input, rotary);
 
@@ -224,8 +222,8 @@ static int bfin_rotary_probe(struct platform_device *pdev)
 		return -ENOENT;
 	}
 
-	error = devm_request_irq(dev, rotary->irq, bfin_rotary_isr,
-				 0, dev_name(dev), rotary);
+	error = devm_request_irq(dev, rotary->irq, bfin_rotary_isr, 0,
+				 dev_name(dev), rotary);
 	if (error) {
 		dev_err(dev, "unable to claim irq %d; error %d\n",
 			rotary->irq, error);
@@ -239,7 +237,7 @@ static int bfin_rotary_probe(struct platform_device *pdev)
 	}
 
 	platform_set_drvdata(pdev, rotary);
-	device_init_wakeup(&pdev->dev, 1);
+	device_init_wakeup(dev, 1);
 
 	return 0;
 }
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 14/33] Input: gpio_decoder - Drop unnecessary call to platform_set_drvdata and other changes
  2017-01-18 17:46 [PATCH 00/33] Input: Automated coccinelle cleanup Guenter Roeck
                   ` (12 preceding siblings ...)
  2017-01-18 17:46 ` [PATCH 13/33] Input: bfin_rotary - Use 'dev' instead of dereferencing it " Guenter Roeck
@ 2017-01-18 17:46 ` Guenter Roeck
  2017-01-18 19:40   ` Dmitry Torokhov
  2017-01-18 17:46 ` [PATCH 15/33] Input: kxtj9 - Drop unnecessary error messages " Guenter Roeck
                   ` (16 subsequent siblings)
  30 siblings, 1 reply; 68+ messages in thread
From: Guenter Roeck @ 2017-01-18 17:46 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: linux-input, linux-kernel, Guenter Roeck, Rob Herring, Vignesh R

There is no call to platform_get_drvdata() or dev_get_drvdata().
Drop the unnecessary call to platform_set_drvdata().

This conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts
used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches

- Drop platform_set_drvdata()

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/input/misc/gpio_decoder.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/input/misc/gpio_decoder.c b/drivers/input/misc/gpio_decoder.c
index ca7e0bacb2d8..1dca526e6f1a 100644
--- a/drivers/input/misc/gpio_decoder.c
+++ b/drivers/input/misc/gpio_decoder.c
@@ -110,7 +110,6 @@ static int gpio_decoder_probe(struct platform_device *pdev)
 		dev_err(dev, "failed to register polled  device\n");
 		return err;
 	}
-	platform_set_drvdata(pdev, decoder);
 
 	return 0;
 }
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 15/33] Input: kxtj9 - Drop unnecessary error messages and other changes
  2017-01-18 17:46 [PATCH 00/33] Input: Automated coccinelle cleanup Guenter Roeck
                   ` (13 preceding siblings ...)
  2017-01-18 17:46 ` [PATCH 14/33] Input: gpio_decoder - Drop unnecessary call to platform_set_drvdata " Guenter Roeck
@ 2017-01-18 17:46 ` Guenter Roeck
  2017-01-18 17:46 ` [PATCH 16/33] Input: mma8450 - Drop unnecessary call to i2c_set_clientdata " Guenter Roeck
                   ` (15 subsequent siblings)
  30 siblings, 0 replies; 68+ messages in thread
From: Guenter Roeck @ 2017-01-18 17:46 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, linux-kernel, Guenter Roeck

Error messages after memory allocation failures are unnecessary and
can be dropped.
Other relevant changes:
  Simplify error return

This conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts
used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches

- Drop unnecessary braces around conditional return statements
- Drop error message after devm_kzalloc() failure
- Replace 'if (e) return e; return 0;' with 'return e;'

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/input/misc/kxtj9.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/input/misc/kxtj9.c b/drivers/input/misc/kxtj9.c
index efaffcc57e36..1c96e30834fc 100644
--- a/drivers/input/misc/kxtj9.c
+++ b/drivers/input/misc/kxtj9.c
@@ -196,11 +196,8 @@ static int kxtj9_update_odr(struct kxtj9_data *tj9, unsigned int poll_interval)
 	if (err < 0)
 		return err;
 
-	err = i2c_smbus_write_byte_data(tj9->client, CTRL_REG1, tj9->ctrl_reg1);
-	if (err < 0)
-		return err;
-
-	return 0;
+	return i2c_smbus_write_byte_data(tj9->client, CTRL_REG1,
+					 tj9->ctrl_reg1);
 }
 
 static int kxtj9_device_power_on(struct kxtj9_data *tj9)
@@ -526,11 +523,8 @@ static int kxtj9_probe(struct i2c_client *client,
 	}
 
 	tj9 = kzalloc(sizeof(*tj9), GFP_KERNEL);
-	if (!tj9) {
-		dev_err(&client->dev,
-			"failed to allocate memory for module data\n");
+	if (!tj9)
 		return -ENOMEM;
-	}
 
 	tj9->client = client;
 	tj9->pdata = *pdata;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 16/33] Input: mma8450 - Drop unnecessary call to i2c_set_clientdata and other changes
  2017-01-18 17:46 [PATCH 00/33] Input: Automated coccinelle cleanup Guenter Roeck
                   ` (14 preceding siblings ...)
  2017-01-18 17:46 ` [PATCH 15/33] Input: kxtj9 - Drop unnecessary error messages " Guenter Roeck
@ 2017-01-18 17:46 ` Guenter Roeck
  2017-01-18 19:41   ` Dmitry Torokhov
  2017-01-18 17:46 ` [PATCH 17/33] Input: retu-pwrbutton - Simplify error return " Guenter Roeck
                   ` (14 subsequent siblings)
  30 siblings, 1 reply; 68+ messages in thread
From: Guenter Roeck @ 2017-01-18 17:46 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, linux-kernel, Guenter Roeck

There is no call to i2c_get_clientdata() or dev_get_drvdata().
Drop the unnecessary call to i2c_set_clientdata().

This conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts
used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches

- Drop i2c_set_clientdata()

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/input/misc/mma8450.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/input/misc/mma8450.c b/drivers/input/misc/mma8450.c
index 19c73574458e..b60cdea73826 100644
--- a/drivers/input/misc/mma8450.c
+++ b/drivers/input/misc/mma8450.c
@@ -205,8 +205,6 @@ static int mma8450_probe(struct i2c_client *c,
 		return err;
 	}
 
-	i2c_set_clientdata(c, m);
-
 	return 0;
 }
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 17/33] Input: retu-pwrbutton - Simplify error return and other changes
  2017-01-18 17:46 [PATCH 00/33] Input: Automated coccinelle cleanup Guenter Roeck
                   ` (15 preceding siblings ...)
  2017-01-18 17:46 ` [PATCH 16/33] Input: mma8450 - Drop unnecessary call to i2c_set_clientdata " Guenter Roeck
@ 2017-01-18 17:46 ` Guenter Roeck
  2017-01-18 17:46 ` [PATCH 18/33] Input: soc_button_array - Use 'dev' instead of dereferencing it " Guenter Roeck
                   ` (13 subsequent siblings)
  30 siblings, 0 replies; 68+ messages in thread
From: Guenter Roeck @ 2017-01-18 17:46 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, linux-kernel, Guenter Roeck

Simplify error return if the code returns anyway.
Other relevant changes:
  Drop empty remove function

This conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts
used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches

- Drop empty remove function
- Replace 'if (e) return e; return 0;' with 'return e;'

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/input/misc/retu-pwrbutton.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/drivers/input/misc/retu-pwrbutton.c b/drivers/input/misc/retu-pwrbutton.c
index 30b459b6b344..97d39a965a65 100644
--- a/drivers/input/misc/retu-pwrbutton.c
+++ b/drivers/input/misc/retu-pwrbutton.c
@@ -69,21 +69,11 @@ static int retu_pwrbutton_probe(struct platform_device *pdev)
 	if (error)
 		return error;
 
-	error = input_register_device(idev);
-	if (error)
-		return error;
-
-	return 0;
-}
-
-static int retu_pwrbutton_remove(struct platform_device *pdev)
-{
-	return 0;
+	return input_register_device(idev);
 }
 
 static struct platform_driver retu_pwrbutton_driver = {
 	.probe		= retu_pwrbutton_probe,
-	.remove		= retu_pwrbutton_remove,
 	.driver		= {
 		.name	= "retu-pwrbutton",
 	},
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 18/33] Input: soc_button_array - Use 'dev' instead of dereferencing it and other changes
  2017-01-18 17:46 [PATCH 00/33] Input: Automated coccinelle cleanup Guenter Roeck
                   ` (16 preceding siblings ...)
  2017-01-18 17:46 ` [PATCH 17/33] Input: retu-pwrbutton - Simplify error return " Guenter Roeck
@ 2017-01-18 17:46 ` Guenter Roeck
  2017-01-18 19:42   ` Dmitry Torokhov
  2017-01-18 17:46 ` [PATCH 19/33] Input: tps65218-pwrbutton - Drop unnecessary call to platform_set_drvdata " Guenter Roeck
                   ` (12 subsequent siblings)
  30 siblings, 1 reply; 68+ messages in thread
From: Guenter Roeck @ 2017-01-18 17:46 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: linux-input, linux-kernel, Guenter Roeck, Benjamin Tissoires

Use local variable 'dev' instead of dereferencing it several times.

This conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts
used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches

- Use local variable 'struct device *dev' consistently

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/input/misc/soc_button_array.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/input/misc/soc_button_array.c b/drivers/input/misc/soc_button_array.c
index 908b51089dee..fb3219a8d3c0 100644
--- a/drivers/input/misc/soc_button_array.c
+++ b/drivers/input/misc/soc_button_array.c
@@ -167,12 +167,12 @@ static int soc_button_probe(struct platform_device *pdev)
 
 	button_info = (struct soc_button_info *)id->driver_data;
 
-	if (gpiod_count(&pdev->dev, KBUILD_MODNAME) <= 0) {
-		dev_dbg(&pdev->dev, "no GPIO attached, ignoring...\n");
+	if (gpiod_count(dev, KBUILD_MODNAME) <= 0) {
+		dev_dbg(dev, "no GPIO attached, ignoring...\n");
 		return -ENODEV;
 	}
 
-	priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
+	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
 	if (!priv)
 		return -ENOMEM;
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 19/33] Input: tps65218-pwrbutton - Drop unnecessary call to platform_set_drvdata and other changes
  2017-01-18 17:46 [PATCH 00/33] Input: Automated coccinelle cleanup Guenter Roeck
                   ` (17 preceding siblings ...)
  2017-01-18 17:46 ` [PATCH 18/33] Input: soc_button_array - Use 'dev' instead of dereferencing it " Guenter Roeck
@ 2017-01-18 17:46 ` Guenter Roeck
  2017-01-18 19:44   ` Dmitry Torokhov
  2017-01-18 17:46 ` [PATCH 20/33] Input: elan_i2c_core - Use 'dev' instead of dereferencing it " Guenter Roeck
                   ` (11 subsequent siblings)
  30 siblings, 1 reply; 68+ messages in thread
From: Guenter Roeck @ 2017-01-18 17:46 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: linux-input, linux-kernel, Guenter Roeck, Keerthy, Lee Jones,
	Marcin Niestroj

There is no call to platform_get_drvdata() or dev_get_drvdata().
Drop the unnecessary call to platform_set_drvdata().
Other relevant changes:
  Use existing variable 'dev' instead of dereferencing it several times

This conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts
used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches

- Replace 'goto l; ... l: return e;' with 'return e;'
- Drop platform_set_drvdata()
- Use local variable 'struct device *dev' consistently

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/input/misc/tps65218-pwrbutton.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/input/misc/tps65218-pwrbutton.c b/drivers/input/misc/tps65218-pwrbutton.c
index cc74a41bdb0d..33f48a622fc6 100644
--- a/drivers/input/misc/tps65218-pwrbutton.c
+++ b/drivers/input/misc/tps65218-pwrbutton.c
@@ -70,7 +70,7 @@ static irqreturn_t tps6521x_pb_irq(int irq, void *_pwr)
 	error = regmap_read(pwr->regmap, tps_data->reg_status, &reg);
 	if (error) {
 		dev_err(pwr->dev, "can't read register: %d\n", error);
-		goto out;
+		return IRQ_HANDLED;
 	}
 
 	if (reg & tps_data->pb_mask) {
@@ -82,7 +82,6 @@ static irqreturn_t tps6521x_pb_irq(int irq, void *_pwr)
 
 	input_sync(pwr->idev);
 
-out:
 	return IRQ_HANDLED;
 }
 
@@ -95,7 +94,7 @@ static int tps6521x_pb_probe(struct platform_device *pdev)
 	int error;
 	int irq;
 
-	match = of_match_node(of_tps6521x_pb_match, pdev->dev.of_node);
+	match = of_match_node(of_tps6521x_pb_match, dev->of_node);
 	if (!match)
 		return -ENXIO;
 
@@ -118,10 +117,9 @@ static int tps6521x_pb_probe(struct platform_device *pdev)
 
 	input_set_capability(idev, EV_KEY, KEY_POWER);
 
-	pwr->regmap = dev_get_regmap(pdev->dev.parent, NULL);
+	pwr->regmap = dev_get_regmap(dev->parent, NULL);
 	pwr->dev = dev;
 	pwr->idev = idev;
-	platform_set_drvdata(pdev, pwr);
 	device_init_wakeup(dev, true);
 
 	irq = platform_get_irq(pdev, 0);
@@ -136,8 +134,7 @@ static int tps6521x_pb_probe(struct platform_device *pdev)
 						IRQF_ONESHOT,
 					  pwr->data->name, pwr);
 	if (error) {
-		dev_err(dev, "failed to request IRQ #%d: %d\n",
-			irq, error);
+		dev_err(dev, "failed to request IRQ #%d: %d\n", irq, error);
 		return error;
 	}
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 20/33] Input: elan_i2c_core - Use 'dev' instead of dereferencing it and other changes
  2017-01-18 17:46 [PATCH 00/33] Input: Automated coccinelle cleanup Guenter Roeck
                   ` (18 preceding siblings ...)
  2017-01-18 17:46 ` [PATCH 19/33] Input: tps65218-pwrbutton - Drop unnecessary call to platform_set_drvdata " Guenter Roeck
@ 2017-01-18 17:46 ` Guenter Roeck
  2017-01-18 17:46 ` [PATCH 21/33] Input: arc_ps2 - Drop unnecessary error messages " Guenter Roeck
                   ` (10 subsequent siblings)
  30 siblings, 0 replies; 68+ messages in thread
From: Guenter Roeck @ 2017-01-18 17:46 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: linux-input, linux-kernel, Guenter Roeck, Benjamin Tissoires, KT Liao

Use local variable 'dev' instead of dereferencing it several times.
Other relevant changes:
  Simplify error return
  Replace devm_add_action() with devm_add_action_or_reset()

This conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts
used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches

- Replace devm_add_action() followed by failure action with
  devm_add_action_or_reset()
- Replace 'goto l; ... l: return e;' with 'return e;'
- Replace 'if (e) return e; return 0;' with 'return e;'
- Use local variable 'struct device *dev' consistently

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/input/mouse/elan_i2c_core.c | 59 +++++++++++++------------------------
 1 file changed, 21 insertions(+), 38 deletions(-)

diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c
index fa598f7f4372..806f304e6356 100644
--- a/drivers/input/mouse/elan_i2c_core.c
+++ b/drivers/input/mouse/elan_i2c_core.c
@@ -210,10 +210,7 @@ static int elan_query_product(struct elan_tp_data *data)
 
 	error = data->ops->get_sm_version(data->client, &data->ic_type,
 					  &data->sm_version);
-	if (error)
-		return error;
-
-	return 0;
+	return error;
 }
 
 static int elan_check_ASUS_special_fw(struct elan_tp_data *data)
@@ -926,12 +923,12 @@ static irqreturn_t elan_isr(int irq, void *dev_id)
 	*/
 	if (data->in_fw_update) {
 		complete(&data->fw_completion);
-		goto out;
+		return IRQ_HANDLED;
 	}
 
 	error = data->ops->get_report(data->client, report);
 	if (error)
-		goto out;
+		return IRQ_HANDLED;
 
 	if (report[ETP_REPORT_ID_OFFSET] != ETP_REPORT_ID)
 		dev_err(dev, "invalid report id data (%x)\n",
@@ -939,7 +936,6 @@ static irqreturn_t elan_isr(int irq, void *dev_id)
 	else
 		elan_report_absolute(data, report);
 
-out:
 	return IRQ_HANDLED;
 }
 
@@ -1041,8 +1037,7 @@ static int elan_probe(struct i2c_client *client,
 		return -EIO;
 	}
 
-	data = devm_kzalloc(&client->dev, sizeof(struct elan_tp_data),
-			    GFP_KERNEL);
+	data = devm_kzalloc(dev, sizeof(struct elan_tp_data), GFP_KERNEL);
 	if (!data)
 		return -ENOMEM;
 
@@ -1053,29 +1048,24 @@ static int elan_probe(struct i2c_client *client,
 	init_completion(&data->fw_completion);
 	mutex_init(&data->sysfs_mutex);
 
-	data->vcc = devm_regulator_get(&client->dev, "vcc");
+	data->vcc = devm_regulator_get(dev, "vcc");
 	if (IS_ERR(data->vcc)) {
 		error = PTR_ERR(data->vcc);
 		if (error != -EPROBE_DEFER)
-			dev_err(&client->dev,
-				"Failed to get 'vcc' regulator: %d\n",
+			dev_err(dev, "Failed to get 'vcc' regulator: %d\n",
 				error);
 		return error;
 	}
 
 	error = regulator_enable(data->vcc);
 	if (error) {
-		dev_err(&client->dev,
-			"Failed to enable regulator: %d\n", error);
+		dev_err(dev, "Failed to enable regulator: %d\n", error);
 		return error;
 	}
 
-	error = devm_add_action(&client->dev,
-				elan_disable_regulator, data);
+	error = devm_add_action_or_reset(dev, elan_disable_regulator, data);
 	if (error) {
-		regulator_disable(data->vcc);
-		dev_err(&client->dev,
-			"Failed to add disable regulator action: %d\n",
+		dev_err(dev, "Failed to add disable regulator action: %d\n",
 			error);
 		return error;
 	}
@@ -1093,15 +1083,14 @@ static int elan_probe(struct i2c_client *client,
 	if (error)
 		return error;
 
-	dev_info(&client->dev,
+	dev_info(dev,
 		 "Elan Touchpad: Module ID: 0x%04x, Firmware: 0x%04x, Sample: 0x%04x, IAP: 0x%04x\n",
 		 data->product_id,
 		 data->fw_version,
 		 data->sm_version,
 		 data->iap_version);
 
-	dev_dbg(&client->dev,
-		"Elan Touchpad Extra Information:\n"
+	dev_dbg(dev, "Elan Touchpad Extra Information:\n"
 		"    Max ABS X,Y:   %d,%d\n"
 		"    Width X,Y:   %d,%d\n"
 		"    Resolution X,Y:   %d,%d (dots/mm)\n",
@@ -1118,38 +1107,32 @@ static int elan_probe(struct i2c_client *client,
 	 * Systems using device tree should set up interrupt via DTS,
 	 * the rest will use the default falling edge interrupts.
 	 */
-	irqflags = client->dev.of_node ? 0 : IRQF_TRIGGER_FALLING;
+	irqflags = dev->of_node ? 0 : IRQF_TRIGGER_FALLING;
 
-	error = devm_request_threaded_irq(&client->dev, client->irq,
-					  NULL, elan_isr,
+	error = devm_request_threaded_irq(dev, client->irq, NULL, elan_isr,
 					  irqflags | IRQF_ONESHOT,
 					  client->name, data);
 	if (error) {
-		dev_err(&client->dev, "cannot register irq=%d\n", client->irq);
+		dev_err(dev, "cannot register irq=%d\n", client->irq);
 		return error;
 	}
 
-	error = sysfs_create_groups(&client->dev.kobj, elan_sysfs_groups);
+	error = sysfs_create_groups(&dev->kobj, elan_sysfs_groups);
 	if (error) {
-		dev_err(&client->dev, "failed to create sysfs attributes: %d\n",
-			error);
+		dev_err(dev, "failed to create sysfs attributes: %d\n", error);
 		return error;
 	}
 
-	error = devm_add_action(&client->dev,
-				elan_remove_sysfs_groups, data);
+	error = devm_add_action_or_reset(dev, elan_remove_sysfs_groups, data);
 	if (error) {
-		elan_remove_sysfs_groups(data);
-		dev_err(&client->dev,
-			"Failed to add sysfs cleanup action: %d\n",
+		dev_err(dev, "Failed to add sysfs cleanup action: %d\n",
 			error);
 		return error;
 	}
 
 	error = input_register_device(data->input);
 	if (error) {
-		dev_err(&client->dev, "failed to register input device: %d\n",
-			error);
+		dev_err(dev, "failed to register input device: %d\n", error);
 		return error;
 	}
 
@@ -1157,8 +1140,8 @@ static int elan_probe(struct i2c_client *client,
 	 * Systems using device tree should set up wakeup via DTS,
 	 * the rest will configure device as wakeup source by default.
 	 */
-	if (!client->dev.of_node)
-		device_init_wakeup(&client->dev, true);
+	if (!dev->of_node)
+		device_init_wakeup(dev, true);
 
 	return 0;
 }
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 21/33] Input: arc_ps2 - Drop unnecessary error messages and other changes
  2017-01-18 17:46 [PATCH 00/33] Input: Automated coccinelle cleanup Guenter Roeck
                   ` (19 preceding siblings ...)
  2017-01-18 17:46 ` [PATCH 20/33] Input: elan_i2c_core - Use 'dev' instead of dereferencing it " Guenter Roeck
@ 2017-01-18 17:46 ` Guenter Roeck
  2017-01-18 17:46 ` [PATCH 22/33] Input: at32psif " Guenter Roeck
                   ` (9 subsequent siblings)
  30 siblings, 0 replies; 68+ messages in thread
From: Guenter Roeck @ 2017-01-18 17:46 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, linux-kernel, Guenter Roeck

Error messages after memory allocation failures are unnecessary and
can be dropped.

This conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts
used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches

- Drop unnecessary braces around conditional return statements
- Drop error message after devm_kzalloc() failure

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/input/serio/arc_ps2.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/input/serio/arc_ps2.c b/drivers/input/serio/arc_ps2.c
index 99e57a418753..9860b1c1e67a 100644
--- a/drivers/input/serio/arc_ps2.c
+++ b/drivers/input/serio/arc_ps2.c
@@ -197,10 +197,8 @@ static int arc_ps2_probe(struct platform_device *pdev)
 
 	arc_ps2 = devm_kzalloc(&pdev->dev, sizeof(struct arc_ps2_data),
 				GFP_KERNEL);
-	if (!arc_ps2) {
-		dev_err(&pdev->dev, "out of memory\n");
+	if (!arc_ps2)
 		return -ENOMEM;
-	}
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	arc_ps2->addr = devm_ioremap_resource(&pdev->dev, res);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 22/33] Input: at32psif - Drop unnecessary error messages and other changes
  2017-01-18 17:46 [PATCH 00/33] Input: Automated coccinelle cleanup Guenter Roeck
                   ` (20 preceding siblings ...)
  2017-01-18 17:46 ` [PATCH 21/33] Input: arc_ps2 - Drop unnecessary error messages " Guenter Roeck
@ 2017-01-18 17:46 ` Guenter Roeck
  2017-01-18 19:13   ` Dmitry Torokhov
  2017-01-18 17:46   ` Guenter Roeck
                   ` (8 subsequent siblings)
  30 siblings, 1 reply; 68+ messages in thread
From: Guenter Roeck @ 2017-01-18 17:46 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, linux-kernel, Guenter Roeck

Error messages after memory allocation failures are unnecessary and
can be dropped.

This conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts
used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches

- Drop unnecessary braces around conditional return statements
- Drop error message after devm_kzalloc() failure
- Replace 'goto l; ... l: return e;' with 'return e;'
- Replace 'val = e; return val;' with 'return e;'

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/input/serio/at32psif.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/input/serio/at32psif.c b/drivers/input/serio/at32psif.c
index 2e4ff5bac754..e420fd781d44 100644
--- a/drivers/input/serio/at32psif.c
+++ b/drivers/input/serio/at32psif.c
@@ -159,13 +159,12 @@ static int psif_open(struct serio *io)
 
 	retval = clk_enable(psif->pclk);
 	if (retval)
-		goto out;
+		return retval;
 
 	psif_writel(psif, CR, PSIF_BIT(CR_TXEN) | PSIF_BIT(CR_RXEN));
 	psif_writel(psif, IER, PSIF_BIT(RXRDY));
 
 	psif->open = true;
-out:
 	return retval;
 }
 
@@ -210,16 +209,12 @@ static int __init psif_probe(struct platform_device *pdev)
 	int ret;
 
 	psif = kzalloc(sizeof(struct psif), GFP_KERNEL);
-	if (!psif) {
-		dev_dbg(&pdev->dev, "out of memory\n");
-		ret = -ENOMEM;
-		goto out;
-	}
+	if (!psif)
+		return -ENOMEM;
 	psif->pdev = pdev;
 
 	io = kzalloc(sizeof(struct serio), GFP_KERNEL);
 	if (!io) {
-		dev_dbg(&pdev->dev, "out of memory\n");
 		ret = -ENOMEM;
 		goto out_free_psif;
 	}
@@ -297,7 +292,6 @@ static int __init psif_probe(struct platform_device *pdev)
 	kfree(io);
 out_free_psif:
 	kfree(psif);
-out:
 	return ret;
 }
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 23/33] Input: xilinx_ps2 - Use 'dev' instead of dereferencing it and other changes
  2017-01-18 17:46 [PATCH 00/33] Input: Automated coccinelle cleanup Guenter Roeck
  2017-01-18 17:46 ` [PATCH 01/33] Input: adp5520-keys - Drop unnecessary error messages and other changes Guenter Roeck
@ 2017-01-18 17:46   ` Guenter Roeck
  2017-01-18 17:46 ` [PATCH 03/33] Input: cap11xx - Drop unnecessary call to i2c_set_clientdata " Guenter Roeck
                     ` (28 subsequent siblings)
  30 siblings, 0 replies; 68+ messages in thread
From: Guenter Roeck @ 2017-01-18 17:46 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: linux-input, linux-kernel, Guenter Roeck, linux-arm-kernel,
	Michal Simek, Sören Brinkmann

Use local variable 'dev' instead of dereferencing it several times.

This conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts
used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches

- Use local variable 'struct device *dev' consistently

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/input/serio/xilinx_ps2.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/input/serio/xilinx_ps2.c b/drivers/input/serio/xilinx_ps2.c
index 5223cbf94262..14c40892ed82 100644
--- a/drivers/input/serio/xilinx_ps2.c
+++ b/drivers/input/serio/xilinx_ps2.c
@@ -243,18 +243,17 @@ static int xps2_of_probe(struct platform_device *ofdev)
 	unsigned int irq;
 	int error;
 
-	dev_info(dev, "Device Tree Probing \'%s\'\n",
-			ofdev->dev.of_node->name);
+	dev_info(dev, "Device Tree Probing \'%s\'\n", dev->of_node->name);
 
 	/* Get iospace for the device */
-	error = of_address_to_resource(ofdev->dev.of_node, 0, &r_mem);
+	error = of_address_to_resource(dev->of_node, 0, &r_mem);
 	if (error) {
 		dev_err(dev, "invalid address\n");
 		return error;
 	}
 
 	/* Get IRQ for the device */
-	irq = irq_of_parse_and_map(ofdev->dev.of_node, 0);
+	irq = irq_of_parse_and_map(dev->of_node, 0);
 	if (!irq) {
 		dev_err(dev, "no IRQ found\n");
 		return -ENODEV;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 23/33] Input: xilinx_ps2 - Use 'dev' instead of dereferencing it and other changes
@ 2017-01-18 17:46   ` Guenter Roeck
  0 siblings, 0 replies; 68+ messages in thread
From: Guenter Roeck @ 2017-01-18 17:46 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Guenter Roeck, Michal Simek, linux-kernel, Sören Brinkmann,
	linux-input, linux-arm-kernel

Use local variable 'dev' instead of dereferencing it several times.

This conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts
used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches

- Use local variable 'struct device *dev' consistently

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/input/serio/xilinx_ps2.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/input/serio/xilinx_ps2.c b/drivers/input/serio/xilinx_ps2.c
index 5223cbf94262..14c40892ed82 100644
--- a/drivers/input/serio/xilinx_ps2.c
+++ b/drivers/input/serio/xilinx_ps2.c
@@ -243,18 +243,17 @@ static int xps2_of_probe(struct platform_device *ofdev)
 	unsigned int irq;
 	int error;
 
-	dev_info(dev, "Device Tree Probing \'%s\'\n",
-			ofdev->dev.of_node->name);
+	dev_info(dev, "Device Tree Probing \'%s\'\n", dev->of_node->name);
 
 	/* Get iospace for the device */
-	error = of_address_to_resource(ofdev->dev.of_node, 0, &r_mem);
+	error = of_address_to_resource(dev->of_node, 0, &r_mem);
 	if (error) {
 		dev_err(dev, "invalid address\n");
 		return error;
 	}
 
 	/* Get IRQ for the device */
-	irq = irq_of_parse_and_map(ofdev->dev.of_node, 0);
+	irq = irq_of_parse_and_map(dev->of_node, 0);
 	if (!irq) {
 		dev_err(dev, "no IRQ found\n");
 		return -ENODEV;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 23/33] Input: xilinx_ps2 - Use 'dev' instead of dereferencing it and other changes
@ 2017-01-18 17:46   ` Guenter Roeck
  0 siblings, 0 replies; 68+ messages in thread
From: Guenter Roeck @ 2017-01-18 17:46 UTC (permalink / raw)
  To: linux-arm-kernel

Use local variable 'dev' instead of dereferencing it several times.

This conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts
used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches

- Use local variable 'struct device *dev' consistently

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/input/serio/xilinx_ps2.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/input/serio/xilinx_ps2.c b/drivers/input/serio/xilinx_ps2.c
index 5223cbf94262..14c40892ed82 100644
--- a/drivers/input/serio/xilinx_ps2.c
+++ b/drivers/input/serio/xilinx_ps2.c
@@ -243,18 +243,17 @@ static int xps2_of_probe(struct platform_device *ofdev)
 	unsigned int irq;
 	int error;
 
-	dev_info(dev, "Device Tree Probing \'%s\'\n",
-			ofdev->dev.of_node->name);
+	dev_info(dev, "Device Tree Probing \'%s\'\n", dev->of_node->name);
 
 	/* Get iospace for the device */
-	error = of_address_to_resource(ofdev->dev.of_node, 0, &r_mem);
+	error = of_address_to_resource(dev->of_node, 0, &r_mem);
 	if (error) {
 		dev_err(dev, "invalid address\n");
 		return error;
 	}
 
 	/* Get IRQ for the device */
-	irq = irq_of_parse_and_map(ofdev->dev.of_node, 0);
+	irq = irq_of_parse_and_map(dev->of_node, 0);
 	if (!irq) {
 		dev_err(dev, "no IRQ found\n");
 		return -ENODEV;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 24/33] Input: ar1021_i2c - Drop unnecessary call to i2c_set_clientdata and other changes
  2017-01-18 17:46 [PATCH 00/33] Input: Automated coccinelle cleanup Guenter Roeck
                   ` (22 preceding siblings ...)
  2017-01-18 17:46   ` Guenter Roeck
@ 2017-01-18 17:46 ` Guenter Roeck
  2017-01-18 19:21   ` Dmitry Torokhov
  2017-01-18 17:46 ` [PATCH 25/33] Input: atmel-wm97xx - Drop unnecessary error messages " Guenter Roeck
                   ` (6 subsequent siblings)
  30 siblings, 1 reply; 68+ messages in thread
From: Guenter Roeck @ 2017-01-18 17:46 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, linux-kernel, Guenter Roeck

There is no call to i2c_get_clientdata() or dev_get_drvdata().
Drop the unnecessary call to i2c_set_clientdata().

This conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts
used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches

- Replace 'goto l; ... l: return e;' with 'return e;'
- Drop i2c_set_clientdata()

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/input/touchscreen/ar1021_i2c.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/ar1021_i2c.c b/drivers/input/touchscreen/ar1021_i2c.c
index 71b5a634cf6d..b289eca2b797 100644
--- a/drivers/input/touchscreen/ar1021_i2c.c
+++ b/drivers/input/touchscreen/ar1021_i2c.c
@@ -35,11 +35,11 @@ static irqreturn_t ar1021_i2c_irq(int irq, void *dev_id)
 	retval = i2c_master_recv(ar1021->client,
 				ar1021->data, sizeof(ar1021->data));
 	if (retval != sizeof(ar1021->data))
-		goto out;
+		return IRQ_HANDLED;
 
 	/* sync bit set ? */
 	if ((data[0] & 0x80) == 0)
-		goto out;
+		return IRQ_HANDLED;
 
 	button = data[0] & BIT(0);
 	x = ((data[2] & 0x1f) << 7) | (data[1] & 0x7f);
@@ -50,7 +50,6 @@ static irqreturn_t ar1021_i2c_irq(int irq, void *dev_id)
 	input_report_key(input, BTN_TOUCH, button);
 	input_sync(input);
 
-out:
 	return IRQ_HANDLED;
 }
 
@@ -127,7 +126,6 @@ static int ar1021_i2c_probe(struct i2c_client *client,
 		return error;
 	}
 
-	i2c_set_clientdata(client, ar1021);
 	return 0;
 }
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 25/33] Input: atmel-wm97xx - Drop unnecessary error messages and other changes
  2017-01-18 17:46 [PATCH 00/33] Input: Automated coccinelle cleanup Guenter Roeck
                   ` (23 preceding siblings ...)
  2017-01-18 17:46 ` [PATCH 24/33] Input: ar1021_i2c - Drop unnecessary call to i2c_set_clientdata " Guenter Roeck
@ 2017-01-18 17:46 ` Guenter Roeck
  2017-01-18 19:23   ` Dmitry Torokhov
  2017-01-18 17:46 ` [PATCH 26/33] Input: atmel_mxt_ts " Guenter Roeck
                   ` (5 subsequent siblings)
  30 siblings, 1 reply; 68+ messages in thread
From: Guenter Roeck @ 2017-01-18 17:46 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, linux-kernel, Guenter Roeck

Error messages after memory allocation failures are unnecessary and
can be dropped.

This conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts
used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches

- Drop unnecessary braces around conditional return statements
- Drop error message after devm_kzalloc() failure

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/input/touchscreen/atmel-wm97xx.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/input/touchscreen/atmel-wm97xx.c b/drivers/input/touchscreen/atmel-wm97xx.c
index 7ec0421c0dd8..8cf0b2be2df4 100644
--- a/drivers/input/touchscreen/atmel-wm97xx.c
+++ b/drivers/input/touchscreen/atmel-wm97xx.c
@@ -339,10 +339,8 @@ static int __init atmel_wm97xx_probe(struct platform_device *pdev)
 	int ret;
 
 	atmel_wm97xx = kzalloc(sizeof(struct atmel_wm97xx), GFP_KERNEL);
-	if (!atmel_wm97xx) {
-		dev_dbg(&pdev->dev, "out of memory\n");
+	if (!atmel_wm97xx)
 		return -ENOMEM;
-	}
 
 	atmel_wm97xx->wm	= wm;
 	atmel_wm97xx->regs	= (void *)ATMEL_WM97XX_AC97C_IOMEM;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 26/33] Input: atmel_mxt_ts - Drop unnecessary error messages and other changes
  2017-01-18 17:46 [PATCH 00/33] Input: Automated coccinelle cleanup Guenter Roeck
                   ` (24 preceding siblings ...)
  2017-01-18 17:46 ` [PATCH 25/33] Input: atmel-wm97xx - Drop unnecessary error messages " Guenter Roeck
@ 2017-01-18 17:46 ` Guenter Roeck
  2017-01-18 17:46 ` [PATCH 27/33] Input: eeti_ts " Guenter Roeck
                   ` (4 subsequent siblings)
  30 siblings, 0 replies; 68+ messages in thread
From: Guenter Roeck @ 2017-01-18 17:46 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, linux-kernel, Guenter Roeck, Nick Dyer

Error messages after memory allocation failures are unnecessary and
can be dropped.
Other relevant changes:
  Simplify error return

This conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts
used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches

- Drop unused variables
- Drop unnecessary braces around conditional return statements
- Use local structure pointers consistently
- Drop error message after devm_kzalloc() failure
- Replace 'if (e) return e; return 0;' with 'return e;'

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/input/touchscreen/atmel_mxt_ts.c | 47 +++++++-------------------------
 1 file changed, 10 insertions(+), 37 deletions(-)

diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
index e5d185fe69b9..ca027503627e 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -585,7 +585,6 @@ static int mxt_check_bootloader(struct mxt_data *data, unsigned int state,
 
 static int mxt_send_bootloader_cmd(struct mxt_data *data, bool unlock)
 {
-	int ret;
 	u8 buf[2];
 
 	if (unlock) {
@@ -596,11 +595,7 @@ static int mxt_send_bootloader_cmd(struct mxt_data *data, bool unlock)
 		buf[1] = 0x01;
 	}
 
-	ret = mxt_bootloader_write(data, buf, 2);
-	if (ret)
-		return ret;
-
-	return 0;
+	return mxt_bootloader_write(data, buf, 2);
 }
 
 static int __mxt_read_reg(struct i2c_client *client,
@@ -1167,15 +1162,9 @@ static int mxt_t6_command(struct mxt_data *data, u16 cmd_offset,
 
 static int mxt_acquire_irq(struct mxt_data *data)
 {
-	int error;
-
 	enable_irq(data->irq);
 
-	error = mxt_process_messages_until_invalid(data);
-	if (error)
-		return error;
-
-	return 0;
+	return mxt_process_messages_until_invalid(data);
 }
 
 static int mxt_soft_reset(struct mxt_data *data)
@@ -1198,12 +1187,8 @@ static int mxt_soft_reset(struct mxt_data *data)
 
 	mxt_acquire_irq(data);
 
-	ret = mxt_wait_for_completion(data, &data->reset_completion,
-				      MXT_RESET_TIMEOUT);
-	if (ret)
-		return ret;
-
-	return 0;
+	return mxt_wait_for_completion(data, &data->reset_completion,
+				       MXT_RESET_TIMEOUT);
 }
 
 static void mxt_update_crc(struct mxt_data *data, u8 cmd, u8 value)
@@ -1504,10 +1489,8 @@ static int mxt_update_cfg(struct mxt_data *data, const struct firmware *cfg)
 			MXT_INFO_CHECKSUM_SIZE;
 	config_mem_size = data->mem_size - cfg_start_ofs;
 	config_mem = kzalloc(config_mem_size, GFP_KERNEL);
-	if (!config_mem) {
-		dev_err(dev, "Failed to allocate memory\n");
+	if (!config_mem)
 		return -ENOMEM;
-	}
 
 	ret = mxt_prepare_cfg_mem(data, cfg, data_pos, cfg_start_ofs,
 				  config_mem, config_mem_size);
@@ -1555,14 +1538,9 @@ static int mxt_get_info(struct mxt_data *data)
 {
 	struct i2c_client *client = data->client;
 	struct mxt_info *info = &data->info;
-	int error;
 
 	/* Read 7-byte info block starting at address 0 */
-	error = __mxt_read_reg(client, 0, sizeof(*info), info);
-	if (error)
-		return error;
-
-	return 0;
+	return __mxt_read_reg(client, 0, sizeof(*info), info);
 }
 
 static void mxt_free_input_device(struct mxt_data *data)
@@ -1609,10 +1587,8 @@ static int mxt_get_object_table(struct mxt_data *data)
 
 	table_size = data->info.object_num * sizeof(struct mxt_object);
 	object_table = kzalloc(table_size, GFP_KERNEL);
-	if (!object_table) {
-		dev_err(&data->client->dev, "Failed to allocate memory\n");
+	if (!object_table)
 		return -ENOMEM;
-	}
 
 	error = __mxt_read_reg(client, MXT_OBJECT_START, table_size,
 			object_table);
@@ -2045,10 +2021,9 @@ static int mxt_initialize(struct mxt_data *data)
 		if (error) {
 			dev_info(&client->dev, "Trying alternate bootloader address\n");
 			error = mxt_probe_bootloader(data, true);
-			if (error) {
+			if (error)
 				/* Chip is not in appmode or bootloader mode */
 				return error;
-			}
 		}
 
 		/* OK, we are in bootloader, see if we can recover */
@@ -2509,7 +2484,7 @@ static void mxt_debug_init(struct mxt_data *data)
 		dbg->t37_pages = MXT1386_COLUMNS * MXT1386_PAGES_PER_COLUMN;
 	else
 		dbg->t37_pages = DIV_ROUND_UP(data->xsize *
-					      data->info.matrix_ysize *
+					      info->matrix_ysize *
 					      sizeof(u16),
 					      sizeof(dbg->t37_buf->data));
 
@@ -3117,10 +3092,8 @@ static int mxt_probe(struct i2c_client *client, const struct i2c_device_id *id)
 		return PTR_ERR(pdata);
 
 	data = kzalloc(sizeof(struct mxt_data), GFP_KERNEL);
-	if (!data) {
-		dev_err(&client->dev, "Failed to allocate memory\n");
+	if (!data)
 		return -ENOMEM;
-	}
 
 	snprintf(data->phys, sizeof(data->phys), "i2c-%u-%04x/input0",
 		 client->adapter->nr, client->addr);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 27/33] Input: eeti_ts - Drop unnecessary error messages and other changes
  2017-01-18 17:46 [PATCH 00/33] Input: Automated coccinelle cleanup Guenter Roeck
                   ` (25 preceding siblings ...)
  2017-01-18 17:46 ` [PATCH 26/33] Input: atmel_mxt_ts " Guenter Roeck
@ 2017-01-18 17:46 ` Guenter Roeck
  2017-01-18 19:26   ` Dmitry Torokhov
  2017-01-18 17:46 ` [PATCH 28/33] Input: egalax_ts - Drop unnecessary call to i2c_set_clientdata " Guenter Roeck
                   ` (3 subsequent siblings)
  30 siblings, 1 reply; 68+ messages in thread
From: Guenter Roeck @ 2017-01-18 17:46 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, linux-kernel, Guenter Roeck

Error messages after memory allocation failures are unnecessary and
can be dropped.

This conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts
used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches

- Drop unnecessary braces around conditional return statements
- Drop error message after devm_kzalloc() failure
- Replace 'goto l; ... l: return e;' with 'return e;'

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/input/touchscreen/eeti_ts.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/input/touchscreen/eeti_ts.c b/drivers/input/touchscreen/eeti_ts.c
index 09be6ced7151..de3f4a1e8416 100644
--- a/drivers/input/touchscreen/eeti_ts.c
+++ b/drivers/input/touchscreen/eeti_ts.c
@@ -171,10 +171,8 @@ static int eeti_ts_probe(struct i2c_client *client,
 	 */
 
 	priv = kzalloc(sizeof(*priv), GFP_KERNEL);
-	if (!priv) {
-		dev_err(&client->dev, "failed to allocate driver data\n");
-		goto err0;
-	}
+	if (!priv)
+		return err;
 
 	mutex_init(&priv->mutex);
 	input = input_allocate_device();
@@ -243,7 +241,6 @@ static int eeti_ts_probe(struct i2c_client *client,
 err1:
 	input_free_device(input);
 	kfree(priv);
-err0:
 	return err;
 }
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 28/33] Input: egalax_ts - Drop unnecessary call to i2c_set_clientdata and other changes
  2017-01-18 17:46 [PATCH 00/33] Input: Automated coccinelle cleanup Guenter Roeck
                   ` (26 preceding siblings ...)
  2017-01-18 17:46 ` [PATCH 27/33] Input: eeti_ts " Guenter Roeck
@ 2017-01-18 17:46 ` Guenter Roeck
  2017-01-18 19:31   ` Dmitry Torokhov
  2017-01-18 17:46 ` [PATCH 29/33] Input: melfas_mip4 - Use devm_add_action_or_reset " Guenter Roeck
                   ` (2 subsequent siblings)
  30 siblings, 1 reply; 68+ messages in thread
From: Guenter Roeck @ 2017-01-18 17:46 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, linux-kernel, Guenter Roeck

There is no call to i2c_get_clientdata() or dev_get_drvdata().
Drop the unnecessary call to i2c_set_clientdata().
Other relevant changes:
  Simplify error return
  Drop error messages after memory allocation failures

This conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts
used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches

- Drop unused variables
- Drop unnecessary braces around conditional return statements
- Drop error message after devm_kzalloc() failure
- Replace 'if (e) return e; return 0;' with 'return e;'
- Drop i2c_set_clientdata()

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/input/touchscreen/egalax_ts.c | 21 ++++-----------------
 1 file changed, 4 insertions(+), 17 deletions(-)

diff --git a/drivers/input/touchscreen/egalax_ts.c b/drivers/input/touchscreen/egalax_ts.c
index 1afc08b08155..05ba1a6dc7fc 100644
--- a/drivers/input/touchscreen/egalax_ts.c
+++ b/drivers/input/touchscreen/egalax_ts.c
@@ -82,10 +82,9 @@ static irqreturn_t egalax_ts_interrupt(int irq, void *dev_id)
 	if (ret < 0)
 		return IRQ_HANDLED;
 
-	if (buf[0] != REPORT_MODE_MTTOUCH) {
+	if (buf[0] != REPORT_MODE_MTTOUCH)
 		/* ignore mouse events and vendor events */
 		return IRQ_HANDLED;
-	}
 
 	state = buf[1];
 	x = (buf[3] << 8) | buf[2];
@@ -155,13 +154,8 @@ static int egalax_wake_up_device(struct i2c_client *client)
 static int egalax_firmware_version(struct i2c_client *client)
 {
 	static const u8 cmd[MAX_I2C_DATA_LEN] = { 0x03, 0x03, 0xa, 0x01, 0x41 };
-	int ret;
-
-	ret = i2c_master_send(client, cmd, MAX_I2C_DATA_LEN);
-	if (ret < 0)
-		return ret;
 
-	return 0;
+	return i2c_master_send(client, cmd, MAX_I2C_DATA_LEN);
 }
 
 static int egalax_ts_probe(struct i2c_client *client,
@@ -172,10 +166,8 @@ static int egalax_ts_probe(struct i2c_client *client,
 	int error;
 
 	ts = devm_kzalloc(&client->dev, sizeof(struct egalax_ts), GFP_KERNEL);
-	if (!ts) {
-		dev_err(&client->dev, "Failed to allocate memory\n");
+	if (!ts)
 		return -ENOMEM;
-	}
 
 	input_dev = devm_input_allocate_device(&client->dev);
 	if (!input_dev) {
@@ -225,12 +217,7 @@ static int egalax_ts_probe(struct i2c_client *client,
 		return error;
 	}
 
-	error = input_register_device(ts->input_dev);
-	if (error)
-		return error;
-
-	i2c_set_clientdata(client, ts);
-	return 0;
+	return input_register_device(ts->input_dev);
 }
 
 static const struct i2c_device_id egalax_ts_id[] = {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 29/33] Input: melfas_mip4 - Use devm_add_action_or_reset and other changes
  2017-01-18 17:46 [PATCH 00/33] Input: Automated coccinelle cleanup Guenter Roeck
                   ` (27 preceding siblings ...)
  2017-01-18 17:46 ` [PATCH 28/33] Input: egalax_ts - Drop unnecessary call to i2c_set_clientdata " Guenter Roeck
@ 2017-01-18 17:46 ` Guenter Roeck
  2017-01-18 19:28   ` Dmitry Torokhov
  2017-01-18 20:36 ` [PATCH 30/33] Input: raydium_i2c_ts - Simplify error return " Guenter Roeck
  2017-01-19  1:42 ` [PATCH 00/33] Input: Automated coccinelle cleanup Joe Perches
  30 siblings, 1 reply; 68+ messages in thread
From: Guenter Roeck @ 2017-01-18 17:46 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, linux-kernel, Guenter Roeck, Sangwon Jee

Replace devm_add_action() followed by failure action with
devm_add_action_or_reset()

This conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts
used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches

- Replace devm_add_action() followed by failure action with
  devm_add_action_or_reset()
- Replace 'goto l; ... l: return e;' with 'return e;'

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/input/touchscreen/melfas_mip4.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/input/touchscreen/melfas_mip4.c b/drivers/input/touchscreen/melfas_mip4.c
index 703d7f983d0a..3cad6f72dbf8 100644
--- a/drivers/input/touchscreen/melfas_mip4.c
+++ b/drivers/input/touchscreen/melfas_mip4.c
@@ -594,7 +594,7 @@ static irqreturn_t mip4_interrupt(int irq, void *dev_id)
 	if (error) {
 		dev_err(&client->dev,
 			"Failed to read packet info: %d\n", error);
-		goto out;
+		return IRQ_HANDLED;
 	}
 
 	size = ts->buf[0] & 0x7F;
@@ -604,7 +604,7 @@ static irqreturn_t mip4_interrupt(int irq, void *dev_id)
 	/* Check size */
 	if (!size) {
 		dev_err(&client->dev, "Empty packet\n");
-		goto out;
+		return IRQ_HANDLED;
 	}
 
 	/* Read packet data */
@@ -614,7 +614,7 @@ static irqreturn_t mip4_interrupt(int irq, void *dev_id)
 	if (error) {
 		dev_err(&client->dev,
 			"Failed to read packet data: %d\n", error);
-		goto out;
+		return IRQ_HANDLED;
 	}
 
 	if (alert) {
@@ -629,7 +629,6 @@ static irqreturn_t mip4_interrupt(int irq, void *dev_id)
 		input_sync(ts->input);
 	}
 
-out:
 	return IRQ_HANDLED;
 }
 
@@ -1531,9 +1530,8 @@ static int mip4_probe(struct i2c_client *client, const struct i2c_device_id *id)
 		return error;
 	}
 
-	error = devm_add_action(&client->dev, mip4_sysfs_remove, ts);
+	error = devm_add_action_or_reset(&client->dev, mip4_sysfs_remove, ts);
 	if (error) {
-		mip4_sysfs_remove(ts);
 		dev_err(&client->dev,
 			"Failed to install sysfs remoce action: %d\n", error);
 		return error;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* Re: [PATCH 04/33] Input: cros_ec_keyb - Drop unnecessary call to dev_set_drvdata and other changes
  2017-01-18 17:46 ` [PATCH 04/33] Input: cros_ec_keyb - Drop unnecessary call to dev_set_drvdata " Guenter Roeck
@ 2017-01-18 18:39   ` Dmitry Torokhov
  0 siblings, 0 replies; 68+ messages in thread
From: Dmitry Torokhov @ 2017-01-18 18:39 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: linux-input, linux-kernel, Brian Norris, Douglas Anderson,
	Lee Jones, Vic Yang

On Wed, Jan 18, 2017 at 09:46:25AM -0800, Guenter Roeck wrote:
> There is no call to platform_get_drvdata() or dev_get_drvdata().
> Drop the unnecessary call to dev_set_drvdata().
> Other relevant changes:
>   Use existing variable 'dev' instead of dereferencing it several times
> 
> This conversion was done automatically with coccinelle using the
> following semantic patches. The semantic patches and the scripts
> used to generate this commit log are available at
> https://github.com/groeck/coccinelle-patches
> 
> - Drop dev_set_drvdata()
> - Use local variable 'struct device *dev' consistently
> 
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>

Applied, thank you.

> ---
>  drivers/input/keyboard/cros_ec_keyb.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c
> index 25943e9bc8bf..87d071ae21da 100644
> --- a/drivers/input/keyboard/cros_ec_keyb.c
> +++ b/drivers/input/keyboard/cros_ec_keyb.c
> @@ -222,7 +222,7 @@ static int cros_ec_keyb_probe(struct platform_device *pdev)
>  	struct device_node *np;
>  	int err;
>  
> -	np = pdev->dev.of_node;
> +	np = dev->of_node;
>  	if (!np)
>  		return -ENODEV;
>  
> @@ -248,7 +248,6 @@ static int cros_ec_keyb_probe(struct platform_device *pdev)
>  	ckdev->ec = ec;
>  	ckdev->notifier.notifier_call = cros_ec_keyb_work;
>  	ckdev->dev = dev;
> -	dev_set_drvdata(dev, ckdev);
>  
>  	idev->name = CROS_EC_DEV_NAME;
>  	idev->phys = ec->phys_name;
> -- 
> 2.7.4
> 

-- 
Dmitry

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 22/33] Input: at32psif - Drop unnecessary error messages and other changes
  2017-01-18 17:46 ` [PATCH 22/33] Input: at32psif " Guenter Roeck
@ 2017-01-18 19:13   ` Dmitry Torokhov
  0 siblings, 0 replies; 68+ messages in thread
From: Dmitry Torokhov @ 2017-01-18 19:13 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: linux-input, linux-kernel

On Wed, Jan 18, 2017 at 09:46:43AM -0800, Guenter Roeck wrote:
> Error messages after memory allocation failures are unnecessary and
> can be dropped.
> 
> This conversion was done automatically with coccinelle using the
> following semantic patches. The semantic patches and the scripts
> used to generate this commit log are available at
> https://github.com/groeck/coccinelle-patches
> 
> - Drop unnecessary braces around conditional return statements
> - Drop error message after devm_kzalloc() failure
> - Replace 'goto l; ... l: return e;' with 'return e;'
> - Replace 'val = e; return val;' with 'return e;'
> 
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---
>  drivers/input/serio/at32psif.c | 12 +++---------
>  1 file changed, 3 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/input/serio/at32psif.c b/drivers/input/serio/at32psif.c
> index 2e4ff5bac754..e420fd781d44 100644
> --- a/drivers/input/serio/at32psif.c
> +++ b/drivers/input/serio/at32psif.c
> @@ -159,13 +159,12 @@ static int psif_open(struct serio *io)
>  
>  	retval = clk_enable(psif->pclk);
>  	if (retval)
> -		goto out;
> +		return retval;
>  
>  	psif_writel(psif, CR, PSIF_BIT(CR_TXEN) | PSIF_BIT(CR_RXEN));
>  	psif_writel(psif, IER, PSIF_BIT(RXRDY));
>  
>  	psif->open = true;
> -out:
>  	return retval;
>  }
>  
> @@ -210,16 +209,12 @@ static int __init psif_probe(struct platform_device *pdev)
>  	int ret;
>  
>  	psif = kzalloc(sizeof(struct psif), GFP_KERNEL);
> -	if (!psif) {
> -		dev_dbg(&pdev->dev, "out of memory\n");

I guess nobody will see these messages unless actively debugging, so I'm
OK with these gone.

> -		ret = -ENOMEM;
> -		goto out;
> -	}
> +	if (!psif)
> +		return -ENOMEM;
>  	psif->pdev = pdev;
>  
>  	io = kzalloc(sizeof(struct serio), GFP_KERNEL);
>  	if (!io) {
> -		dev_dbg(&pdev->dev, "out of memory\n");
>  		ret = -ENOMEM;
>  		goto out_free_psif;
>  	}
> @@ -297,7 +292,6 @@ static int __init psif_probe(struct platform_device *pdev)
>  	kfree(io);
>  out_free_psif:
>  	kfree(psif);
> -out:
>  	return ret;
>  }
>  
> -- 
> 2.7.4
> 

Applied, thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 23/33] Input: xilinx_ps2 - Use 'dev' instead of dereferencing it and other changes
  2017-01-18 17:46   ` Guenter Roeck
  (?)
@ 2017-01-18 19:17     ` Dmitry Torokhov
  -1 siblings, 0 replies; 68+ messages in thread
From: Dmitry Torokhov @ 2017-01-18 19:17 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: linux-input, linux-kernel, linux-arm-kernel, Michal Simek,
	Sören Brinkmann

On Wed, Jan 18, 2017 at 09:46:44AM -0800, Guenter Roeck wrote:
> Use local variable 'dev' instead of dereferencing it several times.
> 
> This conversion was done automatically with coccinelle using the
> following semantic patches. The semantic patches and the scripts
> used to generate this commit log are available at
> https://github.com/groeck/coccinelle-patches
> 
> - Use local variable 'struct device *dev' consistently
> 
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>

Applied, thank you.

> ---
>  drivers/input/serio/xilinx_ps2.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/input/serio/xilinx_ps2.c b/drivers/input/serio/xilinx_ps2.c
> index 5223cbf94262..14c40892ed82 100644
> --- a/drivers/input/serio/xilinx_ps2.c
> +++ b/drivers/input/serio/xilinx_ps2.c
> @@ -243,18 +243,17 @@ static int xps2_of_probe(struct platform_device *ofdev)
>  	unsigned int irq;
>  	int error;
>  
> -	dev_info(dev, "Device Tree Probing \'%s\'\n",
> -			ofdev->dev.of_node->name);
> +	dev_info(dev, "Device Tree Probing \'%s\'\n", dev->of_node->name);
>  
>  	/* Get iospace for the device */
> -	error = of_address_to_resource(ofdev->dev.of_node, 0, &r_mem);
> +	error = of_address_to_resource(dev->of_node, 0, &r_mem);
>  	if (error) {
>  		dev_err(dev, "invalid address\n");
>  		return error;
>  	}
>  
>  	/* Get IRQ for the device */
> -	irq = irq_of_parse_and_map(ofdev->dev.of_node, 0);
> +	irq = irq_of_parse_and_map(dev->of_node, 0);
>  	if (!irq) {
>  		dev_err(dev, "no IRQ found\n");
>  		return -ENODEV;
> -- 
> 2.7.4
> 

-- 
Dmitry

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 23/33] Input: xilinx_ps2 - Use 'dev' instead of dereferencing it and other changes
@ 2017-01-18 19:17     ` Dmitry Torokhov
  0 siblings, 0 replies; 68+ messages in thread
From: Dmitry Torokhov @ 2017-01-18 19:17 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Sören Brinkmann, Michal Simek, linux-kernel,
	linux-arm-kernel, linux-input

On Wed, Jan 18, 2017 at 09:46:44AM -0800, Guenter Roeck wrote:
> Use local variable 'dev' instead of dereferencing it several times.
> 
> This conversion was done automatically with coccinelle using the
> following semantic patches. The semantic patches and the scripts
> used to generate this commit log are available at
> https://github.com/groeck/coccinelle-patches
> 
> - Use local variable 'struct device *dev' consistently
> 
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>

Applied, thank you.

> ---
>  drivers/input/serio/xilinx_ps2.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/input/serio/xilinx_ps2.c b/drivers/input/serio/xilinx_ps2.c
> index 5223cbf94262..14c40892ed82 100644
> --- a/drivers/input/serio/xilinx_ps2.c
> +++ b/drivers/input/serio/xilinx_ps2.c
> @@ -243,18 +243,17 @@ static int xps2_of_probe(struct platform_device *ofdev)
>  	unsigned int irq;
>  	int error;
>  
> -	dev_info(dev, "Device Tree Probing \'%s\'\n",
> -			ofdev->dev.of_node->name);
> +	dev_info(dev, "Device Tree Probing \'%s\'\n", dev->of_node->name);
>  
>  	/* Get iospace for the device */
> -	error = of_address_to_resource(ofdev->dev.of_node, 0, &r_mem);
> +	error = of_address_to_resource(dev->of_node, 0, &r_mem);
>  	if (error) {
>  		dev_err(dev, "invalid address\n");
>  		return error;
>  	}
>  
>  	/* Get IRQ for the device */
> -	irq = irq_of_parse_and_map(ofdev->dev.of_node, 0);
> +	irq = irq_of_parse_and_map(dev->of_node, 0);
>  	if (!irq) {
>  		dev_err(dev, "no IRQ found\n");
>  		return -ENODEV;
> -- 
> 2.7.4
> 

-- 
Dmitry

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [PATCH 23/33] Input: xilinx_ps2 - Use 'dev' instead of dereferencing it and other changes
@ 2017-01-18 19:17     ` Dmitry Torokhov
  0 siblings, 0 replies; 68+ messages in thread
From: Dmitry Torokhov @ 2017-01-18 19:17 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jan 18, 2017 at 09:46:44AM -0800, Guenter Roeck wrote:
> Use local variable 'dev' instead of dereferencing it several times.
> 
> This conversion was done automatically with coccinelle using the
> following semantic patches. The semantic patches and the scripts
> used to generate this commit log are available at
> https://github.com/groeck/coccinelle-patches
> 
> - Use local variable 'struct device *dev' consistently
> 
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>

Applied, thank you.

> ---
>  drivers/input/serio/xilinx_ps2.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/input/serio/xilinx_ps2.c b/drivers/input/serio/xilinx_ps2.c
> index 5223cbf94262..14c40892ed82 100644
> --- a/drivers/input/serio/xilinx_ps2.c
> +++ b/drivers/input/serio/xilinx_ps2.c
> @@ -243,18 +243,17 @@ static int xps2_of_probe(struct platform_device *ofdev)
>  	unsigned int irq;
>  	int error;
>  
> -	dev_info(dev, "Device Tree Probing \'%s\'\n",
> -			ofdev->dev.of_node->name);
> +	dev_info(dev, "Device Tree Probing \'%s\'\n", dev->of_node->name);
>  
>  	/* Get iospace for the device */
> -	error = of_address_to_resource(ofdev->dev.of_node, 0, &r_mem);
> +	error = of_address_to_resource(dev->of_node, 0, &r_mem);
>  	if (error) {
>  		dev_err(dev, "invalid address\n");
>  		return error;
>  	}
>  
>  	/* Get IRQ for the device */
> -	irq = irq_of_parse_and_map(ofdev->dev.of_node, 0);
> +	irq = irq_of_parse_and_map(dev->of_node, 0);
>  	if (!irq) {
>  		dev_err(dev, "no IRQ found\n");
>  		return -ENODEV;
> -- 
> 2.7.4
> 

-- 
Dmitry

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 24/33] Input: ar1021_i2c - Drop unnecessary call to i2c_set_clientdata and other changes
  2017-01-18 17:46 ` [PATCH 24/33] Input: ar1021_i2c - Drop unnecessary call to i2c_set_clientdata " Guenter Roeck
@ 2017-01-18 19:21   ` Dmitry Torokhov
  0 siblings, 0 replies; 68+ messages in thread
From: Dmitry Torokhov @ 2017-01-18 19:21 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: linux-input, linux-kernel

On Wed, Jan 18, 2017 at 09:46:45AM -0800, Guenter Roeck wrote:
> There is no call to i2c_get_clientdata() or dev_get_drvdata().
> Drop the unnecessary call to i2c_set_clientdata().

Kept just this part and applied.

> 
> This conversion was done automatically with coccinelle using the
> following semantic patches. The semantic patches and the scripts
> used to generate this commit log are available at
> https://github.com/groeck/coccinelle-patches
> 
> - Replace 'goto l; ... l: return e;' with 'return e;'
> - Drop i2c_set_clientdata()
> 
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---
>  drivers/input/touchscreen/ar1021_i2c.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/ar1021_i2c.c b/drivers/input/touchscreen/ar1021_i2c.c
> index 71b5a634cf6d..b289eca2b797 100644
> --- a/drivers/input/touchscreen/ar1021_i2c.c
> +++ b/drivers/input/touchscreen/ar1021_i2c.c
> @@ -35,11 +35,11 @@ static irqreturn_t ar1021_i2c_irq(int irq, void *dev_id)
>  	retval = i2c_master_recv(ar1021->client,
>  				ar1021->data, sizeof(ar1021->data));
>  	if (retval != sizeof(ar1021->data))
> -		goto out;
> +		return IRQ_HANDLED;
>  
>  	/* sync bit set ? */
>  	if ((data[0] & 0x80) == 0)
> -		goto out;
> +		return IRQ_HANDLED;
>  
>  	button = data[0] & BIT(0);
>  	x = ((data[2] & 0x1f) << 7) | (data[1] & 0x7f);
> @@ -50,7 +50,6 @@ static irqreturn_t ar1021_i2c_irq(int irq, void *dev_id)
>  	input_report_key(input, BTN_TOUCH, button);
>  	input_sync(input);
>  
> -out:
>  	return IRQ_HANDLED;
>  }
>  
> @@ -127,7 +126,6 @@ static int ar1021_i2c_probe(struct i2c_client *client,
>  		return error;
>  	}
>  
> -	i2c_set_clientdata(client, ar1021);
>  	return 0;
>  }
>  
> -- 
> 2.7.4
> 

-- 
Dmitry

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 25/33] Input: atmel-wm97xx - Drop unnecessary error messages and other changes
  2017-01-18 17:46 ` [PATCH 25/33] Input: atmel-wm97xx - Drop unnecessary error messages " Guenter Roeck
@ 2017-01-18 19:23   ` Dmitry Torokhov
  0 siblings, 0 replies; 68+ messages in thread
From: Dmitry Torokhov @ 2017-01-18 19:23 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: linux-input, linux-kernel

On Wed, Jan 18, 2017 at 09:46:46AM -0800, Guenter Roeck wrote:
> Error messages after memory allocation failures are unnecessary and
> can be dropped.
> 
> This conversion was done automatically with coccinelle using the
> following semantic patches. The semantic patches and the scripts
> used to generate this commit log are available at
> https://github.com/groeck/coccinelle-patches
> 
> - Drop unnecessary braces around conditional return statements
> - Drop error message after devm_kzalloc() failure

OK since it was emitted as dev_dbg() anyway, applied.

> 
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---
>  drivers/input/touchscreen/atmel-wm97xx.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/atmel-wm97xx.c b/drivers/input/touchscreen/atmel-wm97xx.c
> index 7ec0421c0dd8..8cf0b2be2df4 100644
> --- a/drivers/input/touchscreen/atmel-wm97xx.c
> +++ b/drivers/input/touchscreen/atmel-wm97xx.c
> @@ -339,10 +339,8 @@ static int __init atmel_wm97xx_probe(struct platform_device *pdev)
>  	int ret;
>  
>  	atmel_wm97xx = kzalloc(sizeof(struct atmel_wm97xx), GFP_KERNEL);
> -	if (!atmel_wm97xx) {
> -		dev_dbg(&pdev->dev, "out of memory\n");
> +	if (!atmel_wm97xx)
>  		return -ENOMEM;
> -	}
>  
>  	atmel_wm97xx->wm	= wm;
>  	atmel_wm97xx->regs	= (void *)ATMEL_WM97XX_AC97C_IOMEM;
> -- 
> 2.7.4
> 

-- 
Dmitry

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 27/33] Input: eeti_ts - Drop unnecessary error messages and other changes
  2017-01-18 17:46 ` [PATCH 27/33] Input: eeti_ts " Guenter Roeck
@ 2017-01-18 19:26   ` Dmitry Torokhov
  0 siblings, 0 replies; 68+ messages in thread
From: Dmitry Torokhov @ 2017-01-18 19:26 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: linux-input, linux-kernel

On Wed, Jan 18, 2017 at 09:46:48AM -0800, Guenter Roeck wrote:
> Error messages after memory allocation failures are unnecessary and
> can be dropped.
> 
> This conversion was done automatically with coccinelle using the
> following semantic patches. The semantic patches and the scripts
> used to generate this commit log are available at
> https://github.com/groeck/coccinelle-patches
> 
> - Drop unnecessary braces around conditional return statements
> - Drop error message after devm_kzalloc() failure
> - Replace 'goto l; ... l: return e;' with 'return e;'

Kept just the last part and applied, thank you.

> 
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---
>  drivers/input/touchscreen/eeti_ts.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/eeti_ts.c b/drivers/input/touchscreen/eeti_ts.c
> index 09be6ced7151..de3f4a1e8416 100644
> --- a/drivers/input/touchscreen/eeti_ts.c
> +++ b/drivers/input/touchscreen/eeti_ts.c
> @@ -171,10 +171,8 @@ static int eeti_ts_probe(struct i2c_client *client,
>  	 */
>  
>  	priv = kzalloc(sizeof(*priv), GFP_KERNEL);
> -	if (!priv) {
> -		dev_err(&client->dev, "failed to allocate driver data\n");
> -		goto err0;
> -	}
> +	if (!priv)
> +		return err;
>  
>  	mutex_init(&priv->mutex);
>  	input = input_allocate_device();
> @@ -243,7 +241,6 @@ static int eeti_ts_probe(struct i2c_client *client,
>  err1:
>  	input_free_device(input);
>  	kfree(priv);
> -err0:
>  	return err;
>  }
>  
> -- 
> 2.7.4
> 

-- 
Dmitry

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 29/33] Input: melfas_mip4 - Use devm_add_action_or_reset and other changes
  2017-01-18 17:46 ` [PATCH 29/33] Input: melfas_mip4 - Use devm_add_action_or_reset " Guenter Roeck
@ 2017-01-18 19:28   ` Dmitry Torokhov
  0 siblings, 0 replies; 68+ messages in thread
From: Dmitry Torokhov @ 2017-01-18 19:28 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: linux-input, linux-kernel, Sangwon Jee

On Wed, Jan 18, 2017 at 09:46:50AM -0800, Guenter Roeck wrote:
> Replace devm_add_action() followed by failure action with
> devm_add_action_or_reset()
> 
> This conversion was done automatically with coccinelle using the
> following semantic patches. The semantic patches and the scripts
> used to generate this commit log are available at
> https://github.com/groeck/coccinelle-patches
> 
> - Replace devm_add_action() followed by failure action with
>   devm_add_action_or_reset()

I am planning on using devm_sysfs_create_group() here (to be
[re]submitted to Greg).

> - Replace 'goto l; ... l: return e;' with 'return e;'
> 
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---
>  drivers/input/touchscreen/melfas_mip4.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/melfas_mip4.c b/drivers/input/touchscreen/melfas_mip4.c
> index 703d7f983d0a..3cad6f72dbf8 100644
> --- a/drivers/input/touchscreen/melfas_mip4.c
> +++ b/drivers/input/touchscreen/melfas_mip4.c
> @@ -594,7 +594,7 @@ static irqreturn_t mip4_interrupt(int irq, void *dev_id)
>  	if (error) {
>  		dev_err(&client->dev,
>  			"Failed to read packet info: %d\n", error);
> -		goto out;
> +		return IRQ_HANDLED;
>  	}
>  
>  	size = ts->buf[0] & 0x7F;
> @@ -604,7 +604,7 @@ static irqreturn_t mip4_interrupt(int irq, void *dev_id)
>  	/* Check size */
>  	if (!size) {
>  		dev_err(&client->dev, "Empty packet\n");
> -		goto out;
> +		return IRQ_HANDLED;
>  	}
>  
>  	/* Read packet data */
> @@ -614,7 +614,7 @@ static irqreturn_t mip4_interrupt(int irq, void *dev_id)
>  	if (error) {
>  		dev_err(&client->dev,
>  			"Failed to read packet data: %d\n", error);
> -		goto out;
> +		return IRQ_HANDLED;
>  	}
>  
>  	if (alert) {
> @@ -629,7 +629,6 @@ static irqreturn_t mip4_interrupt(int irq, void *dev_id)
>  		input_sync(ts->input);
>  	}
>  
> -out:
>  	return IRQ_HANDLED;
>  }
>  
> @@ -1531,9 +1530,8 @@ static int mip4_probe(struct i2c_client *client, const struct i2c_device_id *id)
>  		return error;
>  	}
>  
> -	error = devm_add_action(&client->dev, mip4_sysfs_remove, ts);
> +	error = devm_add_action_or_reset(&client->dev, mip4_sysfs_remove, ts);
>  	if (error) {
> -		mip4_sysfs_remove(ts);
>  		dev_err(&client->dev,
>  			"Failed to install sysfs remoce action: %d\n", error);
>  		return error;
> -- 
> 2.7.4
> 

-- 
Dmitry

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 28/33] Input: egalax_ts - Drop unnecessary call to i2c_set_clientdata and other changes
  2017-01-18 17:46 ` [PATCH 28/33] Input: egalax_ts - Drop unnecessary call to i2c_set_clientdata " Guenter Roeck
@ 2017-01-18 19:31   ` Dmitry Torokhov
  2017-01-18 20:32     ` Guenter Roeck
  0 siblings, 1 reply; 68+ messages in thread
From: Dmitry Torokhov @ 2017-01-18 19:31 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: linux-input, linux-kernel

On Wed, Jan 18, 2017 at 09:46:49AM -0800, Guenter Roeck wrote:
> There is no call to i2c_get_clientdata() or dev_get_drvdata().
> Drop the unnecessary call to i2c_set_clientdata().
> Other relevant changes:
>   Simplify error return
>   Drop error messages after memory allocation failures
> 
> This conversion was done automatically with coccinelle using the
> following semantic patches. The semantic patches and the scripts
> used to generate this commit log are available at
> https://github.com/groeck/coccinelle-patches
> 
> - Drop unused variables
> - Drop unnecessary braces around conditional return statements
> - Drop error message after devm_kzalloc() failure
> - Replace 'if (e) return e; return 0;' with 'return e;'
> - Drop i2c_set_clientdata()
> 
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---
>  drivers/input/touchscreen/egalax_ts.c | 21 ++++-----------------
>  1 file changed, 4 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/egalax_ts.c b/drivers/input/touchscreen/egalax_ts.c
> index 1afc08b08155..05ba1a6dc7fc 100644
> --- a/drivers/input/touchscreen/egalax_ts.c
> +++ b/drivers/input/touchscreen/egalax_ts.c
> @@ -82,10 +82,9 @@ static irqreturn_t egalax_ts_interrupt(int irq, void *dev_id)
>  	if (ret < 0)
>  		return IRQ_HANDLED;
>  
> -	if (buf[0] != REPORT_MODE_MTTOUCH) {
> +	if (buf[0] != REPORT_MODE_MTTOUCH)
>  		/* ignore mouse events and vendor events */
>  		return IRQ_HANDLED;
> -	}

These are not unnecessary braces, as there are more than 1 line. I.e.
comments are counted along statements, at least by myself. Also, if
there is a single statement spanning several lines I also prefer to have
braces around it.

>  
>  	state = buf[1];
>  	x = (buf[3] << 8) | buf[2];
> @@ -155,13 +154,8 @@ static int egalax_wake_up_device(struct i2c_client *client)
>  static int egalax_firmware_version(struct i2c_client *client)
>  {
>  	static const u8 cmd[MAX_I2C_DATA_LEN] = { 0x03, 0x03, 0xa, 0x01, 0x41 };
> -	int ret;
> -
> -	ret = i2c_master_send(client, cmd, MAX_I2C_DATA_LEN);
> -	if (ret < 0)
> -		return ret;
>  
> -	return 0;
> +	return i2c_master_send(client, cmd, MAX_I2C_DATA_LEN);

This is not an equivalent transformation, as now callers need to check
for negative return value instead of non-zero. i2c_master_send() returns
number of bytes written on success.

>  }
>  
>  static int egalax_ts_probe(struct i2c_client *client,
> @@ -172,10 +166,8 @@ static int egalax_ts_probe(struct i2c_client *client,
>  	int error;
>  
>  	ts = devm_kzalloc(&client->dev, sizeof(struct egalax_ts), GFP_KERNEL);
> -	if (!ts) {
> -		dev_err(&client->dev, "Failed to allocate memory\n");
> +	if (!ts)
>  		return -ENOMEM;
> -	}
>  
>  	input_dev = devm_input_allocate_device(&client->dev);
>  	if (!input_dev) {
> @@ -225,12 +217,7 @@ static int egalax_ts_probe(struct i2c_client *client,
>  		return error;
>  	}
>  
> -	error = input_register_device(ts->input_dev);
> -	if (error)
> -		return error;
> -
> -	i2c_set_clientdata(client, ts);
> -	return 0;
> +	return input_register_device(ts->input_dev);
>  }
>  
>  static const struct i2c_device_id egalax_ts_id[] = {
> -- 
> 2.7.4
> 

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 13/33] Input: bfin_rotary - Use 'dev' instead of dereferencing it and other changes
  2017-01-18 17:46 ` [PATCH 13/33] Input: bfin_rotary - Use 'dev' instead of dereferencing it " Guenter Roeck
@ 2017-01-18 19:39   ` Dmitry Torokhov
  2017-01-18 20:35     ` Guenter Roeck
  0 siblings, 1 reply; 68+ messages in thread
From: Dmitry Torokhov @ 2017-01-18 19:39 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: linux-input, linux-kernel

On Wed, Jan 18, 2017 at 09:46:34AM -0800, Guenter Roeck wrote:
> Use local variable 'dev' instead of dereferencing it several times.
> Other relevant changes:
>   Replace devm_add_action() with devm_add_action_or_reset()
> 
> This conversion was done automatically with coccinelle using the
> following semantic patches. The semantic patches and the scripts
> used to generate this commit log are available at
> https://github.com/groeck/coccinelle-patches
> 
> - Replace devm_add_action() followed by failure action with
>   devm_add_action_or_reset()
> - Drop unnecessary braces around conditional return statements
> - Use local variable 'struct device *dev' consistently
> 
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---
>  drivers/input/misc/bfin_rotary.c | 18 ++++++++----------
>  1 file changed, 8 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/input/misc/bfin_rotary.c b/drivers/input/misc/bfin_rotary.c
> index a0fc18fdfc0c..9f5790c6e06b 100644
> --- a/drivers/input/misc/bfin_rotary.c
> +++ b/drivers/input/misc/bfin_rotary.c
> @@ -141,25 +141,23 @@ static int bfin_rotary_probe(struct platform_device *pdev)
>  
>  	/* Basic validation */
>  	if ((pdata->rotary_up_key && !pdata->rotary_down_key) ||
> -	    (!pdata->rotary_up_key && pdata->rotary_down_key)) {
> +	    (!pdata->rotary_up_key && pdata->rotary_down_key))
>  		return -EINVAL;
> -	}

This is complex "if" statement, would prefer keep the braces.

>  
>  	if (pdata->pin_list) {
>  		error = peripheral_request_list(pdata->pin_list,
> -						dev_name(&pdev->dev));
> +						dev_name(dev));
>  		if (error) {
>  			dev_err(dev, "requesting peripherals failed: %d\n",
>  				error);
>  			return error;
>  		}
>  
> -		error = devm_add_action(dev, bfin_rotary_free_action,
> -					pdata->pin_list);
> +		error = devm_add_action_or_reset(dev, bfin_rotary_free_action,
> +						 pdata->pin_list);
>  		if (error) {
>  			dev_err(dev, "setting cleanup action failed: %d\n",
>  				error);
> -			peripheral_free_list(pdata->pin_list);
>  			return error;
>  		}
>  	}
> @@ -189,7 +187,7 @@ static int bfin_rotary_probe(struct platform_device *pdev)
>  
>  	input->name = pdev->name;
>  	input->phys = "bfin-rotary/input0";
> -	input->dev.parent = &pdev->dev;
> +	input->dev.parent = dev;
>  
>  	input_set_drvdata(input, rotary);
>  
> @@ -224,8 +222,8 @@ static int bfin_rotary_probe(struct platform_device *pdev)
>  		return -ENOENT;
>  	}
>  
> -	error = devm_request_irq(dev, rotary->irq, bfin_rotary_isr,
> -				 0, dev_name(dev), rotary);
> +	error = devm_request_irq(dev, rotary->irq, bfin_rotary_isr, 0,
> +				 dev_name(dev), rotary);

Do not see point of this change.

>  	if (error) {
>  		dev_err(dev, "unable to claim irq %d; error %d\n",
>  			rotary->irq, error);
> @@ -239,7 +237,7 @@ static int bfin_rotary_probe(struct platform_device *pdev)
>  	}
>  
>  	platform_set_drvdata(pdev, rotary);
> -	device_init_wakeup(&pdev->dev, 1);
> +	device_init_wakeup(dev, 1);
>  
>  	return 0;
>  }
> -- 
> 2.7.4
> 

Dropped the above 2 chunks and applied.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 14/33] Input: gpio_decoder - Drop unnecessary call to platform_set_drvdata and other changes
  2017-01-18 17:46 ` [PATCH 14/33] Input: gpio_decoder - Drop unnecessary call to platform_set_drvdata " Guenter Roeck
@ 2017-01-18 19:40   ` Dmitry Torokhov
  0 siblings, 0 replies; 68+ messages in thread
From: Dmitry Torokhov @ 2017-01-18 19:40 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: linux-input, linux-kernel, Rob Herring, Vignesh R

On Wed, Jan 18, 2017 at 09:46:35AM -0800, Guenter Roeck wrote:
> There is no call to platform_get_drvdata() or dev_get_drvdata().
> Drop the unnecessary call to platform_set_drvdata().
> 
> This conversion was done automatically with coccinelle using the
> following semantic patches. The semantic patches and the scripts
> used to generate this commit log are available at
> https://github.com/groeck/coccinelle-patches
> 
> - Drop platform_set_drvdata()
> 
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>

Applied, thank you.

> ---
>  drivers/input/misc/gpio_decoder.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/input/misc/gpio_decoder.c b/drivers/input/misc/gpio_decoder.c
> index ca7e0bacb2d8..1dca526e6f1a 100644
> --- a/drivers/input/misc/gpio_decoder.c
> +++ b/drivers/input/misc/gpio_decoder.c
> @@ -110,7 +110,6 @@ static int gpio_decoder_probe(struct platform_device *pdev)
>  		dev_err(dev, "failed to register polled  device\n");
>  		return err;
>  	}
> -	platform_set_drvdata(pdev, decoder);
>  
>  	return 0;
>  }
> -- 
> 2.7.4
> 

-- 
Dmitry

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 16/33] Input: mma8450 - Drop unnecessary call to i2c_set_clientdata and other changes
  2017-01-18 17:46 ` [PATCH 16/33] Input: mma8450 - Drop unnecessary call to i2c_set_clientdata " Guenter Roeck
@ 2017-01-18 19:41   ` Dmitry Torokhov
  0 siblings, 0 replies; 68+ messages in thread
From: Dmitry Torokhov @ 2017-01-18 19:41 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: linux-input, linux-kernel

On Wed, Jan 18, 2017 at 09:46:37AM -0800, Guenter Roeck wrote:
> There is no call to i2c_get_clientdata() or dev_get_drvdata().
> Drop the unnecessary call to i2c_set_clientdata().
> 
> This conversion was done automatically with coccinelle using the
> following semantic patches. The semantic patches and the scripts
> used to generate this commit log are available at
> https://github.com/groeck/coccinelle-patches
> 
> - Drop i2c_set_clientdata()
> 
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>

Applied, thank you.

> ---
>  drivers/input/misc/mma8450.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/input/misc/mma8450.c b/drivers/input/misc/mma8450.c
> index 19c73574458e..b60cdea73826 100644
> --- a/drivers/input/misc/mma8450.c
> +++ b/drivers/input/misc/mma8450.c
> @@ -205,8 +205,6 @@ static int mma8450_probe(struct i2c_client *c,
>  		return err;
>  	}
>  
> -	i2c_set_clientdata(c, m);
> -
>  	return 0;
>  }
>  
> -- 
> 2.7.4
> 

-- 
Dmitry

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 18/33] Input: soc_button_array - Use 'dev' instead of dereferencing it and other changes
  2017-01-18 17:46 ` [PATCH 18/33] Input: soc_button_array - Use 'dev' instead of dereferencing it " Guenter Roeck
@ 2017-01-18 19:42   ` Dmitry Torokhov
  0 siblings, 0 replies; 68+ messages in thread
From: Dmitry Torokhov @ 2017-01-18 19:42 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: linux-input, linux-kernel, Benjamin Tissoires

On Wed, Jan 18, 2017 at 09:46:39AM -0800, Guenter Roeck wrote:
> Use local variable 'dev' instead of dereferencing it several times.
> 
> This conversion was done automatically with coccinelle using the
> following semantic patches. The semantic patches and the scripts
> used to generate this commit log are available at
> https://github.com/groeck/coccinelle-patches
> 
> - Use local variable 'struct device *dev' consistently

Applied, thank you.

> 
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---
>  drivers/input/misc/soc_button_array.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/input/misc/soc_button_array.c b/drivers/input/misc/soc_button_array.c
> index 908b51089dee..fb3219a8d3c0 100644
> --- a/drivers/input/misc/soc_button_array.c
> +++ b/drivers/input/misc/soc_button_array.c
> @@ -167,12 +167,12 @@ static int soc_button_probe(struct platform_device *pdev)
>  
>  	button_info = (struct soc_button_info *)id->driver_data;
>  
> -	if (gpiod_count(&pdev->dev, KBUILD_MODNAME) <= 0) {
> -		dev_dbg(&pdev->dev, "no GPIO attached, ignoring...\n");
> +	if (gpiod_count(dev, KBUILD_MODNAME) <= 0) {
> +		dev_dbg(dev, "no GPIO attached, ignoring...\n");
>  		return -ENODEV;
>  	}
>  
> -	priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
> +	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
>  	if (!priv)
>  		return -ENOMEM;
>  
> -- 
> 2.7.4
> 

-- 
Dmitry

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 19/33] Input: tps65218-pwrbutton - Drop unnecessary call to platform_set_drvdata and other changes
  2017-01-18 17:46 ` [PATCH 19/33] Input: tps65218-pwrbutton - Drop unnecessary call to platform_set_drvdata " Guenter Roeck
@ 2017-01-18 19:44   ` Dmitry Torokhov
  0 siblings, 0 replies; 68+ messages in thread
From: Dmitry Torokhov @ 2017-01-18 19:44 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: linux-input, linux-kernel, Keerthy, Lee Jones, Marcin Niestroj

On Wed, Jan 18, 2017 at 09:46:40AM -0800, Guenter Roeck wrote:
> There is no call to platform_get_drvdata() or dev_get_drvdata().
> Drop the unnecessary call to platform_set_drvdata().
> Other relevant changes:
>   Use existing variable 'dev' instead of dereferencing it several times
> 
> This conversion was done automatically with coccinelle using the
> following semantic patches. The semantic patches and the scripts
> used to generate this commit log are available at
> https://github.com/groeck/coccinelle-patches
> 
> - Replace 'goto l; ... l: return e;' with 'return e;'
> - Drop platform_set_drvdata()
> - Use local variable 'struct device *dev' consistently
> 
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---
>  drivers/input/misc/tps65218-pwrbutton.c | 11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/input/misc/tps65218-pwrbutton.c b/drivers/input/misc/tps65218-pwrbutton.c
> index cc74a41bdb0d..33f48a622fc6 100644
> --- a/drivers/input/misc/tps65218-pwrbutton.c
> +++ b/drivers/input/misc/tps65218-pwrbutton.c
> @@ -70,7 +70,7 @@ static irqreturn_t tps6521x_pb_irq(int irq, void *_pwr)
>  	error = regmap_read(pwr->regmap, tps_data->reg_status, &reg);
>  	if (error) {
>  		dev_err(pwr->dev, "can't read register: %d\n", error);
> -		goto out;
> +		return IRQ_HANDLED;
>  	}
>  
>  	if (reg & tps_data->pb_mask) {
> @@ -82,7 +82,6 @@ static irqreturn_t tps6521x_pb_irq(int irq, void *_pwr)
>  
>  	input_sync(pwr->idev);
>  
> -out:
>  	return IRQ_HANDLED;
>  }

Applied except for the above chunks, thank you.

>  
> @@ -95,7 +94,7 @@ static int tps6521x_pb_probe(struct platform_device *pdev)
>  	int error;
>  	int irq;
>  
> -	match = of_match_node(of_tps6521x_pb_match, pdev->dev.of_node);
> +	match = of_match_node(of_tps6521x_pb_match, dev->of_node);
>  	if (!match)
>  		return -ENXIO;
>  
> @@ -118,10 +117,9 @@ static int tps6521x_pb_probe(struct platform_device *pdev)
>  
>  	input_set_capability(idev, EV_KEY, KEY_POWER);
>  
> -	pwr->regmap = dev_get_regmap(pdev->dev.parent, NULL);
> +	pwr->regmap = dev_get_regmap(dev->parent, NULL);
>  	pwr->dev = dev;
>  	pwr->idev = idev;
> -	platform_set_drvdata(pdev, pwr);
>  	device_init_wakeup(dev, true);
>  
>  	irq = platform_get_irq(pdev, 0);
> @@ -136,8 +134,7 @@ static int tps6521x_pb_probe(struct platform_device *pdev)
>  						IRQF_ONESHOT,
>  					  pwr->data->name, pwr);
>  	if (error) {
> -		dev_err(dev, "failed to request IRQ #%d: %d\n",
> -			irq, error);
> +		dev_err(dev, "failed to request IRQ #%d: %d\n", irq, error);
>  		return error;
>  	}
>  
> -- 
> 2.7.4
> 

-- 
Dmitry

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 11/33] Input: ab8500-ponkey - Drop unnecessary call to platform_set_drvdata and other changes
  2017-01-18 17:46 ` [PATCH 11/33] Input: ab8500-ponkey " Guenter Roeck
@ 2017-01-18 19:45   ` Dmitry Torokhov
  0 siblings, 0 replies; 68+ messages in thread
From: Dmitry Torokhov @ 2017-01-18 19:45 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: linux-input, linux-kernel

On Wed, Jan 18, 2017 at 09:46:32AM -0800, Guenter Roeck wrote:
> There is no call to platform_get_drvdata() or dev_get_drvdata().
> Drop the unnecessary call to platform_set_drvdata().
> 
> This conversion was done automatically with coccinelle using the
> following semantic patches. The semantic patches and the scripts
> used to generate this commit log are available at
> https://github.com/groeck/coccinelle-patches
> 
> - Drop platform_set_drvdata()
> 
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>

Applied, thank you.

> ---
>  drivers/input/misc/ab8500-ponkey.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/input/misc/ab8500-ponkey.c b/drivers/input/misc/ab8500-ponkey.c
> index 4f5ef5bb535b..a33ed5710b15 100644
> --- a/drivers/input/misc/ab8500-ponkey.c
> +++ b/drivers/input/misc/ab8500-ponkey.c
> @@ -109,7 +109,6 @@ static int ab8500_ponkey_probe(struct platform_device *pdev)
>  		return error;
>  	}
>  
> -	platform_set_drvdata(pdev, ponkey);
>  	return 0;
>  }
>  
> -- 
> 2.7.4
> 

-- 
Dmitry

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 10/33] Input: twl4030_keypad - Drop unnecessary call to platform_set_drvdata and other changes
  2017-01-18 17:46 ` [PATCH 10/33] Input: twl4030_keypad " Guenter Roeck
@ 2017-01-18 19:45   ` Dmitry Torokhov
  0 siblings, 0 replies; 68+ messages in thread
From: Dmitry Torokhov @ 2017-01-18 19:45 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: linux-input, linux-kernel, Rui Teng

On Wed, Jan 18, 2017 at 09:46:31AM -0800, Guenter Roeck wrote:
> There is no call to platform_get_drvdata() or dev_get_drvdata().
> Drop the unnecessary call to platform_set_drvdata().
> 
> This conversion was done automatically with coccinelle using the
> following semantic patches. The semantic patches and the scripts
> used to generate this commit log are available at
> https://github.com/groeck/coccinelle-patches
> 
> - Drop platform_set_drvdata()
> 
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>

Applied, thank you.

> ---
>  drivers/input/keyboard/twl4030_keypad.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/input/keyboard/twl4030_keypad.c b/drivers/input/keyboard/twl4030_keypad.c
> index 323a0fb575a4..29396ca69416 100644
> --- a/drivers/input/keyboard/twl4030_keypad.c
> +++ b/drivers/input/keyboard/twl4030_keypad.c
> @@ -441,7 +441,6 @@ static int twl4030_kp_probe(struct platform_device *pdev)
>  		return -EIO;
>  	}
>  
> -	platform_set_drvdata(pdev, kp);
>  	return 0;
>  }
>  
> -- 
> 2.7.4
> 

-- 
Dmitry

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 28/33] Input: egalax_ts - Drop unnecessary call to i2c_set_clientdata and other changes
  2017-01-18 19:31   ` Dmitry Torokhov
@ 2017-01-18 20:32     ` Guenter Roeck
  0 siblings, 0 replies; 68+ messages in thread
From: Guenter Roeck @ 2017-01-18 20:32 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, linux-kernel

On Wed, Jan 18, 2017 at 11:31:54AM -0800, Dmitry Torokhov wrote:
> On Wed, Jan 18, 2017 at 09:46:49AM -0800, Guenter Roeck wrote:
> > There is no call to i2c_get_clientdata() or dev_get_drvdata().
> > Drop the unnecessary call to i2c_set_clientdata().
> > Other relevant changes:
> >   Simplify error return
> >   Drop error messages after memory allocation failures
> > 
> > This conversion was done automatically with coccinelle using the
> > following semantic patches. The semantic patches and the scripts
> > used to generate this commit log are available at
> > https://github.com/groeck/coccinelle-patches
> > 
> > - Drop unused variables
> > - Drop unnecessary braces around conditional return statements
> > - Drop error message after devm_kzalloc() failure
> > - Replace 'if (e) return e; return 0;' with 'return e;'
> > - Drop i2c_set_clientdata()
> > 
> > Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> > ---
> >  drivers/input/touchscreen/egalax_ts.c | 21 ++++-----------------
> >  1 file changed, 4 insertions(+), 17 deletions(-)
> > 
> > diff --git a/drivers/input/touchscreen/egalax_ts.c b/drivers/input/touchscreen/egalax_ts.c
> > index 1afc08b08155..05ba1a6dc7fc 100644
> > --- a/drivers/input/touchscreen/egalax_ts.c
> > +++ b/drivers/input/touchscreen/egalax_ts.c
> > @@ -82,10 +82,9 @@ static irqreturn_t egalax_ts_interrupt(int irq, void *dev_id)
> >  	if (ret < 0)
> >  		return IRQ_HANDLED;
> >  
> > -	if (buf[0] != REPORT_MODE_MTTOUCH) {
> > +	if (buf[0] != REPORT_MODE_MTTOUCH)
> >  		/* ignore mouse events and vendor events */
> >  		return IRQ_HANDLED;
> > -	}
> 
> These are not unnecessary braces, as there are more than 1 line. I.e.
> comments are counted along statements, at least by myself. Also, if
> there is a single statement spanning several lines I also prefer to have
> braces around it.
> 
Makes sense, and agreed. I'll have to figure out how to tell coccinelle about
situations like this.

> >  
> >  	state = buf[1];
> >  	x = (buf[3] << 8) | buf[2];
> > @@ -155,13 +154,8 @@ static int egalax_wake_up_device(struct i2c_client *client)
> >  static int egalax_firmware_version(struct i2c_client *client)
> >  {
> >  	static const u8 cmd[MAX_I2C_DATA_LEN] = { 0x03, 0x03, 0xa, 0x01, 0x41 };
> > -	int ret;
> > -
> > -	ret = i2c_master_send(client, cmd, MAX_I2C_DATA_LEN);
> > -	if (ret < 0)
> > -		return ret;
> >  
> > -	return 0;
> > +	return i2c_master_send(client, cmd, MAX_I2C_DATA_LEN);
> 
> This is not an equivalent transformation, as now callers need to check
> for negative return value instead of non-zero. i2c_master_send() returns
> number of bytes written on success.
> 

Oops, yes. Excellent point. I am way too agressive here. Thanks for pointing
this out.

Thanks,
Guenter

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 13/33] Input: bfin_rotary - Use 'dev' instead of dereferencing it and other changes
  2017-01-18 19:39   ` Dmitry Torokhov
@ 2017-01-18 20:35     ` Guenter Roeck
  2017-01-19  4:58       ` Joe Perches
  0 siblings, 1 reply; 68+ messages in thread
From: Guenter Roeck @ 2017-01-18 20:35 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, linux-kernel

On Wed, Jan 18, 2017 at 11:39:52AM -0800, Dmitry Torokhov wrote:
> On Wed, Jan 18, 2017 at 09:46:34AM -0800, Guenter Roeck wrote:
> > Use local variable 'dev' instead of dereferencing it several times.
> > Other relevant changes:
> >   Replace devm_add_action() with devm_add_action_or_reset()
> > 
> > This conversion was done automatically with coccinelle using the
> > following semantic patches. The semantic patches and the scripts
> > used to generate this commit log are available at
> > https://github.com/groeck/coccinelle-patches
> > 
> > - Replace devm_add_action() followed by failure action with
> >   devm_add_action_or_reset()
> > - Drop unnecessary braces around conditional return statements
> > - Use local variable 'struct device *dev' consistently
> > 
> > Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> > ---
> >  drivers/input/misc/bfin_rotary.c | 18 ++++++++----------
> >  1 file changed, 8 insertions(+), 10 deletions(-)
> > 
> > diff --git a/drivers/input/misc/bfin_rotary.c b/drivers/input/misc/bfin_rotary.c
> > index a0fc18fdfc0c..9f5790c6e06b 100644
> > --- a/drivers/input/misc/bfin_rotary.c
> > +++ b/drivers/input/misc/bfin_rotary.c
> > @@ -141,25 +141,23 @@ static int bfin_rotary_probe(struct platform_device *pdev)
> >  
> >  	/* Basic validation */
> >  	if ((pdata->rotary_up_key && !pdata->rotary_down_key) ||
> > -	    (!pdata->rotary_up_key && pdata->rotary_down_key)) {
> > +	    (!pdata->rotary_up_key && pdata->rotary_down_key))
> >  		return -EINVAL;
> > -	}
> 
> This is complex "if" statement, would prefer keep the braces.
> 
Agreed.

> >  
> >  	if (pdata->pin_list) {
> >  		error = peripheral_request_list(pdata->pin_list,
> > -						dev_name(&pdev->dev));
> > +						dev_name(dev));
> >  		if (error) {
> >  			dev_err(dev, "requesting peripherals failed: %d\n",
> >  				error);
> >  			return error;
> >  		}
> >  
> > -		error = devm_add_action(dev, bfin_rotary_free_action,
> > -					pdata->pin_list);
> > +		error = devm_add_action_or_reset(dev, bfin_rotary_free_action,
> > +						 pdata->pin_list);
> >  		if (error) {
> >  			dev_err(dev, "setting cleanup action failed: %d\n",
> >  				error);
> > -			peripheral_free_list(pdata->pin_list);
> >  			return error;
> >  		}
> >  	}
> > @@ -189,7 +187,7 @@ static int bfin_rotary_probe(struct platform_device *pdev)
> >  
> >  	input->name = pdev->name;
> >  	input->phys = "bfin-rotary/input0";
> > -	input->dev.parent = &pdev->dev;
> > +	input->dev.parent = dev;
> >  
> >  	input_set_drvdata(input, rotary);
> >  
> > @@ -224,8 +222,8 @@ static int bfin_rotary_probe(struct platform_device *pdev)
> >  		return -ENOENT;
> >  	}
> >  
> > -	error = devm_request_irq(dev, rotary->irq, bfin_rotary_isr,
> > -				 0, dev_name(dev), rotary);
> > +	error = devm_request_irq(dev, rotary->irq, bfin_rotary_isr, 0,
> > +				 dev_name(dev), rotary);
> 
> Do not see point of this change.
> 
Me fighting with coccinelle ;-). Diffficult to tell it to avoid non-changes
like this. I need to figure out to tell it to ...

> >  	if (error) {
> >  		dev_err(dev, "unable to claim irq %d; error %d\n",
> >  			rotary->irq, error);
> > @@ -239,7 +237,7 @@ static int bfin_rotary_probe(struct platform_device *pdev)
> >  	}
> >  
> >  	platform_set_drvdata(pdev, rotary);
> > -	device_init_wakeup(&pdev->dev, 1);
> > +	device_init_wakeup(dev, 1);

... only reformat a line when it is actually doing something on that line,
not on the entire function.

Thanks,
Guenter

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [PATCH 30/33] Input: raydium_i2c_ts - Simplify error return and other changes
  2017-01-18 17:46 [PATCH 00/33] Input: Automated coccinelle cleanup Guenter Roeck
                   ` (28 preceding siblings ...)
  2017-01-18 17:46 ` [PATCH 29/33] Input: melfas_mip4 - Use devm_add_action_or_reset " Guenter Roeck
@ 2017-01-18 20:36 ` Guenter Roeck
  2017-01-18 20:36   ` [PATCH 31/33] Input: rohm_bu21023 - Use 'dev' instead of dereferencing it " Guenter Roeck
                     ` (3 more replies)
  2017-01-19  1:42 ` [PATCH 00/33] Input: Automated coccinelle cleanup Joe Perches
  30 siblings, 4 replies; 68+ messages in thread
From: Guenter Roeck @ 2017-01-18 20:36 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: linux-input, linux-kernel, Guenter Roeck, Colin Ian King,
	Jeffrey Lin, Rob Herring

Simplify error return if the code returns anyway.
Other relevant changes:
  Replace devm_add_action() with devm_add_action_or_reset()

This conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts
used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches

- Replace devm_add_action() followed by failure action with
  devm_add_action_or_reset()
- Replace 'goto l; ... l: return e;' with 'return e;'
- Replace 'if (e) return e; return 0;' with 'return e;'

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/input/touchscreen/raydium_i2c_ts.c | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/drivers/input/touchscreen/raydium_i2c_ts.c b/drivers/input/touchscreen/raydium_i2c_ts.c
index 2658afa016c9..84507a882fa1 100644
--- a/drivers/input/touchscreen/raydium_i2c_ts.c
+++ b/drivers/input/touchscreen/raydium_i2c_ts.c
@@ -741,11 +741,7 @@ static int raydium_i2c_do_update_firmware(struct raydium_data *ts,
 
 	fw_checksum = raydium_calc_chksum(fw->data, fw->size);
 
-	error = raydium_i2c_write_checksum(client, fw->size, fw_checksum);
-	if (error)
-		return error;
-
-	return 0;
+	return raydium_i2c_write_checksum(client, fw->size, fw_checksum);
 }
 
 static int raydium_i2c_fw_update(struct raydium_data *ts)
@@ -831,12 +827,12 @@ static irqreturn_t raydium_i2c_irq(int irq, void *_dev)
 	u16 calc_crc;
 
 	if (ts->boot_mode != RAYDIUM_TS_MAIN)
-		goto out;
+		return IRQ_HANDLED;
 
 	error = raydium_i2c_read_message(ts->client, ts->data_bank_addr,
 					 ts->report_data, ts->pkg_size);
 	if (error)
-		goto out;
+		return IRQ_HANDLED;
 
 	fw_crc = get_unaligned_le16(&ts->report_data[ts->report_size]);
 	calc_crc = raydium_calc_chksum(ts->report_data, ts->report_size);
@@ -844,12 +840,11 @@ static irqreturn_t raydium_i2c_irq(int irq, void *_dev)
 		dev_warn(&ts->client->dev,
 			 "%s: invalid packet crc %#04x vs %#04x\n",
 			 __func__, calc_crc, fw_crc);
-		goto out;
+		return IRQ_HANDLED;
 	}
 
 	raydium_mt_event(ts);
 
-out:
 	return IRQ_HANDLED;
 }
 
@@ -1130,10 +1125,9 @@ static int raydium_i2c_probe(struct i2c_client *client,
 		return error;
 	}
 
-	error = devm_add_action(&client->dev,
-				raydium_i2c_remove_sysfs_group, ts);
+	error = devm_add_action_or_reset(&client->dev,
+					 raydium_i2c_remove_sysfs_group, ts);
 	if (error) {
-		raydium_i2c_remove_sysfs_group(ts);
 		dev_err(&client->dev,
 			"Failed to add sysfs cleanup action: %d\n", error);
 		return error;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 31/33] Input: rohm_bu21023 - Use 'dev' instead of dereferencing it and other changes
  2017-01-18 20:36 ` [PATCH 30/33] Input: raydium_i2c_ts - Simplify error return " Guenter Roeck
@ 2017-01-18 20:36   ` Guenter Roeck
  2017-01-18 20:36   ` [PATCH 32/33] Input: sis_i2c - Drop unnecessary call to i2c_set_clientdata " Guenter Roeck
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 68+ messages in thread
From: Guenter Roeck @ 2017-01-18 20:36 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, linux-kernel, Guenter Roeck

Use local variable 'dev' instead of dereferencing it several times.
Other relevant changes:
  Replace devm_add_action() with devm_add_action_or_reset()

This conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts
used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches

- Replace devm_add_action() followed by failure action with
  devm_add_action_or_reset()
- Use local variable 'struct device *dev' consistently

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/input/touchscreen/rohm_bu21023.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/input/touchscreen/rohm_bu21023.c b/drivers/input/touchscreen/rohm_bu21023.c
index 611156a2ef80..cce3ef94c1ab 100644
--- a/drivers/input/touchscreen/rohm_bu21023.c
+++ b/drivers/input/touchscreen/rohm_bu21023.c
@@ -1166,9 +1166,9 @@ static int rohm_bu21023_i2c_probe(struct i2c_client *client,
 		return error;
 	}
 
-	error = devm_request_threaded_irq(dev, client->irq,
-					  NULL, rohm_ts_soft_irq,
-					  IRQF_ONESHOT, client->name, ts);
+	error = devm_request_threaded_irq(dev, client->irq, NULL,
+					  rohm_ts_soft_irq, IRQF_ONESHOT,
+					  client->name, ts);
 	if (error) {
 		dev_err(dev, "failed to request IRQ: %d\n", error);
 		return error;
@@ -1186,11 +1186,9 @@ static int rohm_bu21023_i2c_probe(struct i2c_client *client,
 		return error;
 	}
 
-	error = devm_add_action(dev, rohm_ts_remove_sysfs_group, dev);
+	error = devm_add_action_or_reset(dev, rohm_ts_remove_sysfs_group, dev);
 	if (error) {
-		rohm_ts_remove_sysfs_group(dev);
-		dev_err(&client->dev,
-			"Failed to add sysfs cleanup action: %d\n",
+		dev_err(dev, "Failed to add sysfs cleanup action: %d\n",
 			error);
 		return error;
 	}
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 32/33] Input: sis_i2c - Drop unnecessary call to i2c_set_clientdata and other changes
  2017-01-18 20:36 ` [PATCH 30/33] Input: raydium_i2c_ts - Simplify error return " Guenter Roeck
  2017-01-18 20:36   ` [PATCH 31/33] Input: rohm_bu21023 - Use 'dev' instead of dereferencing it " Guenter Roeck
@ 2017-01-18 20:36   ` Guenter Roeck
  2017-01-18 22:27     ` Dmitry Torokhov
  2017-01-18 20:36   ` [PATCH 33/33] Input: sx8654 " Guenter Roeck
  2017-03-14  6:43   ` [PATCH 30/33] Input: raydium_i2c_ts - Simplify error return " Jeffrey Lin (林義章)
  3 siblings, 1 reply; 68+ messages in thread
From: Guenter Roeck @ 2017-01-18 20:36 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: linux-input, linux-kernel, Guenter Roeck, Mika Penttilä,
	Tammy Tseng, Yuger Yu

There is no call to i2c_get_clientdata() or dev_get_drvdata().
Drop the unnecessary call to i2c_set_clientdata().

This conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts
used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches

- Drop i2c_set_clientdata()

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/input/touchscreen/sis_i2c.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/input/touchscreen/sis_i2c.c b/drivers/input/touchscreen/sis_i2c.c
index 8d93f8c9a403..67c2563031d6 100644
--- a/drivers/input/touchscreen/sis_i2c.c
+++ b/drivers/input/touchscreen/sis_i2c.c
@@ -316,7 +316,6 @@ static int sis_ts_probe(struct i2c_client *client,
 		return -ENOMEM;
 
 	ts->client = client;
-	i2c_set_clientdata(client, ts);
 
 	ts->attn_gpio = devm_gpiod_get_optional(&client->dev,
 						"attn", GPIOD_IN);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 33/33] Input: sx8654 - Drop unnecessary call to i2c_set_clientdata and other changes
  2017-01-18 20:36 ` [PATCH 30/33] Input: raydium_i2c_ts - Simplify error return " Guenter Roeck
  2017-01-18 20:36   ` [PATCH 31/33] Input: rohm_bu21023 - Use 'dev' instead of dereferencing it " Guenter Roeck
  2017-01-18 20:36   ` [PATCH 32/33] Input: sis_i2c - Drop unnecessary call to i2c_set_clientdata " Guenter Roeck
@ 2017-01-18 20:36   ` Guenter Roeck
  2017-03-14  6:43   ` [PATCH 30/33] Input: raydium_i2c_ts - Simplify error return " Jeffrey Lin (林義章)
  3 siblings, 0 replies; 68+ messages in thread
From: Guenter Roeck @ 2017-01-18 20:36 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, linux-kernel, Guenter Roeck

There is no call to i2c_get_clientdata() or dev_get_drvdata().
Drop the unnecessary call to i2c_set_clientdata().
Other relevant changes:
  Simplify error return

This conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts
used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches

- Replace 'goto l; ... l: return e;' with 'return e;'
- Replace 'if (e) return e; return 0;' with 'return e;'
- Drop i2c_set_clientdata()

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/input/touchscreen/sx8654.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/input/touchscreen/sx8654.c b/drivers/input/touchscreen/sx8654.c
index 642f4a53de50..c6ce3352da21 100644
--- a/drivers/input/touchscreen/sx8654.c
+++ b/drivers/input/touchscreen/sx8654.c
@@ -89,7 +89,7 @@ static irqreturn_t sx8654_irq(int irq, void *handle)
 	dev_dbg(&sx8654->client->dev, "irqsrc = 0x%x", irqsrc);
 
 	if (irqsrc < 0)
-		goto out;
+		return IRQ_HANDLED;
 
 	if (irqsrc & IRQ_PENRELEASE) {
 		dev_dbg(&sx8654->client->dev, "pen release interrupt");
@@ -103,11 +103,11 @@ static irqreturn_t sx8654_irq(int irq, void *handle)
 
 		retval = i2c_master_recv(sx8654->client, data, sizeof(data));
 		if (retval != sizeof(data))
-			goto out;
+			return IRQ_HANDLED;
 
 		/* invalid data */
 		if (unlikely(data[0] & 0x80 || data[2] & 0x80))
-			goto out;
+			return IRQ_HANDLED;
 
 		x = ((data[0] & 0xf) << 8) | (data[1]);
 		y = ((data[2] & 0xf) << 8) | (data[3]);
@@ -120,7 +120,6 @@ static irqreturn_t sx8654_irq(int irq, void *handle)
 		dev_dbg(&sx8654->client->dev, "point(%4d,%4d)\n", x, y);
 	}
 
-out:
 	return IRQ_HANDLED;
 }
 
@@ -249,12 +248,7 @@ static int sx8654_probe(struct i2c_client *client,
 	/* Disable the IRQ, we'll enable it in sx8654_open() */
 	disable_irq(client->irq);
 
-	error = input_register_device(sx8654->input);
-	if (error)
-		return error;
-
-	i2c_set_clientdata(client, sx8654);
-	return 0;
+	return input_register_device(sx8654->input);
 }
 
 #ifdef CONFIG_OF
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* Re: [PATCH 32/33] Input: sis_i2c - Drop unnecessary call to i2c_set_clientdata and other changes
  2017-01-18 20:36   ` [PATCH 32/33] Input: sis_i2c - Drop unnecessary call to i2c_set_clientdata " Guenter Roeck
@ 2017-01-18 22:27     ` Dmitry Torokhov
  0 siblings, 0 replies; 68+ messages in thread
From: Dmitry Torokhov @ 2017-01-18 22:27 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: linux-input, linux-kernel, Mika Penttilä, Tammy Tseng, Yuger Yu

On Wed, Jan 18, 2017 at 12:36:49PM -0800, Guenter Roeck wrote:
> There is no call to i2c_get_clientdata() or dev_get_drvdata().
> Drop the unnecessary call to i2c_set_clientdata().
> 
> This conversion was done automatically with coccinelle using the
> following semantic patches. The semantic patches and the scripts
> used to generate this commit log are available at
> https://github.com/groeck/coccinelle-patches
> 
> - Drop i2c_set_clientdata()
> 
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>

Applied, thank you.

> ---
>  drivers/input/touchscreen/sis_i2c.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/input/touchscreen/sis_i2c.c b/drivers/input/touchscreen/sis_i2c.c
> index 8d93f8c9a403..67c2563031d6 100644
> --- a/drivers/input/touchscreen/sis_i2c.c
> +++ b/drivers/input/touchscreen/sis_i2c.c
> @@ -316,7 +316,6 @@ static int sis_ts_probe(struct i2c_client *client,
>  		return -ENOMEM;
>  
>  	ts->client = client;
> -	i2c_set_clientdata(client, ts);
>  
>  	ts->attn_gpio = devm_gpiod_get_optional(&client->dev,
>  						"attn", GPIOD_IN);
> -- 
> 2.7.4
> 

-- 
Dmitry

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 00/33] Input: Automated coccinelle cleanup
  2017-01-18 17:46 [PATCH 00/33] Input: Automated coccinelle cleanup Guenter Roeck
                   ` (29 preceding siblings ...)
  2017-01-18 20:36 ` [PATCH 30/33] Input: raydium_i2c_ts - Simplify error return " Guenter Roeck
@ 2017-01-19  1:42 ` Joe Perches
  2017-01-19  5:04   ` Guenter Roeck
  30 siblings, 1 reply; 68+ messages in thread
From: Joe Perches @ 2017-01-19  1:42 UTC (permalink / raw)
  To: Guenter Roeck, Dmitry Torokhov; +Cc: linux-input, linux-kernel

On Wed, 2017-01-18 at 09:46 -0800, Guenter Roeck wrote:
> The conversion was done automatically with coccinelle using several semantic
> patches. The semantic patches and the scripts used to generate this commit
> log are available at https://github.com/groeck/coccinelle-patches.

It'd be better to include the script in this 0/n patch
so that if github entry changes, the 0/n patch is useful.

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 08/33] Input: spear-keyboard - Drop unnecessary error messages and other changes
  2017-01-18 17:46 ` [PATCH 08/33] Input: spear-keyboard " Guenter Roeck
@ 2017-01-19  3:56   ` Viresh Kumar
  0 siblings, 0 replies; 68+ messages in thread
From: Viresh Kumar @ 2017-01-19  3:56 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: Dmitry Torokhov, linux-input, linux-kernel, Arnd Bergmann

On Wed, Jan 18, 2017 at 11:16 PM, Guenter Roeck <linux@roeck-us.net> wrote:
> Error messages after memory allocation failures are unnecessary and
> can be dropped.
>
> This conversion was done automatically with coccinelle using the
> following semantic patches. The semantic patches and the scripts
> used to generate this commit log are available at
> https://github.com/groeck/coccinelle-patches
>
> - Drop unnecessary braces around conditional return statements
> - Drop error message after devm_kzalloc() failure
>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---
>  drivers/input/keyboard/spear-keyboard.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 13/33] Input: bfin_rotary - Use 'dev' instead of dereferencing it and other changes
  2017-01-18 20:35     ` Guenter Roeck
@ 2017-01-19  4:58       ` Joe Perches
  2017-01-19  8:25         ` Guenter Roeck
  0 siblings, 1 reply; 68+ messages in thread
From: Joe Perches @ 2017-01-19  4:58 UTC (permalink / raw)
  To: Guenter Roeck, Dmitry Torokhov; +Cc: linux-input, linux-kernel

On Wed, 2017-01-18 at 12:35 -0800, Guenter Roeck wrote:
> On Wed, Jan 18, 2017 at 11:39:52AM -0800, Dmitry Torokhov wrote:
> > On Wed, Jan 18, 2017 at 09:46:34AM -0800, Guenter Roeck wrote:
[]
> > > diff --git a/drivers/input/misc/bfin_rotary.c b/drivers/input/misc/bfin_rotary.c
[]
> > > @@ -141,25 +141,23 @@ static int bfin_rotary_probe(struct platform_device *pdev)
> > >  
> > >  	/* Basic validation */
> > >  	if ((pdata->rotary_up_key && !pdata->rotary_down_key) ||
> > > -	    (!pdata->rotary_up_key && pdata->rotary_down_key)) {
> > > +	    (!pdata->rotary_up_key && pdata->rotary_down_key))

maybe just use ^ 

	if (!pdata->rotary_up_key ^ !pdata->rotary_down_key)

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 00/33] Input: Automated coccinelle cleanup
  2017-01-19  1:42 ` [PATCH 00/33] Input: Automated coccinelle cleanup Joe Perches
@ 2017-01-19  5:04   ` Guenter Roeck
  2017-01-19  5:06     ` Joe Perches
  0 siblings, 1 reply; 68+ messages in thread
From: Guenter Roeck @ 2017-01-19  5:04 UTC (permalink / raw)
  To: Joe Perches, Dmitry Torokhov; +Cc: linux-input, linux-kernel

On 01/18/2017 05:42 PM, Joe Perches wrote:
> On Wed, 2017-01-18 at 09:46 -0800, Guenter Roeck wrote:
>> The conversion was done automatically with coccinelle using several semantic
>> patches. The semantic patches and the scripts used to generate this commit
>> log are available at https://github.com/groeck/coccinelle-patches.
>
> It'd be better to include the script in this 0/n patch
> so that if github entry changes, the 0/n patch is useful.
>

For this set it would have been possible, though even the rules used here add
up to more than 1,000 lines. The underlying larger set (the one I am using
to generate devm transformations) currently has ~5,000 lines of coccinelle rules.
Are you sure you want to see that in an e-mail ? It might make more sense if I
add the reference SHA from the repository.

Thanks,
Guenter

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 00/33] Input: Automated coccinelle cleanup
  2017-01-19  5:04   ` Guenter Roeck
@ 2017-01-19  5:06     ` Joe Perches
  2017-01-19  8:19       ` Guenter Roeck
  0 siblings, 1 reply; 68+ messages in thread
From: Joe Perches @ 2017-01-19  5:06 UTC (permalink / raw)
  To: Guenter Roeck, Dmitry Torokhov; +Cc: linux-input, linux-kernel

On Wed, 2017-01-18 at 21:04 -0800, Guenter Roeck wrote:
> On 01/18/2017 05:42 PM, Joe Perches wrote:
> > On Wed, 2017-01-18 at 09:46 -0800, Guenter Roeck wrote:
> > > The conversion was done automatically with coccinelle using several semantic
> > > patches. The semantic patches and the scripts used to generate this commit
> > > log are available at https://github.com/groeck/coccinelle-patches.
> > 
> > It'd be better to include the script in this 0/n patch
> > so that if github entry changes, the 0/n patch is useful.
> > 
> For this set it would have been possible, though even the rules used here add
> up to more than 1,000 lines.

How many errors do you think are in the script?
1000+ lines, likely there 10+ errors/defects.

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 00/33] Input: Automated coccinelle cleanup
  2017-01-19  5:06     ` Joe Perches
@ 2017-01-19  8:19       ` Guenter Roeck
  0 siblings, 0 replies; 68+ messages in thread
From: Guenter Roeck @ 2017-01-19  8:19 UTC (permalink / raw)
  To: Joe Perches, Dmitry Torokhov; +Cc: linux-input, linux-kernel

On 01/18/2017 09:06 PM, Joe Perches wrote:
> On Wed, 2017-01-18 at 21:04 -0800, Guenter Roeck wrote:
>> On 01/18/2017 05:42 PM, Joe Perches wrote:
>>> On Wed, 2017-01-18 at 09:46 -0800, Guenter Roeck wrote:
>>>> The conversion was done automatically with coccinelle using several semantic
>>>> patches. The semantic patches and the scripts used to generate this commit
>>>> log are available at https://github.com/groeck/coccinelle-patches.
>>>
>>> It'd be better to include the script in this 0/n patch
>>> so that if github entry changes, the 0/n patch is useful.
>>>
>> For this set it would have been possible, though even the rules used here add
>> up to more than 1,000 lines.
>
> How many errors do you think are in the script?
> 1000+ lines, likely there 10+ errors/defects.
>

Most of it is to limit the scope to ensure that there are none, so in this case
the argument is a bit self-defeating.

Guenter

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 13/33] Input: bfin_rotary - Use 'dev' instead of dereferencing it and other changes
  2017-01-19  4:58       ` Joe Perches
@ 2017-01-19  8:25         ` Guenter Roeck
  0 siblings, 0 replies; 68+ messages in thread
From: Guenter Roeck @ 2017-01-19  8:25 UTC (permalink / raw)
  To: Joe Perches, Dmitry Torokhov; +Cc: linux-input, linux-kernel

On 01/18/2017 08:58 PM, Joe Perches wrote:
> On Wed, 2017-01-18 at 12:35 -0800, Guenter Roeck wrote:
>> On Wed, Jan 18, 2017 at 11:39:52AM -0800, Dmitry Torokhov wrote:
>>> On Wed, Jan 18, 2017 at 09:46:34AM -0800, Guenter Roeck wrote:
> []
>>>> diff --git a/drivers/input/misc/bfin_rotary.c b/drivers/input/misc/bfin_rotary.c
> []
>>>> @@ -141,25 +141,23 @@ static int bfin_rotary_probe(struct platform_device *pdev)
>>>>
>>>>  	/* Basic validation */
>>>>  	if ((pdata->rotary_up_key && !pdata->rotary_down_key) ||
>>>> -	    (!pdata->rotary_up_key && pdata->rotary_down_key)) {
>>>> +	    (!pdata->rotary_up_key && pdata->rotary_down_key))
>
> maybe just use ^
>
> 	if (!pdata->rotary_up_key ^ !pdata->rotary_down_key)
>
Interesting use case for a coccinelle rule.

To address the coccinelle related problem, I modified the rule to only apply
if the expression is in one line, and if the return statement is in the next
line. That works pretty well.

Guenter

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 12/33] Input: axp20x-pek - Use devm_add_action_or_reset and other changes
  2017-01-18 17:46 ` [PATCH 12/33] Input: axp20x-pek - Use devm_add_action_or_reset " Guenter Roeck
@ 2017-02-02  7:43   ` Chen-Yu Tsai
  0 siblings, 0 replies; 68+ messages in thread
From: Chen-Yu Tsai @ 2017-02-02  7:43 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: Dmitry Torokhov, linux-input, linux-kernel, Chen-Yu Tsai

On Thu, Jan 19, 2017 at 1:46 AM, Guenter Roeck <linux@roeck-us.net> wrote:
> Replace devm_add_action() followed by failure action with
> devm_add_action_or_reset()
>
> This conversion was done automatically with coccinelle using the
> following semantic patches. The semantic patches and the scripts
> used to generate this commit log are available at
> https://github.com/groeck/coccinelle-patches
>
> - Replace devm_add_action() followed by failure action with
>   devm_add_action_or_reset()
>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>

Acked-by: Chen-Yu Tsai <wens@csie.org>

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 09/33] Input: sun4i-lradc-keys - Drop unnecessary call to platform_set_drvdata and other changes
  2017-01-18 17:46   ` Guenter Roeck
@ 2017-02-02  7:45     ` Chen-Yu Tsai
  -1 siblings, 0 replies; 68+ messages in thread
From: Chen-Yu Tsai @ 2017-02-02  7:45 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Dmitry Torokhov, linux-input, linux-kernel, Chen-Yu Tsai,
	Hans de Goede, linux-arm-kernel, Maxime Ripard

On Thu, Jan 19, 2017 at 1:46 AM, Guenter Roeck <linux@roeck-us.net> wrote:
> There is no call to platform_get_drvdata() or dev_get_drvdata().
> Drop the unnecessary call to platform_set_drvdata().
> Other relevant changes:
>   Simplify error return
>
> This conversion was done automatically with coccinelle using the
> following semantic patches. The semantic patches and the scripts
> used to generate this commit log are available at
> https://github.com/groeck/coccinelle-patches
>
> - Replace 'if (e) return e; return 0;' with 'return e;'
> - Drop platform_set_drvdata()
>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>

Acked-by: Chen-Yu Tsai <wens@csie.org>

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [PATCH 09/33] Input: sun4i-lradc-keys - Drop unnecessary call to platform_set_drvdata and other changes
@ 2017-02-02  7:45     ` Chen-Yu Tsai
  0 siblings, 0 replies; 68+ messages in thread
From: Chen-Yu Tsai @ 2017-02-02  7:45 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jan 19, 2017 at 1:46 AM, Guenter Roeck <linux@roeck-us.net> wrote:
> There is no call to platform_get_drvdata() or dev_get_drvdata().
> Drop the unnecessary call to platform_set_drvdata().
> Other relevant changes:
>   Simplify error return
>
> This conversion was done automatically with coccinelle using the
> following semantic patches. The semantic patches and the scripts
> used to generate this commit log are available at
> https://github.com/groeck/coccinelle-patches
>
> - Replace 'if (e) return e; return 0;' with 'return e;'
> - Drop platform_set_drvdata()
>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>

Acked-by: Chen-Yu Tsai <wens@csie.org>

^ permalink raw reply	[flat|nested] 68+ messages in thread

* RE: [PATCH 30/33] Input: raydium_i2c_ts - Simplify error return and other changes
  2017-01-18 20:36 ` [PATCH 30/33] Input: raydium_i2c_ts - Simplify error return " Guenter Roeck
                     ` (2 preceding siblings ...)
  2017-01-18 20:36   ` [PATCH 33/33] Input: sx8654 " Guenter Roeck
@ 2017-03-14  6:43   ` Jeffrey Lin (林義章)
  3 siblings, 0 replies; 68+ messages in thread
From: Jeffrey Lin (林義章) @ 2017-03-14  6:43 UTC (permalink / raw)
  To: Guenter Roeck, Dmitry Torokhov
  Cc: linux-input, linux-kernel, Colin Ian King, Rob Herring

Hi sirs:
We're found raydium I2C driver not been kernel version v4.4, just found in v3.18. Should I commit again to V4.4??

Best Regards
----------------------------------------------------------------------
Jeffrey Lin,林義章
瑞鼎科技
Raydium Semiconductor Corporation
Tel:(03)666-1818 Ext.4163
Fax:(03)666-1919

-----Original Message-----
From: Guenter Roeck [mailto:linux@roeck-us.net]
Sent: Thursday, January 19, 2017 4:37 AM
To: Dmitry Torokhov
Cc: linux-input@vger.kernel.org; linux-kernel@vger.kernel.org; Guenter Roeck; Colin Ian King; Jeffrey Lin (林義章); Rob Herring
Subject: [PATCH 30/33] Input: raydium_i2c_ts - Simplify error return and other changes

Simplify error return if the code returns anyway.
Other relevant changes:
  Replace devm_add_action() with devm_add_action_or_reset()

This conversion was done automatically with coccinelle using the following semantic patches. The semantic patches and the scripts used to generate this commit log are available at https://github.com/groeck/coccinelle-patches

- Replace devm_add_action() followed by failure action with
  devm_add_action_or_reset()
- Replace 'goto l; ... l: return e;' with 'return e;'
- Replace 'if (e) return e; return 0;' with 'return e;'

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/input/touchscreen/raydium_i2c_ts.c | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/drivers/input/touchscreen/raydium_i2c_ts.c b/drivers/input/touchscreen/raydium_i2c_ts.c
index 2658afa016c9..84507a882fa1 100644
--- a/drivers/input/touchscreen/raydium_i2c_ts.c
+++ b/drivers/input/touchscreen/raydium_i2c_ts.c
@@ -741,11 +741,7 @@ static int raydium_i2c_do_update_firmware(struct raydium_data *ts,

        fw_checksum = raydium_calc_chksum(fw->data, fw->size);

-       error = raydium_i2c_write_checksum(client, fw->size, fw_checksum);
-       if (error)
-               return error;
-
-       return 0;
+       return raydium_i2c_write_checksum(client, fw->size, fw_checksum);
 }

 static int raydium_i2c_fw_update(struct raydium_data *ts) @@ -831,12 +827,12 @@ static irqreturn_t raydium_i2c_irq(int irq, void *_dev)
        u16 calc_crc;

        if (ts->boot_mode != RAYDIUM_TS_MAIN)
-               goto out;
+               return IRQ_HANDLED;

        error = raydium_i2c_read_message(ts->client, ts->data_bank_addr,
                                         ts->report_data, ts->pkg_size);
        if (error)
-               goto out;
+               return IRQ_HANDLED;

        fw_crc = get_unaligned_le16(&ts->report_data[ts->report_size]);
        calc_crc = raydium_calc_chksum(ts->report_data, ts->report_size); @@ -844,12 +840,11 @@ static irqreturn_t raydium_i2c_irq(int irq, void *_dev)
                dev_warn(&ts->client->dev,
                         "%s: invalid packet crc %#04x vs %#04x\n",
                         __func__, calc_crc, fw_crc);
-               goto out;
+               return IRQ_HANDLED;
        }

        raydium_mt_event(ts);

-out:
        return IRQ_HANDLED;
 }

@@ -1130,10 +1125,9 @@ static int raydium_i2c_probe(struct i2c_client *client,
                return error;
        }

-       error = devm_add_action(&client->dev,
-                               raydium_i2c_remove_sysfs_group, ts);
+       error = devm_add_action_or_reset(&client->dev,
+                                        raydium_i2c_remove_sysfs_group, ts);
        if (error) {
-               raydium_i2c_remove_sysfs_group(ts);
                dev_err(&client->dev,
                        "Failed to add sysfs cleanup action: %d\n", error);
                return error;
--
2.7.4

CONFIDENTIALITY AND PROPRIETARY REMINDER:
This message and any attachment may contain confidential information. All rights including intellectual property rights arising out of this correspondence shall belong to Raydium Semiconductor Corp. Any unauthorized disclosure, forwarding, using, modifying, spreading, publishing or copying this email and the content is illegal and strictly prohibited.
If you are not the intended recipient, please notify the sender by replying to this message and delete all copies of it from your system. Thank you for cooperation.

^ permalink raw reply related	[flat|nested] 68+ messages in thread

end of thread, other threads:[~2017-03-14  7:35 UTC | newest]

Thread overview: 68+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-18 17:46 [PATCH 00/33] Input: Automated coccinelle cleanup Guenter Roeck
2017-01-18 17:46 ` [PATCH 01/33] Input: adp5520-keys - Drop unnecessary error messages and other changes Guenter Roeck
2017-01-18 17:46 ` [PATCH 02/33] Input: bcm-keypad - Drop unnecessary call to platform_set_drvdata " Guenter Roeck
2017-01-18 17:46 ` [PATCH 03/33] Input: cap11xx - Drop unnecessary call to i2c_set_clientdata " Guenter Roeck
2017-01-18 17:46 ` [PATCH 04/33] Input: cros_ec_keyb - Drop unnecessary call to dev_set_drvdata " Guenter Roeck
2017-01-18 18:39   ` Dmitry Torokhov
2017-01-18 17:46 ` [PATCH 05/33] Input: imx_keypad - Drop unnecessary error messages " Guenter Roeck
2017-01-18 17:46 ` [PATCH 06/33] Input: samsung-keypad " Guenter Roeck
2017-01-18 17:46 ` [PATCH 07/33] Input: sh_keysc " Guenter Roeck
2017-01-18 17:46 ` [PATCH 08/33] Input: spear-keyboard " Guenter Roeck
2017-01-19  3:56   ` Viresh Kumar
2017-01-18 17:46 ` [PATCH 09/33] Input: sun4i-lradc-keys - Drop unnecessary call to platform_set_drvdata " Guenter Roeck
2017-01-18 17:46   ` Guenter Roeck
2017-02-02  7:45   ` Chen-Yu Tsai
2017-02-02  7:45     ` Chen-Yu Tsai
2017-01-18 17:46 ` [PATCH 10/33] Input: twl4030_keypad " Guenter Roeck
2017-01-18 19:45   ` Dmitry Torokhov
2017-01-18 17:46 ` [PATCH 11/33] Input: ab8500-ponkey " Guenter Roeck
2017-01-18 19:45   ` Dmitry Torokhov
2017-01-18 17:46 ` [PATCH 12/33] Input: axp20x-pek - Use devm_add_action_or_reset " Guenter Roeck
2017-02-02  7:43   ` Chen-Yu Tsai
2017-01-18 17:46 ` [PATCH 13/33] Input: bfin_rotary - Use 'dev' instead of dereferencing it " Guenter Roeck
2017-01-18 19:39   ` Dmitry Torokhov
2017-01-18 20:35     ` Guenter Roeck
2017-01-19  4:58       ` Joe Perches
2017-01-19  8:25         ` Guenter Roeck
2017-01-18 17:46 ` [PATCH 14/33] Input: gpio_decoder - Drop unnecessary call to platform_set_drvdata " Guenter Roeck
2017-01-18 19:40   ` Dmitry Torokhov
2017-01-18 17:46 ` [PATCH 15/33] Input: kxtj9 - Drop unnecessary error messages " Guenter Roeck
2017-01-18 17:46 ` [PATCH 16/33] Input: mma8450 - Drop unnecessary call to i2c_set_clientdata " Guenter Roeck
2017-01-18 19:41   ` Dmitry Torokhov
2017-01-18 17:46 ` [PATCH 17/33] Input: retu-pwrbutton - Simplify error return " Guenter Roeck
2017-01-18 17:46 ` [PATCH 18/33] Input: soc_button_array - Use 'dev' instead of dereferencing it " Guenter Roeck
2017-01-18 19:42   ` Dmitry Torokhov
2017-01-18 17:46 ` [PATCH 19/33] Input: tps65218-pwrbutton - Drop unnecessary call to platform_set_drvdata " Guenter Roeck
2017-01-18 19:44   ` Dmitry Torokhov
2017-01-18 17:46 ` [PATCH 20/33] Input: elan_i2c_core - Use 'dev' instead of dereferencing it " Guenter Roeck
2017-01-18 17:46 ` [PATCH 21/33] Input: arc_ps2 - Drop unnecessary error messages " Guenter Roeck
2017-01-18 17:46 ` [PATCH 22/33] Input: at32psif " Guenter Roeck
2017-01-18 19:13   ` Dmitry Torokhov
2017-01-18 17:46 ` [PATCH 23/33] Input: xilinx_ps2 - Use 'dev' instead of dereferencing it " Guenter Roeck
2017-01-18 17:46   ` Guenter Roeck
2017-01-18 17:46   ` Guenter Roeck
2017-01-18 19:17   ` Dmitry Torokhov
2017-01-18 19:17     ` Dmitry Torokhov
2017-01-18 19:17     ` Dmitry Torokhov
2017-01-18 17:46 ` [PATCH 24/33] Input: ar1021_i2c - Drop unnecessary call to i2c_set_clientdata " Guenter Roeck
2017-01-18 19:21   ` Dmitry Torokhov
2017-01-18 17:46 ` [PATCH 25/33] Input: atmel-wm97xx - Drop unnecessary error messages " Guenter Roeck
2017-01-18 19:23   ` Dmitry Torokhov
2017-01-18 17:46 ` [PATCH 26/33] Input: atmel_mxt_ts " Guenter Roeck
2017-01-18 17:46 ` [PATCH 27/33] Input: eeti_ts " Guenter Roeck
2017-01-18 19:26   ` Dmitry Torokhov
2017-01-18 17:46 ` [PATCH 28/33] Input: egalax_ts - Drop unnecessary call to i2c_set_clientdata " Guenter Roeck
2017-01-18 19:31   ` Dmitry Torokhov
2017-01-18 20:32     ` Guenter Roeck
2017-01-18 17:46 ` [PATCH 29/33] Input: melfas_mip4 - Use devm_add_action_or_reset " Guenter Roeck
2017-01-18 19:28   ` Dmitry Torokhov
2017-01-18 20:36 ` [PATCH 30/33] Input: raydium_i2c_ts - Simplify error return " Guenter Roeck
2017-01-18 20:36   ` [PATCH 31/33] Input: rohm_bu21023 - Use 'dev' instead of dereferencing it " Guenter Roeck
2017-01-18 20:36   ` [PATCH 32/33] Input: sis_i2c - Drop unnecessary call to i2c_set_clientdata " Guenter Roeck
2017-01-18 22:27     ` Dmitry Torokhov
2017-01-18 20:36   ` [PATCH 33/33] Input: sx8654 " Guenter Roeck
2017-03-14  6:43   ` [PATCH 30/33] Input: raydium_i2c_ts - Simplify error return " Jeffrey Lin (林義章)
2017-01-19  1:42 ` [PATCH 00/33] Input: Automated coccinelle cleanup Joe Perches
2017-01-19  5:04   ` Guenter Roeck
2017-01-19  5:06     ` Joe Perches
2017-01-19  8:19       ` Guenter Roeck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.