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


Groups > linux.kernel > #1564219

[PATCH 12/13] Input: serio - drop unnecessary calls to device_init_wakeup

From Guenter Roeck <linux@roeck-us.net>
Newsgroups linux.kernel
Subject [PATCH 12/13] Input: serio - drop unnecessary calls to device_init_wakeup
Date 2017-01-21 19:50 +0100
Message-ID <t28TF-7mg-35@gated-at.bofh.it> (permalink)
References <t28TE-7mg-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Calling device_init_wakeup in the remove function is unnecessary since the
device is going away, and thus won't be able to cause any wakeups under any
circumstances. Besides, the driver cleanup code already handles the
necessary cleanup.

Similar, disabling wakeup in the probe error path is unnecessary, as is
disabling wakeup in the probe function in the first place.

Changes were done automatically using the following coccinelle script.

@probe@
identifier p, probefn;
declarer name module_platform_driver_probe;
position pos;
@@
(
  module_platform_driver_probe(p, probefn@pos);
|
  struct platform_driver p = {
    .probe = probefn@pos,
  };
|
  struct i2c_driver p = {
    .probe = probefn@pos,
  };
|
  struct spi_driver p = {
    .probe = probefn@pos,
  };
)

@remove@
identifier p, removefn;
@@

  struct
(
  platform_driver
|
  i2c_driver
|
  spi_driver
|
  hv_driver
)
  p = {
    .remove = \(__exit_p(removefn)\|removefn\),
  };

@depends on remove@
identifier remove.removefn;
@@

removefn(...) {
<+...
- device_init_wakeup(...);
...+>
}

@depends on probe@
identifier probe.probefn;
expression dev;
@@

probefn(...) {
<+...
- device_init_wakeup(..., \(false\|0\));
  ...+>
}

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

diff --git a/drivers/input/serio/hyperv-keyboard.c b/drivers/input/serio/hyperv-keyboard.c
index c948866edf87..25151d9214e0 100644
--- a/drivers/input/serio/hyperv-keyboard.c
+++ b/drivers/input/serio/hyperv-keyboard.c
@@ -402,7 +402,6 @@ static int hv_kbd_remove(struct hv_device *hv_dev)
 {
 	struct hv_kbd_dev *kbd_dev = hv_get_drvdata(hv_dev);
 
-	device_init_wakeup(&hv_dev->device, false);
 	serio_unregister_port(kbd_dev->hv_serio);
 	vmbus_close(hv_dev->channel);
 	kfree(kbd_dev);
-- 
2.7.4

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/13] Input: Automated coccinelle cleanup (take 2) Guenter Roeck <linux@roeck-us.net> - 2017-01-21 19:50 +0100
  [PATCH 11/13] Input: touchscreen - drop unnecessary calls to device_init_wakeup Guenter Roeck <linux@roeck-us.net> - 2017-01-21 19:50 +0100
  [PATCH 10/13] Input: misc - drop unnecessary calls to device_init_wakeup Guenter Roeck <linux@roeck-us.net> - 2017-01-21 19:50 +0100
  [PATCH 08/13] Input: touchscreen - Use local variables consistently Guenter Roeck <linux@roeck-us.net> - 2017-01-21 19:50 +0100
  [PATCH 03/13] Input: touchscreen - Drop calls to platform_set_drvdata and i2c_set_clientdata Guenter Roeck <linux@roeck-us.net> - 2017-01-21 19:50 +0100
  [PATCH 13/13] Input: misc - drop empty remove functions Guenter Roeck <linux@roeck-us.net> - 2017-01-21 19:50 +0100
  [PATCH 02/13] Input: misc - Drop calls to platform_set_drvdata and i2c_set_clientdata Guenter Roeck <linux@roeck-us.net> - 2017-01-21 19:50 +0100
  [PATCH 01/13] Input: keyboard - Drop calls to platform_set_drvdata and i2c_set_clientdata Guenter Roeck <linux@roeck-us.net> - 2017-01-21 19:50 +0100
  [PATCH 09/13] Input: keyboard - drop unnecessary calls to device_init_wakeup Guenter Roeck <linux@roeck-us.net> - 2017-01-21 19:50 +0100
  [PATCH 05/13] Input: misc - Use local variables consistently Guenter Roeck <linux@roeck-us.net> - 2017-01-21 19:50 +0100
  [PATCH 04/13] Input: keyboard - Use local variables consistently Guenter Roeck <linux@roeck-us.net> - 2017-01-21 19:50 +0100
    Re: [PATCH 04/13] Input: keyboard - Use local variables consistently Linus Walleij <linus.walleij@linaro.org> - 2017-01-26 11:40 +0100
      Re: [PATCH 04/13] Input: keyboard - Use local variables consistently Guenter Roeck <linux@roeck-us.net> - 2017-01-26 15:30 +0100
      Re: [PATCH 04/13] Input: keyboard - Use local variables consistently Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-01-26 20:00 +0100
  [PATCH 12/13] Input: serio - drop unnecessary calls to device_init_wakeup Guenter Roeck <linux@roeck-us.net> - 2017-01-21 19:50 +0100
  [PATCH 06/13] Input: mouse  Use local variables consistently Guenter Roeck <linux@roeck-us.net> - 2017-01-21 19:50 +0100
  Re: [PATCH 00/13] Input: Automated coccinelle cleanup (take 2) Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-01-22 09:40 +0100

csiph-web