Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1562000 > unrolled thread

[PATCH 00/33] Input: Automated coccinelle cleanup

Started byGuenter Roeck <linux@roeck-us.net>
First post2017-01-18 18:50 +0100
Last post2017-01-19 10:20 +0100
Articles 20 on this page of 54 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 00/33] Input: Automated coccinelle cleanup Guenter Roeck <linux@roeck-us.net> - 2017-01-18 18:50 +0100
    [PATCH 02/33] Input: bcm-keypad - Drop unnecessary call to platform_set_drvdata and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 18:50 +0100
    [PATCH 29/33] Input: melfas_mip4 - Use devm_add_action_or_reset and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 18:50 +0100
      Re: [PATCH 29/33] Input: melfas_mip4 - Use devm_add_action_or_reset  and other changes Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-01-18 20:30 +0100
    [PATCH 04/33] Input: cros_ec_keyb - Drop unnecessary call to dev_set_drvdata and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 18:50 +0100
      Re: [PATCH 04/33] Input: cros_ec_keyb - Drop unnecessary call to  dev_set_drvdata and other changes Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-01-18 19:40 +0100
    [PATCH 23/33] Input: xilinx_ps2 - Use 'dev' instead of dereferencing it and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 19:00 +0100
      Re: [PATCH 23/33] Input: xilinx_ps2 - Use 'dev' instead of  dereferencing it and other changes Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-01-18 20:30 +0100
    [PATCH 12/33] Input: axp20x-pek - Use devm_add_action_or_reset and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 19:00 +0100
    [PATCH 20/33] Input: elan_i2c_core - Use 'dev' instead of dereferencing it and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 19:00 +0100
    [PATCH 22/33] Input: at32psif - Drop unnecessary error messages and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 19:00 +0100
      Re: [PATCH 22/33] Input: at32psif - Drop unnecessary error messages  and other changes Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-01-18 20:20 +0100
    [PATCH 10/33] Input: twl4030_keypad - Drop unnecessary call to platform_set_drvdata and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 19:00 +0100
      Re: [PATCH 10/33] Input: twl4030_keypad - Drop unnecessary call to  platform_set_drvdata and other changes Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-01-18 20:50 +0100
    [PATCH 14/33] Input: gpio_decoder - Drop unnecessary call to platform_set_drvdata and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 19:00 +0100
      Re: [PATCH 14/33] Input: gpio_decoder - Drop unnecessary call to  platform_set_drvdata and other changes Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-01-18 20:50 +0100
    [PATCH 15/33] Input: kxtj9 - Drop unnecessary error messages and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 19:00 +0100
    [PATCH 27/33] Input: eeti_ts - Drop unnecessary error messages and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 19:00 +0100
      Re: [PATCH 27/33] Input: eeti_ts - Drop unnecessary error messages  and other changes Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-01-18 20:30 +0100
    [PATCH 08/33] Input: spear-keyboard - Drop unnecessary error messages and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 19:00 +0100
      Re: [PATCH 08/33] Input: spear-keyboard - Drop unnecessary error  messages and other changes Viresh Kumar <viresh.kumar@linaro.org> - 2017-01-19 05:00 +0100
    [PATCH 19/33] Input: tps65218-pwrbutton - Drop unnecessary call to platform_set_drvdata and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 19:00 +0100
      Re: [PATCH 19/33] Input: tps65218-pwrbutton - Drop unnecessary call  to platform_set_drvdata and other changes Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-01-18 20:50 +0100
    [PATCH 07/33] Input: sh_keysc - Drop unnecessary error messages and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 19:00 +0100
    [PATCH 28/33] Input: egalax_ts - Drop unnecessary call to i2c_set_clientdata and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 19:00 +0100
      Re: [PATCH 28/33] Input: egalax_ts - Drop unnecessary call to  i2c_set_clientdata and other changes Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-01-18 20:40 +0100
        Re: [PATCH 28/33] Input: egalax_ts - Drop unnecessary call to  i2c_set_clientdata and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 21:40 +0100
    [PATCH 11/33] Input: ab8500-ponkey - Drop unnecessary call to platform_set_drvdata and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 19:00 +0100
      Re: [PATCH 11/33] Input: ab8500-ponkey - Drop unnecessary call to  platform_set_drvdata and other changes Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-01-18 20:50 +0100
    [PATCH 17/33] Input: retu-pwrbutton - Simplify error return and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 19:00 +0100
    [PATCH 13/33] Input: bfin_rotary - Use 'dev' instead of dereferencing it and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 19:00 +0100
      Re: [PATCH 13/33] Input: bfin_rotary - Use 'dev' instead of  dereferencing it and other changes Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-01-18 20:50 +0100
        Re: [PATCH 13/33] Input: bfin_rotary - Use 'dev' instead of  dereferencing it and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 21:40 +0100
          Re: [PATCH 13/33] Input: bfin_rotary - Use 'dev' instead of  dereferencing it and other changes Joe Perches <joe@perches.com> - 2017-01-19 06:10 +0100
            Re: [PATCH 13/33] Input: bfin_rotary - Use 'dev' instead of  dereferencing it and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-19 09:30 +0100
    [PATCH 25/33] Input: atmel-wm97xx - Drop unnecessary error messages and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 19:00 +0100
      Re: [PATCH 25/33] Input: atmel-wm97xx - Drop unnecessary error  messages and other changes Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-01-18 20:30 +0100
    [PATCH 09/33] Input: sun4i-lradc-keys - Drop unnecessary call to platform_set_drvdata and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 19:00 +0100
    [PATCH 16/33] Input: mma8450 - Drop unnecessary call to i2c_set_clientdata and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 19:00 +0100
      Re: [PATCH 16/33] Input: mma8450 - Drop unnecessary call to  i2c_set_clientdata and other changes Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-01-18 20:50 +0100
    [PATCH 18/33] Input: soc_button_array - Use 'dev' instead of dereferencing it and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 19:00 +0100
      Re: [PATCH 18/33] Input: soc_button_array - Use 'dev' instead of  dereferencing it and other changes Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-01-18 20:50 +0100
    [PATCH 26/33] Input: atmel_mxt_ts - Drop unnecessary error messages and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 19:00 +0100
    [PATCH 24/33] Input: ar1021_i2c - Drop unnecessary call to i2c_set_clientdata and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 19:00 +0100
      Re: [PATCH 24/33] Input: ar1021_i2c - Drop unnecessary call to  i2c_set_clientdata and other changes Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-01-18 20:30 +0100
    [PATCH 32/33] Input: sis_i2c - Drop unnecessary call to i2c_set_clientdata and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 21:40 +0100
      Re: [PATCH 32/33] Input: sis_i2c - Drop unnecessary call to  i2c_set_clientdata and other changes Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-01-18 23:30 +0100
    [PATCH 33/33] Input: sx8654 - Drop unnecessary call to i2c_set_clientdata and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 21:40 +0100
    [PATCH 31/33] Input: rohm_bu21023 - Use 'dev' instead of dereferencing it and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 21:40 +0100
    [PATCH 30/33] Input: raydium_i2c_ts - Simplify error return and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 21:40 +0100
    Re: [PATCH 00/33] Input: Automated coccinelle cleanup Joe Perches <joe@perches.com> - 2017-01-19 02:50 +0100
      Re: [PATCH 00/33] Input: Automated coccinelle cleanup Guenter Roeck <linux@roeck-us.net> - 2017-01-19 06:10 +0100
        Re: [PATCH 00/33] Input: Automated coccinelle cleanup Joe Perches <joe@perches.com> - 2017-01-19 06:10 +0100
          Re: [PATCH 00/33] Input: Automated coccinelle cleanup Guenter Roeck <linux@roeck-us.net> - 2017-01-19 10:20 +0100

