From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
Keerthy <j-keerthy@ti.com>, Lee Jones <lee.jones@linaro.org>,
Marcin Niestroj <m.niestroj@grinn-global.com>
Subject: Re: [PATCH 19/33] Input: tps65218-pwrbutton - Drop unnecessary call to platform_set_drvdata and other changes
Date: Wed, 18 Jan 2017 11:44:11 -0800 [thread overview]
Message-ID: <20170118194411.GK33920@dtor-ws> (raw)
In-Reply-To: <1484761614-12225-20-git-send-email-linux@roeck-us.net>
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, ®);
> 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
next prev parent reply other threads:[~2017-01-18 19:44 UTC|newest]
Thread overview: 62+ messages / expand[flat|nested] mbox.gz Atom feed top
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-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 [this message]
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 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170118194411.GK33920@dtor-ws \
--to=dmitry.torokhov@gmail.com \
--cc=j-keerthy@ti.com \
--cc=lee.jones@linaro.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=m.niestroj@grinn-global.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).