Page 1 of 3  [1] 2 3  Next page →


#1562000 — [PATCH 00/33] Input: Automated coccinelle cleanup

FromGuenter Roeck <linux@roeck-us.net>
Date2017-01-18 18:50 +0100
Subject[PATCH 00/33] Input: Automated coccinelle cleanup
Message-ID<t12wV-72O-9@gated-at.bofh.it>
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(-)

[toc] | [next] | [standalone]


#1562001 — [PATCH 02/33] Input: bcm-keypad - Drop unnecessary call to platform_set_drvdata and other changes

FromGuenter Roeck <linux@roeck-us.net>
Date2017-01-18 18:50 +0100
Subject[PATCH 02/33] Input: bcm-keypad - Drop unnecessary call to platform_set_drvdata and other changes
Message-ID<t12wW-72O-39@gated-at.bofh.it>
In reply to#1562000
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

[toc] | [prev] | [next] | [standalone]


#1562003 — [PATCH 29/33] Input: melfas_mip4 - Use devm_add_action_or_reset and other changes

FromGuenter Roeck <linux@roeck-us.net>
Date2017-01-18 18:50 +0100
Subject[PATCH 29/33] Input: melfas_mip4 - Use devm_add_action_or_reset and other changes
Message-ID<t12wW-72O-31@gated-at.bofh.it>
In reply to#1562000
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

[toc] | [prev] | [next] | [standalone]


#1562096 — Re: [PATCH 29/33] Input: melfas_mip4 - Use devm_add_action_or_reset and other changes

FromDmitry Torokhov <dmitry.torokhov@gmail.com>
Date2017-01-18 20:30 +0100
SubjectRe: [PATCH 29/33] Input: melfas_mip4 - Use devm_add_action_or_reset and other changes
Message-ID<t145H-86O-15@gated-at.bofh.it>
In reply to#1562003
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

[toc] | [prev] | [next] | [standalone]


#1562005 — [PATCH 04/33] Input: cros_ec_keyb - Drop unnecessary call to dev_set_drvdata and other changes

FromGuenter Roeck <linux@roeck-us.net>
Date2017-01-18 18:50 +0100
Subject[PATCH 04/33] Input: cros_ec_keyb - Drop unnecessary call to dev_set_drvdata and other changes
Message-ID<t12wW-72O-35@gated-at.bofh.it>
In reply to#1562000
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

[toc] | [prev] | [next] | [standalone]


#1562049 — Re: [PATCH 04/33] Input: cros_ec_keyb - Drop unnecessary call to dev_set_drvdata and other changes

FromDmitry Torokhov <dmitry.torokhov@gmail.com>
Date2017-01-18 19:40 +0100
SubjectRe: [PATCH 04/33] Input: cros_ec_keyb - Drop unnecessary call to dev_set_drvdata and other changes
Message-ID<t13jj-7zO-1@gated-at.bofh.it>
In reply to#1562005
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

[toc] | [prev] | [next] | [standalone]


#1562008 — [PATCH 23/33] Input: xilinx_ps2 - Use 'dev' instead of dereferencing it and other changes

FromGuenter Roeck <linux@roeck-us.net>
Date2017-01-18 19:00 +0100
Subject[PATCH 23/33] Input: xilinx_ps2 - Use 'dev' instead of dereferencing it and other changes
Message-ID<t12GB-76Z-1@gated-at.bofh.it>
In reply to#1562000
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

[toc] | [prev] | [next] | [standalone]


#1562095 — Re: [PATCH 23/33] Input: xilinx_ps2 - Use 'dev' instead of dereferencing it and other changes

FromDmitry Torokhov <dmitry.torokhov@gmail.com>
Date2017-01-18 20:30 +0100
SubjectRe: [PATCH 23/33] Input: xilinx_ps2 - Use 'dev' instead of dereferencing it and other changes
Message-ID<t145H-86O-1@gated-at.bofh.it>
In reply to#1562008
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

[toc] | [prev] | [next] | [standalone]


#1562009 — [PATCH 12/33] Input: axp20x-pek - Use devm_add_action_or_reset and other changes

FromGuenter Roeck <linux@roeck-us.net>
Date2017-01-18 19:00 +0100
Subject[PATCH 12/33] Input: axp20x-pek - Use devm_add_action_or_reset and other changes
Message-ID<t12GC-76Z-9@gated-at.bofh.it>
In reply to#1562000
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

[toc] | [prev] | [next] | [standalone]


#1562010 — [PATCH 20/33] Input: elan_i2c_core - Use 'dev' instead of dereferencing it and other changes

FromGuenter Roeck <linux@roeck-us.net>
Date2017-01-18 19:00 +0100
Subject[PATCH 20/33] Input: elan_i2c_core - Use 'dev' instead of dereferencing it and other changes
Message-ID<t12GB-76Z-3@gated-at.bofh.it>
In reply to#1562000
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

[toc] | [prev] | [next] | [standalone]


#1562011 — [PATCH 22/33] Input: at32psif - Drop unnecessary error messages and other changes

FromGuenter Roeck <linux@roeck-us.net>
Date2017-01-18 19:00 +0100
Subject[PATCH 22/33] Input: at32psif - Drop unnecessary error messages and other changes
Message-ID<t12GC-76Z-13@gated-at.bofh.it>
In reply to#1562000
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

[toc] | [prev] | [next] | [standalone]


#1562089 — Re: [PATCH 22/33] Input: at32psif - Drop unnecessary error messages and other changes

FromDmitry Torokhov <dmitry.torokhov@gmail.com>
Date2017-01-18 20:20 +0100
SubjectRe: [PATCH 22/33] Input: at32psif - Drop unnecessary error messages and other changes
Message-ID<t13W3-83l-39@gated-at.bofh.it>
In reply to#1562011
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

[toc] | [prev] | [next] | [standalone]


#1562012 — [PATCH 10/33] Input: twl4030_keypad - Drop unnecessary call to platform_set_drvdata and other changes

FromGuenter Roeck <linux@roeck-us.net>
Date2017-01-18 19:00 +0100
Subject[PATCH 10/33] Input: twl4030_keypad - Drop unnecessary call to platform_set_drvdata and other changes
Message-ID<t12GC-76Z-15@gated-at.bofh.it>
In reply to#1562000
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

[toc] | [prev] | [next] | [standalone]


#1562112 — Re: [PATCH 10/33] Input: twl4030_keypad - Drop unnecessary call to platform_set_drvdata and other changes

FromDmitry Torokhov <dmitry.torokhov@gmail.com>
Date2017-01-18 20:50 +0100
SubjectRe: [PATCH 10/33] Input: twl4030_keypad - Drop unnecessary call to platform_set_drvdata and other changes
Message-ID<t14p4-8e2-5@gated-at.bofh.it>
In reply to#1562012
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

[toc] | [prev] | [next] | [standalone]


#1562013 — [PATCH 14/33] Input: gpio_decoder - Drop unnecessary call to platform_set_drvdata and other changes

FromGuenter Roeck <linux@roeck-us.net>
Date2017-01-18 19:00 +0100
Subject[PATCH 14/33] Input: gpio_decoder - Drop unnecessary call to platform_set_drvdata and other changes
Message-ID<t12GC-76Z-19@gated-at.bofh.it>
In reply to#1562000
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

[toc] | [prev] | [next] | [standalone]


#1562115 — Re: [PATCH 14/33] Input: gpio_decoder - Drop unnecessary call to platform_set_drvdata and other changes

FromDmitry Torokhov <dmitry.torokhov@gmail.com>
Date2017-01-18 20:50 +0100
SubjectRe: [PATCH 14/33] Input: gpio_decoder - Drop unnecessary call to platform_set_drvdata and other changes
Message-ID<t14p4-8e2-17@gated-at.bofh.it>
In reply to#1562013
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

[toc] | [prev] | [next] | [standalone]


#1562014 — [PATCH 15/33] Input: kxtj9 - Drop unnecessary error messages and other changes

FromGuenter Roeck <linux@roeck-us.net>
Date2017-01-18 19:00 +0100
Subject[PATCH 15/33] Input: kxtj9 - Drop unnecessary error messages and other changes
Message-ID<t12GC-76Z-21@gated-at.bofh.it>
In reply to#1562000
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

[toc] | [prev] | [next] | [standalone]


#1562015 — [PATCH 27/33] Input: eeti_ts - Drop unnecessary error messages and other changes

FromGuenter Roeck <linux@roeck-us.net>
Date2017-01-18 19:00 +0100
Subject[PATCH 27/33] Input: eeti_ts - Drop unnecessary error messages and other changes
Message-ID<t12GC-76Z-23@gated-at.bofh.it>
In reply to#1562000
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

[toc] | [prev] | [next] | [standalone]


#1562100 — Re: [PATCH 27/33] Input: eeti_ts - Drop unnecessary error messages and other changes

FromDmitry Torokhov <dmitry.torokhov@gmail.com>
Date2017-01-18 20:30 +0100
SubjectRe: [PATCH 27/33] Input: eeti_ts - Drop unnecessary error messages and other changes
Message-ID<t145H-86O-9@gated-at.bofh.it>
In reply to#1562015
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

[toc] | [prev] | [next] | [standalone]


#1562016 — [PATCH 08/33] Input: spear-keyboard - Drop unnecessary error messages and other changes

FromGuenter Roeck <linux@roeck-us.net>
Date2017-01-18 19:00 +0100
Subject[PATCH 08/33] Input: spear-keyboard - Drop unnecessary error messages and other changes
Message-ID<t12GC-76Z-29@gated-at.bofh.it>
In reply to#1562000
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

[toc] | [prev] | [next] | [standalone]


Page 1 of 3  [1] 2 3  Next page →

Back to top | Article view | linux.kernel


csiph-web