Input: Automated coccinelle cleanup (take 2)
Subsystems (15)
PATCH 1/13 Input: keyboard - Drop calls to platform_set_drvdata and i2c_set_clientdata
In reply to Guenter RoeckThere is no call to i2c_get_clientdata(), platform_get_drvdata(), or dev_get_drvdata() in any of the drivers in this patch. Drop the unnecessary calls to to i2c_set_clientdata() and platform_set_drvdata().
This conversion was done automatically with coccinelle. The semantic patch is available at
https://github.com/groeck/coccinelle-patches/blob/master/common/pdev.cocci
--- drivers/input/keyboard/adc-keys.c | 2 -- drivers/input/keyboard/cap11xx.c | 1 - drivers/input/keyboard/gpio_keys_polled.c | 1 - drivers/input/keyboard/jornada680_kbd.c | 2 -- drivers/input/keyboard/max7359_keypad.c | 1 - drivers/input/keyboard/nspire-keypad.c | 2 -- drivers/input/keyboard/opencores-kbd.c | 2 -- drivers/input/keyboard/sun4i-lradc-keys.c | 1 - 8 files changed, 12 deletions(-)
drivers/input/keyboard/adc-keys.c +0 -2
@@ -148,8 +148,6 @@ static int adc_keys_probe(struct platform_device *pdev)if (error)return error; -platform_set_drvdata (pdev, st); - poll_dev =devm_input_allocate_polled_device (dev);if (!poll_dev) {dev_err (dev,"failed to allocate input device\n" );
drivers/input/keyboard/cap11xx.c +0 -1
@@ -392,7 +392,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)) {
drivers/input/keyboard/gpio_keys_polled.c +0 -1
@@ -365,7 +365,6 @@ static int gpio_keys_polled_probe(struct platform_device *pdev) bdev->poll_dev = poll_dev; bdev->dev = dev; bdev->pdata = pdata; -platform_set_drvdata (pdev, bdev); error =input_register_polled_device (poll_dev);if (error) {
drivers/input/keyboard/jornada680_kbd.c +0 -2
@@ -197,8 +197,6 @@ static int jornada680kbd_probe(struct platform_device *pdev)return -ENOMEM ; } -platform_set_drvdata (pdev, jornadakbd); - jornadakbd->poll_dev = poll_dev; memcpy(jornadakbd->keymap, jornada_scancodes,
drivers/input/keyboard/max7359_keypad.c +0 -1
@@ -241,7 +241,6 @@ static int max7359_probe(struct i2c_client *client,/* Initialize MAX7359 */ max7359_initialize (client); -i2c_set_clientdata (client, keypad);device_init_wakeup (&client->dev,1 );return 0 ;
drivers/input/keyboard/nspire-keypad.c +0 -2
@@ -249,8 +249,6 @@ static int nspire_keypad_probe(struct platform_device *pdev)return error; } -platform_set_drvdata (pdev, keypad); - dev_dbg(&pdev->dev, "TI-NSPIRE keypad at %pR (scan_interval=%uus, row_delay=%uus%s)\n", res, keypad->row_delay, keypad->scan_interval,
drivers/input/keyboard/opencores-kbd.c +0 -2
@@ -112,8 +112,6 @@ static int opencores_kbd_probe(struct platform_device *pdev)return error; } -platform_set_drvdata (pdev, opencores_kbd); -return 0 ; }
drivers/input/keyboard/sun4i-lradc-keys.c +0 -1
@@ -261,7 +261,6 @@ static int sun4i_lradc_probe(struct platform_device *pdev)if (error)return error; -platform_set_drvdata (pdev, lradc);return 0 ; }
Signature · 1 line
2.7.4
PATCH 3/13 Input: touchscreen - Drop calls to platform_set_drvdata and i2c_set_clientdata
In reply to Guenter RoeckThere is no call to i2c_get_clientdata(), platform_get_drvdata(), or dev_get_drvdata() in any of the drivers in this patch. Drop the unnecessary calls to to i2c_set_clientdata() and platform_set_drvdata().
This conversion was done automatically with coccinelle. The semantic patch is available at
https://github.com/groeck/coccinelle-patches/blob/master/common/pdev.cocci
--- drivers/input/touchscreen/88pm860x-ts.c | 3 --- drivers/input/touchscreen/colibri-vf50-ts.c | 2 -- drivers/input/touchscreen/egalax_ts.c | 1 - drivers/input/touchscreen/max11801_ts.c | 1 - drivers/input/touchscreen/sx8654.c | 1 - 5 files changed, 8 deletions(-)
drivers/input/touchscreen/88pm860x-ts.c +0 -3
@@ -240,8 +240,6 @@ static int pm860x_touch_probe(struct platform_device *pdev)if (!touch)return -ENOMEM ; -platform_set_drvdata (pdev, touch); - touch->idev =devm_input_allocate_device (&pdev->dev);if (!touch->idev) {dev_err (&pdev->dev,"Failed to allocate input device!\n" );
@@ -285,7 +283,6 @@ static int pm860x_touch_probe(struct platform_device *pdev)return ret; } -platform_set_drvdata (pdev, touch);return 0 ; }
drivers/input/touchscreen/colibri-vf50-ts.c +0 -2
@@ -311,8 +311,6 @@ static int vf50_ts_probe(struct platform_device *pdev)return -ENOMEM ; } -platform_set_drvdata (pdev, touchdev); - input->name =DRIVER_NAME ; input->id.bustype =BUS_HOST ; input->dev.parent = dev;
drivers/input/touchscreen/egalax_ts.c +0 -1
@@ -229,7 +229,6 @@ static int egalax_ts_probe(struct i2c_client *client,if (error)return error; -i2c_set_clientdata (client, ts);return 0 ; }
drivers/input/touchscreen/max11801_ts.c +0 -1
@@ -216,7 +216,6 @@ static int max11801_ts_probe(struct i2c_client *client,if (error)return error; -i2c_set_clientdata (client, data);return 0 ; }
drivers/input/touchscreen/sx8654.c +0 -1
@@ -253,7 +253,6 @@ static int sx8654_probe(struct i2c_client *client,if (error)return error; -i2c_set_clientdata (client, sx8654);return 0 ; }
Signature · 1 line
2.7.4
PATCH 8/13 Input: touchscreen - Use local variables consistently
In reply to Guenter RoeckIf a function declares a variable to access a structure element, use it conssistently.
The conversion was done automatically with coccinelle using the following semantic patch.
// Catch function parameters.
// Handle those first to trigger reformatting.
@@
identifier d;
identifier fn;
identifier svar;
identifier elem;
type T;
identifier i;
expression e;
identifier fn;
expression list es;
@@
fn(...) {
...
T d = &svar->elem;
<... when != d = e;
- fn(&svar->elem, es)
+ fn(d, es)
...> }
// Now address non-functions and multiple transformations in function // parameters.
@@
identifier d;
identifier fn;
identifier svar;
identifier elem;
type T;
identifier i;
expression e;
@@
fn(...) {
...
T d = &svar->elem;
<... when != d = e;
(
- &svar->elem
+ d
|
- svar->elem.i
+ d->i
)
...> }
--- drivers/input/touchscreen/atmel_mxt_ts.c | 2 +- drivers/input/touchscreen/fsl-imx25-tcq.c | 2 +- drivers/input/touchscreen/ili210x.c | 2 +- drivers/input/touchscreen/pixcir_i2c_ts.c | 4 ++-- drivers/input/touchscreen/rohm_bu21023.c | 3 +-- drivers/input/touchscreen/s3c2410_ts.c | 2 +- 6 files changed, 7 insertions(+), 8 deletions(-)
drivers/input/touchscreen/atmel_mxt_ts.c +1 -1
@@ -2509,7 +2509,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));
drivers/input/touchscreen/fsl-imx25-tcq.c +1 -1
@@ -507,7 +507,7 @@ static int mx25_tcq_probe(struct platform_device *pdev)struct device *dev = &pdev->dev;struct input_dev *idev;struct mx25_tcq_priv *priv; -struct mx25_tsadc *tsadc =dev_get_drvdata (pdev->dev.parent); +struct mx25_tsadc *tsadc =dev_get_drvdata (dev->parent);struct resource *res;void __iomem *mem;int error;
drivers/input/touchscreen/ili210x.c +1 -1
@@ -280,7 +280,7 @@ static int ili210x_i2c_probe(struct i2c_client *client, goto err_remove_sysfs; } -device_init_wakeup (&client->dev,1 ); +device_init_wakeup (dev,1 ); dev_dbg(dev, "ILI210x initialized (IRQ: %d), firmware version %d.%d.%d",
drivers/input/touchscreen/pixcir_i2c_ts.c +2 -2
@@ -461,7 +461,7 @@ static int pixcir_i2c_ts_probe(struct i2c_client *client,if (error)return error; }else { -dev_err (&client->dev,"platform data not defined\n" ); +dev_err (dev,"platform data not defined\n" );return -EINVAL ; }
@@ -483,7 +483,7 @@ static int pixcir_i2c_ts_probe(struct i2c_client *client, input->id.bustype =BUS_I2C ; input->open = pixcir_input_open; input->close = pixcir_input_close; - input->dev.parent = &client->dev; + input->dev.parent = dev;if (pdata) {input_set_abs_params (input,ABS_MT_POSITION_X ,0 , pdata->x_max,0 ,0 );
drivers/input/touchscreen/rohm_bu21023.c +1 -2
@@ -1189,8 +1189,7 @@ static int rohm_bu21023_i2c_probe(struct i2c_client *client, error =devm_add_action (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; }
drivers/input/touchscreen/s3c2410_ts.c +1 -1
@@ -250,7 +250,7 @@ static int s3c2410ts_probe(struct platform_device *pdev) ts.dev = dev; - info =dev_get_platdata (&pdev->dev); + info =dev_get_platdata (dev);if (!info) {dev_err (dev,"no platform data, cannot attach\n" );return -EINVAL ;
Signature · 1 line
2.7.4
PATCH 9/13 Input: keyboard - drop unnecessary calls to device_init_wakeup
In reply to Guenter RoeckCalling 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\));
...+>
}
--- drivers/input/keyboard/gpio_keys.c | 2 -- drivers/input/keyboard/matrix_keypad.c | 2 -- drivers/input/keyboard/omap4-keypad.c | 3 --- drivers/input/keyboard/samsung-keypad.c | 2 -- drivers/input/keyboard/spear-keyboard.c | 2 -- 5 files changed, 11 deletions(-)
drivers/input/keyboard/gpio_keys.c +0 -2
@@ -829,8 +829,6 @@ static int gpio_keys_remove(struct platform_device *pdev) {sysfs_remove_group (&pdev->dev.kobj, &gpio_keys_attr_group); -device_init_wakeup (&pdev->dev,0 ); -return 0 ; }
drivers/input/keyboard/matrix_keypad.c +0 -2
@@ -545,8 +545,6 @@ static int matrix_keypad_remove(struct platform_device *pdev) {struct matrix_keypad *keypad =platform_get_drvdata (pdev); -device_init_wakeup (&pdev->dev,0 ); -matrix_keypad_free_gpio (keypad);input_unregister_device (keypad->input_dev);kfree (keypad);
drivers/input/keyboard/omap4-keypad.c +0 -3
@@ -375,7 +375,6 @@ static int omap4_keypad_probe(struct platform_device *pdev) err_pm_disable:pm_runtime_disable (&pdev->dev); -device_init_wakeup (&pdev->dev, false);free_irq (keypad_data->irq, keypad_data); err_free_keymap:kfree (keypad_data->keymap);
@@ -401,8 +400,6 @@ static int omap4_keypad_remove(struct platform_device *pdev)pm_runtime_disable (&pdev->dev); -device_init_wakeup (&pdev->dev, false); -input_unregister_device (keypad_data->input);iounmap (keypad_data->base);
drivers/input/keyboard/samsung-keypad.c +0 -2
@@ -445,7 +445,6 @@ static int samsung_keypad_probe(struct platform_device *pdev) err_disable_runtime_pm:pm_runtime_disable (&pdev->dev); -device_init_wakeup (&pdev->dev,0 ); err_unprepare_clk:clk_unprepare (keypad->clk);return error;
@@ -456,7 +455,6 @@ static int samsung_keypad_remove(struct platform_device *pdev)struct samsung_keypad *keypad =platform_get_drvdata (pdev);pm_runtime_disable (&pdev->dev); -device_init_wakeup (&pdev->dev,0 );input_unregister_device (keypad->input_dev);
drivers/input/keyboard/spear-keyboard.c +0 -2
@@ -283,8 +283,6 @@ static int spear_kbd_remove(struct platform_device *pdev)input_unregister_device (kbd->input);clk_unprepare (kbd->clk); -device_init_wakeup (&pdev->dev,0 ); -return 0 ; }
Signature · 1 line
2.7.4
PATCH 10/13 Input: misc - drop unnecessary calls to device_init_wakeup
In reply to Guenter RoeckCalling 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 at pos);
|
struct platform_driver p = {
.probe = probefn at pos,
};
|
struct i2c_driver p = {
.probe = probefn at pos,
};
|
struct spi_driver p = {
.probe = probefn at 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\));
...+>
}
--- drivers/input/misc/88pm80x_onkey.c | 1 - drivers/input/misc/e3x0-button.c | 1 - drivers/input/misc/gp2ap002a00f.c | 2 -- drivers/input/misc/hisi_powerkey.c | 2 -- drivers/input/misc/pm8941-pwrkey.c | 1 - drivers/input/misc/pmic8xxx-pwrkey.c | 2 -- drivers/input/misc/sirfsoc-onkey.c | 2 -- 7 files changed, 11 deletions(-)
drivers/input/misc/88pm80x_onkey.c +0 -1
@@ -143,7 +143,6 @@ static int pm80x_onkey_remove(struct platform_device *pdev) {struct pm80x_onkey_info *info =platform_get_drvdata (pdev); -device_init_wakeup (&pdev->dev,0 );pm80x_free_irq (info->pm80x, info->irq, info);input_unregister_device (info->idev);kfree (info);
drivers/input/misc/e3x0-button.c +0 -1
@@ -126,7 +126,6 @@ static int e3x0_button_probe(struct platform_device *pdev)static int e3x0_button_remove (struct platform_device *pdev) { -device_init_wakeup (&pdev->dev,0 );return 0 ; }
drivers/input/misc/gp2ap002a00f.c +0 -2
@@ -210,8 +210,6 @@ static int gp2a_remove(struct i2c_client *client)struct gp2a_data *dt =i2c_get_clientdata (client);const struct gp2a_platform_data *pdata = dt->pdata; -device_init_wakeup (&client->dev, false); -free_irq (client->irq, dt);input_unregister_device (dt->input);
drivers/input/misc/hisi_powerkey.c +0 -2
@@ -122,8 +122,6 @@ static int hi65xx_powerkey_probe(struct platform_device *pdev)static int hi65xx_powerkey_remove (struct platform_device *pdev) { -device_init_wakeup (&pdev->dev,0 ); -return 0 ; }
drivers/input/misc/pm8941-pwrkey.c +0 -1
@@ -266,7 +266,6 @@ static int pm8941_pwrkey_remove(struct platform_device *pdev) {struct pm8941_pwrkey *pwrkey =platform_get_drvdata (pdev); -device_init_wakeup (&pdev->dev,0 );unregister_reboot_notifier (&pwrkey->reboot_notifier);return 0 ;
drivers/input/misc/pmic8xxx-pwrkey.c +0 -2
@@ -440,8 +440,6 @@ static int pmic8xxx_pwrkey_probe(struct platform_device *pdev)static int pmic8xxx_pwrkey_remove (struct platform_device *pdev) { -device_init_wakeup (&pdev->dev,0 ); -return 0 ; }
drivers/input/misc/sirfsoc-onkey.c +0 -2
@@ -174,8 +174,6 @@ static int sirfsoc_pwrc_probe(struct platform_device *pdev)static int sirfsoc_pwrc_remove (struct platform_device *pdev) { -device_init_wakeup (&pdev->dev,0 ); -return 0 ; }
Signature · 1 line
2.7.4
PATCH 11/13 Input: touchscreen - drop unnecessary calls to device_init_wakeup
In reply to Guenter RoeckCalling 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 at pos);
|
struct platform_driver p = {
.probe = probefn at pos,
};
|
struct i2c_driver p = {
.probe = probefn at pos,
};
|
struct spi_driver p = {
.probe = probefn at 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\));
...+>
}
--- drivers/input/touchscreen/ads7846.c | 2 -- drivers/input/touchscreen/bu21013_ts.c | 2 -- drivers/input/touchscreen/eeti_ts.c | 1 - drivers/input/touchscreen/lpc32xx_ts.c | 1 - drivers/input/touchscreen/st1232.c | 1 - 5 files changed, 7 deletions(-)
drivers/input/touchscreen/ads7846.c +0 -2
@@ -1462,8 +1462,6 @@ static int ads7846_remove(struct spi_device *spi) {struct ads7846 *ts =spi_get_drvdata (spi); -device_init_wakeup (&spi->dev, false); -sysfs_remove_group (&spi->dev.kobj, &ads784x_attr_group);ads7846_disable (ts);
drivers/input/touchscreen/bu21013_ts.c +0 -2
@@ -637,8 +637,6 @@ static int bu21013_remove(struct i2c_client *client)kfree (bu21013_data); -device_init_wakeup (&client->dev, false); -return 0 ; }
drivers/input/touchscreen/eeti_ts.c +0 -1
@@ -231,7 +231,6 @@ static int eeti_ts_probe(struct i2c_client *client,*/ eeti_ts_stop (priv); -device_init_wakeup (&client->dev,0 );return 0 ; err3:
drivers/input/touchscreen/lpc32xx_ts.c +0 -1
@@ -313,7 +313,6 @@ static int lpc32xx_ts_remove(struct platform_device *pdev)struct lpc32xx_tsc *tsc =platform_get_drvdata (pdev);struct resource *res; -device_init_wakeup (&pdev->dev,0 );free_irq (tsc->irq, tsc);input_unregister_device (tsc->dev);
drivers/input/touchscreen/st1232.c +0 -1
@@ -237,7 +237,6 @@ static int st1232_ts_remove(struct i2c_client *client) {struct st1232_ts_data *ts =i2c_get_clientdata (client); -device_init_wakeup (&client->dev,0 );st1232_ts_power (ts, false);return 0 ;
Signature · 1 line
2.7.4
PATCH 12/13 Input: serio - drop unnecessary calls to device_init_wakeup
In reply to Guenter RoeckCalling 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\));
...+>
}
--- drivers/input/serio/hyperv-keyboard.c | 1 - 1 file changed, 1 deletion(-)
drivers/input/serio/hyperv-keyboard.c +0 -1
@@ -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);
Signature · 1 line
2.7.4
PATCH 13/13 Input: misc - drop empty remove functions
In reply to Guenter RoeckEmpty remove functions don't serve a useful purpose and can be removed.
Changes were made using the following coccinelle script.
@remove@
identifier p, removefn;
@@
struct platform_driver p = {
.remove = \(__exit_p(removefn)\|removefn\),
};@rrem depends on remove@
identifier remove.removefn;
@@
- removefn(...) {
- return 0;
- }
@depends on rrem@
identifier remove.p, remove.removefn;
@@
struct platform_driver p = {
- .remove = \(__exit_p(removefn)\|removefn\),
};
--- drivers/input/misc/e3x0-button.c | 6 ------ drivers/input/misc/hisi_powerkey.c | 6 ------ drivers/input/misc/pmic8xxx-pwrkey.c | 6 ------ drivers/input/misc/retu-pwrbutton.c | 6 ------ drivers/input/misc/sirfsoc-onkey.c | 6 ------ 5 files changed, 30 deletions(-)
drivers/input/misc/e3x0-button.c +0 -6
@@ -124,11 +124,6 @@ static int e3x0_button_probe(struct platform_device *pdev)return 0 ; } -static int e3x0_button_remove (struct platform_device *pdev) -{ -return 0 ; -} -#ifdef CONFIG_OF static const struct of_device_id e3x0_button_match[] = { { .compatible = "ettus,e3x0-button", },
@@ -144,7 +139,6 @@ static struct platform_driver e3x0_button_driver = { .pm = &e3x0_button_pm_ops, }, .probe = e3x0_button_probe, - .remove = e3x0_button_remove, };module_platform_driver (e3x0_button_driver);
drivers/input/misc/hisi_powerkey.c +0 -6
@@ -120,17 +120,11 @@ static int hi65xx_powerkey_probe(struct platform_device *pdev)return 0 ; } -static int hi65xx_powerkey_remove (struct platform_device *pdev) -{ -return 0 ; -} -static struct platform_driver hi65xx_powerkey_driver = { .driver = { .name ="hi65xx-powerkey" , }, .probe = hi65xx_powerkey_probe, - .remove = hi65xx_powerkey_remove, };module_platform_driver (hi65xx_powerkey_driver);
drivers/input/misc/pmic8xxx-pwrkey.c +0 -6
@@ -438,11 +438,6 @@ static int pmic8xxx_pwrkey_probe(struct platform_device *pdev)return 0 ; } -static int pmic8xxx_pwrkey_remove (struct platform_device *pdev) -{ -return 0 ; -} -static const struct of_device_id pm8xxx_pwr_key_id_table[] = { { .compatible ="qcom,pm8058-pwrkey" , .data = &pm8058_pwrkey_shutdown }, { .compatible ="qcom,pm8921-pwrkey" , .data = &pm8921_pwrkey_shutdown },
@@ -452,7 +447,6 @@ MODULE_DEVICE_TABLE(of, pm8xxx_pwr_key_id_table);static struct platform_driver pmic8xxx_pwrkey_driver = { .probe = pmic8xxx_pwrkey_probe, - .remove = pmic8xxx_pwrkey_remove, .shutdown = pmic8xxx_pwrkey_shutdown, .driver = { .name ="pm8xxx-pwrkey" ,
drivers/input/misc/retu-pwrbutton.c +0 -6
@@ -76,14 +76,8 @@ static int retu_pwrbutton_probe(struct platform_device *pdev)return 0 ; } -static int retu_pwrbutton_remove (struct platform_device *pdev) -{ -return 0 ; -} -static struct platform_driver retu_pwrbutton_driver = { .probe = retu_pwrbutton_probe, - .remove = retu_pwrbutton_remove, .driver = { .name ="retu-pwrbutton" , },
drivers/input/misc/sirfsoc-onkey.c +0 -6
@@ -172,11 +172,6 @@ static int sirfsoc_pwrc_probe(struct platform_device *pdev)return 0 ; } -static int sirfsoc_pwrc_remove (struct platform_device *pdev) -{ -return 0 ; -} -static int __maybe_unused sirfsoc_pwrc_resume (struct device *dev) {struct sirfsoc_pwrc_drvdata *pwrcdrv =dev_get_drvdata (dev);
@@ -198,7 +193,6 @@ static SIMPLE_DEV_PM_OPS(sirfsoc_pwrc_pm_ops, NULL, sirfsoc_pwrc_resume);static struct platform_driver sirfsoc_pwrc_driver = { .probe = sirfsoc_pwrc_probe, - .remove = sirfsoc_pwrc_remove, .driver = { .name ="sirfsoc-pwrc" , .pm = &sirfsoc_pwrc_pm_ops,
Signature · 1 line
2.7.4
cover Input: Automated coccinelle cleanup (take 2)
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.
This time around, the patches are combined into groups instead of per-file. Each patch has only a single coccinelle rule applied, and only affects a single directory in the input subsystem.
As with the previous patch series, removed calls to platform_set_drvdata() and i2c_set_clientdata() deserve extra scrutiny from reviewers.
The conversion was done automatically with coccinelle using various semantic patches. The semantic patches and the scripts used to generate this commit log are either attached to the commits, or they are available at
https://github.com/groeck/coccinelle-patches.
The series was build tested on kerneltests.org and by the 0day build system.
The patch series is based on v4.10-rc4, with input/next (sha 72d1f2346ded5) merged on top. For convenience, the series is available at:
git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git input-base
----------------------------------------------------------------
Guenter Roeck (13):
Input: keyboard - Drop calls to platform_set_drvdata and i2c_set_clientdata
Input: misc - Drop calls to platform_set_drvdata and i2c_set_clientdata
Input: touchscreen - Drop calls to platform_set_drvdata and i2c_set_clientdata
Input: keyboard - Use local variables consistently
Input: misc - Use local variables consistently
Input: mouse Use local variables consistently
Input: rmi4 - Use local variables consistently
Input: touchscreen - Use local variables consistently
Input: keyboard - drop unnecessary calls to device_init_wakeup
Input: misc - drop unnecessary calls to device_init_wakeup
Input: touchscreen - drop unnecessary calls to device_init_wakeup
Input: serio - drop unnecessary calls to device_init_wakeup
Input: misc - drop empty remove functions
drivers/input/keyboard/adc-keys.c | 2 -- drivers/input/keyboard/cap11xx.c | 1 - drivers/input/keyboard/davinci_keyscan.c | 4 +-- drivers/input/keyboard/gpio_keys.c | 26 +++++++--------- drivers/input/keyboard/gpio_keys_polled.c | 7 ++--- drivers/input/keyboard/jornada680_kbd.c | 2 -- drivers/input/keyboard/matrix_keypad.c | 2 -- drivers/input/keyboard/max7359_keypad.c | 1 - drivers/input/keyboard/mpr121_touchkey.c | 18 +++++------ drivers/input/keyboard/nspire-keypad.c | 2 -- drivers/input/keyboard/omap4-keypad.c | 3 -- drivers/input/keyboard/opencores-kbd.c | 2 -- drivers/input/keyboard/samsung-keypad.c | 2 -- drivers/input/keyboard/spear-keyboard.c | 2 -- drivers/input/keyboard/sun4i-lradc-keys.c | 1 - drivers/input/misc/88pm80x_onkey.c | 1 - drivers/input/misc/arizona-haptics.c | 2 -- drivers/input/misc/atmel_captouch.c | 1 - drivers/input/misc/da9063_onkey.c | 1 - drivers/input/misc/drv260x.c | 2 +- drivers/input/misc/e3x0-button.c | 8 ----- drivers/input/misc/gp2ap002a00f.c | 2 -- drivers/input/misc/gpio_tilt_polled.c | 2 +- drivers/input/misc/hisi_powerkey.c | 17 +++-------- drivers/input/misc/pm8941-pwrkey.c | 1 - drivers/input/misc/pmic8xxx-pwrkey.c | 8 ----- drivers/input/misc/retu-pwrbutton.c | 6 ---- drivers/input/misc/sirfsoc-onkey.c | 8 ----- drivers/input/misc/twl4030-pwrbutton.c | 1 - drivers/input/mouse/alps.c | 2 +- drivers/input/mouse/bcm5974.c | 2 +- drivers/input/mouse/cyapa.c | 6 ++-- drivers/input/mouse/cypress_ps2.c | 4 +-- drivers/input/mouse/elan_i2c_core.c | 46 +++++++++++------------------ drivers/input/mouse/elantech.c | 2 +- drivers/input/mouse/hgpk.c | 5 ++-- drivers/input/mouse/logips2pp.c | 2 +- drivers/input/mouse/trackpoint.c | 4 +-- drivers/input/rmi4/rmi_bus.c | 4 +-- drivers/input/rmi4/rmi_driver.c | 4 +-- drivers/input/serio/hyperv-keyboard.c | 1 - drivers/input/touchscreen/88pm860x-ts.c | 3 -- drivers/input/touchscreen/ads7846.c | 2 -- drivers/input/touchscreen/atmel_mxt_ts.c | 2 +- drivers/input/touchscreen/bu21013_ts.c | 2 -- drivers/input/touchscreen/colibri-vf50-ts.c | 2 -- drivers/input/touchscreen/eeti_ts.c | 1 - drivers/input/touchscreen/egalax_ts.c | 1 - drivers/input/touchscreen/fsl-imx25-tcq.c | 2 +- drivers/input/touchscreen/ili210x.c | 2 +- drivers/input/touchscreen/lpc32xx_ts.c | 1 - drivers/input/touchscreen/max11801_ts.c | 1 - drivers/input/touchscreen/pixcir_i2c_ts.c | 4 +-- drivers/input/touchscreen/rohm_bu21023.c | 3 +- drivers/input/touchscreen/s3c2410_ts.c | 2 +- drivers/input/touchscreen/st1232.c | 1 - drivers/input/touchscreen/sx8654.c | 1 - 57 files changed, 73 insertions(+), 174 deletions(-)
PATCH 2/13 Input: misc - Drop calls to platform_set_drvdata and i2c_set_clientdata
There is no call to i2c_get_clientdata(), platform_get_drvdata(), or dev_get_drvdata() in any of the drivers in this patch. Drop the unnecessary calls to to i2c_set_clientdata() and platform_set_drvdata().
This conversion was done automatically with coccinelle. The semantic patch is available at
https://github.com/groeck/coccinelle-patches/blob/master/common/pdev.cocci
--- drivers/input/misc/arizona-haptics.c | 2 -- drivers/input/misc/atmel_captouch.c | 1 - drivers/input/misc/da9063_onkey.c | 1 - drivers/input/misc/e3x0-button.c | 1 - drivers/input/misc/twl4030-pwrbutton.c | 1 - 5 files changed, 6 deletions(-)
drivers/input/misc/arizona-haptics.c +0 -2
@@ -201,8 +201,6 @@ static int arizona_haptics_probe(struct platform_device *pdev)return ret; } -platform_set_drvdata (pdev, haptics); -return 0 ; }
drivers/input/misc/atmel_captouch.c +0 -1
@@ -191,7 +191,6 @@ static int atmel_captouch_probe(struct i2c_client *client,return -ENOMEM ; capdev->client = client; -i2c_set_clientdata (client, capdev); err =atmel_read (capdev,REG_KEY_STATE , &capdev->prev_btn,sizeof (capdev->prev_btn));
drivers/input/misc/da9063_onkey.c +0 -1
@@ -287,7 +287,6 @@ static int da9063_onkey_probe(struct platform_device *pdev)return error; } -platform_set_drvdata (pdev, onkey);return 0 ; }
drivers/input/misc/e3x0-button.c +0 -1
@@ -120,7 +120,6 @@ static int e3x0_button_probe(struct platform_device *pdev)return error; } -platform_set_drvdata (pdev, input);device_init_wakeup (&pdev->dev,1 );return 0 ; }
drivers/input/misc/twl4030-pwrbutton.c +0 -1
@@ -85,7 +85,6 @@ static int twl4030_pwrbutton_probe(struct platform_device *pdev)return err; } -platform_set_drvdata (pdev, pwr);device_init_wakeup (&pdev->dev, true);return 0 ;
Signature · 1 line
2.7.4
PATCH 4/13 Input: keyboard - Use local variables consistently
In reply to Guenter RoeckIf a function declares a variable to access a structure element, use it conssistently.
The conversion was done automatically with coccinelle using the following semantic patch.
// Catch function parameters.
// Handle those first to trigger reformatting.
@@
identifier d;
identifier fn;
identifier svar;
identifier elem;
type T;
identifier i;
expression e;
identifier fn;
expression list es;
@@
fn(...) {
...
T d = &svar->elem;
<... when != d = e;
- fn(&svar->elem, es)
+ fn(d, es)
...> }
// Now address non-functions and multiple transformations in function // parameters.
@@
identifier d;
identifier fn;
identifier svar;
identifier elem;
type T;
identifier i;
expression e;
@@
fn(...) {
...
T d = &svar->elem;
<... when != d = e;
(
- &svar->elem
+ d
|
- svar->elem.i
+ d->i
)
...> }
--- drivers/input/keyboard/davinci_keyscan.c | 4 ++-- drivers/input/keyboard/gpio_keys.c | 24 +++++++++++------------- drivers/input/keyboard/gpio_keys_polled.c | 6 +++--- drivers/input/keyboard/mpr121_touchkey.c | 18 +++++++++--------- 4 files changed, 25 insertions(+), 27 deletions(-)
drivers/input/keyboard/davinci_keyscan.c +2 -2
@@ -172,7 +172,7 @@ static int __init davinci_ks_probe(struct platform_device *pdev)struct input_dev *key_dev;struct resource *res, *mem;struct device *dev = &pdev->dev; -struct davinci_ks_platform_data *pdata =dev_get_platdata (&pdev->dev); +struct davinci_ks_platform_data *pdata =dev_get_platdata (dev);int error, i;if (pdata->device_enable) {
@@ -255,7 +255,7 @@ static int __init davinci_ks_probe(struct platform_device *pdev) key_dev->name ="davinci_keyscan" ; key_dev->phys ="davinci_keyscan/input0" ; - key_dev->dev.parent = &pdev->dev; + key_dev->dev.parent = dev; key_dev->id.bustype =BUS_HOST ; key_dev->id.vendor =0x0001 ; key_dev->id.product =0x0001 ;
drivers/input/keyboard/gpio_keys.c +11 -13
@@ -514,8 +514,7 @@ static int gpio_keys_setup_key(struct platform_device *pdev,if (button->active_low) flags |=GPIOF_ACTIVE_LOW ; - error =devm_gpio_request_one (&pdev->dev, button->gpio, flags, - desc); + error =devm_gpio_request_one (dev, button->gpio, flags, desc);if (error <0 ) {dev_err (dev,"Failed to request GPIO %d, error %d\n" , button->gpio, error);
@@ -583,10 +582,9 @@ static int gpio_keys_setup_key(struct platform_device *pdev,* Install custom action to cancel release timer and * workqueue item. */ - error =devm_add_action (&pdev->dev, gpio_keys_quiesce_key, bdata); + error =devm_add_action (dev, gpio_keys_quiesce_key, bdata);if (error) { -dev_err (&pdev->dev, -"failed to register quiesce action, error: %d\n" , +dev_err (dev,"failed to register quiesce action, error: %d\n" , error);return error; }
@@ -598,8 +596,8 @@ static int gpio_keys_setup_key(struct platform_device *pdev,if (!button->can_disable) irqflags |=IRQF_SHARED ; - error =devm_request_any_context_irq (&pdev->dev, bdata->irq, - isr, irqflags, desc, bdata); + error =devm_request_any_context_irq (dev, bdata->irq, isr, irqflags, + desc, bdata);if (error <0 ) {dev_err (dev,"Unable to claim irq %d; error %d\n" , bdata->irq, error);
@@ -765,7 +763,7 @@ static int gpio_keys_probe(struct platform_device *pdev) input->name = pdata->name ? : pdev->name; input->phys ="gpio-keys/input0" ; - input->dev.parent = &pdev->dev; + input->dev.parent = dev; input->open = gpio_keys_open; input->close = gpio_keys_close;
@@ -783,9 +781,9 @@ static int gpio_keys_probe(struct platform_device *pdev)struct gpio_button_data *bdata = &ddata->data[i];if (!dev_get_platdata (dev)) { - child =device_get_next_child_node (&pdev->dev, child); + child =device_get_next_child_node (dev, child);if (!child) { -dev_err (&pdev->dev, +dev_err (dev,"missing child device node for entry %d\n" , i);return -EINVAL ;
@@ -804,7 +802,7 @@ static int gpio_keys_probe(struct platform_device *pdev)fwnode_handle_put (child); - error =sysfs_create_group (&pdev->dev.kobj, &gpio_keys_attr_group); + error =sysfs_create_group (&dev->kobj, &gpio_keys_attr_group);if (error) {dev_err (dev,"Unable to export keys/switches, error: %d\n" , error);
@@ -818,12 +816,12 @@ static int gpio_keys_probe(struct platform_device *pdev) goto err_remove_group; } -device_init_wakeup (&pdev->dev, wakeup); +device_init_wakeup (dev, wakeup);return 0 ; err_remove_group: -sysfs_remove_group (&pdev->dev.kobj, &gpio_keys_attr_group); +sysfs_remove_group (&dev->kobj, &gpio_keys_attr_group);return error; }
drivers/input/keyboard/gpio_keys_polled.c +3 -3
@@ -252,13 +252,13 @@ static int gpio_keys_polled_probe(struct platform_device *pdev) size =sizeof (struct gpio_keys_polled_dev ) + pdata->nbuttons *sizeof (struct gpio_keys_button_data ); - bdev =devm_kzalloc (&pdev->dev, size,GFP_KERNEL ); + bdev =devm_kzalloc (dev, size,GFP_KERNEL );if (!bdev) {dev_err (dev,"no memory for private data\n" );return -ENOMEM ; } - poll_dev =devm_input_allocate_polled_device (&pdev->dev); + poll_dev =devm_input_allocate_polled_device (dev);if (!poll_dev) {dev_err (dev,"no memory for polled device\n" );return -ENOMEM ;
@@ -332,7 +332,7 @@ static int gpio_keys_polled_probe(struct platform_device *pdev)if (button->active_low) flags |=GPIOF_ACTIVE_LOW ; - error =devm_gpio_request_one (&pdev->dev, button->gpio, + error =devm_gpio_request_one (dev, button->gpio, flags, button->desc ? :DRV_NAME );if (error) { dev_err(dev,
drivers/input/keyboard/mpr121_touchkey.c +9 -9
@@ -237,7 +237,7 @@ static int mpr_touchkey_probe(struct i2c_client *client,int i;if (!client->irq) { -dev_err (&client->dev,"irq number should not be zero\n" ); +dev_err (dev,"irq number should not be zero\n" );return -EINVAL ; }
@@ -247,11 +247,11 @@ static int mpr_touchkey_probe(struct i2c_client *client, vdd_uv =regulator_get_voltage (vdd_supply); - mpr121 =devm_kzalloc (&client->dev,sizeof (*mpr121),GFP_KERNEL ); + mpr121 =devm_kzalloc (dev,sizeof (*mpr121),GFP_KERNEL );if (!mpr121)return -ENOMEM ; - input_dev =devm_input_allocate_device (&client->dev); + input_dev =devm_input_allocate_device (dev);if (!input_dev)return -ENOMEM ;
@@ -275,7 +275,7 @@ static int mpr_touchkey_probe(struct i2c_client *client, input_dev->name ="Freescale MPR121 Touchkey" ; input_dev->id.bustype =BUS_I2C ; - input_dev->dev.parent = &client->dev; + input_dev->dev.parent = dev;if (device_property_read_bool (dev,"autorepeat" ))__set_bit (EV_REP , input_dev->evbit);input_set_capability (input_dev,EV_MSC ,MSC_SCAN );
@@ -289,16 +289,16 @@ static int mpr_touchkey_probe(struct i2c_client *client, error =mpr121_phys_init (mpr121, client, vdd_uv);if (error) { -dev_err (&client->dev,"Failed to init register\n" ); +dev_err (dev,"Failed to init register\n" );return error; } - error =devm_request_threaded_irq (&client->dev, client->irq, -NULL , mpr_touchkey_interrupt, + error =devm_request_threaded_irq (dev, client->irq,NULL , + mpr_touchkey_interrupt,IRQF_TRIGGER_FALLING |IRQF_ONESHOT , - client->dev.driver->name, mpr121); + dev->driver->name, mpr121);if (error) { -dev_err (&client->dev,"Failed to register interrupt\n" ); +dev_err (dev,"Failed to register interrupt\n" );return error; }
Signature · 1 line
2.7.4
PATCH 5/13 Input: misc - Use local variables consistently
In reply to Guenter RoeckIf a function declares a variable to access a structure element, use it conssistently.
The conversion was done automatically with coccinelle using the following semantic patch.
// Catch function parameters.
// Handle those first to trigger reformatting.
@@
identifier d;
identifier fn;
identifier svar;
identifier elem;
type T;
identifier i;
expression e;
identifier fn;
expression list es;
@@
fn(...) {
...
T d = &svar->elem;
<... when != d = e;
- fn(&svar->elem, es)
+ fn(d, es)
...> }
// Now address non-functions and multiple transformations in function // parameters.
@@
identifier d;
identifier fn;
identifier svar;
identifier elem;
type T;
identifier i;
expression e;
@@
fn(...) {
...
T d = &svar->elem;
<... when != d = e;
(
- &svar->elem
+ d
|
- svar->elem.i
+ d->i
)
...> }
--- drivers/input/misc/drv260x.c | 2 +- drivers/input/misc/gpio_tilt_polled.c | 2 +- drivers/input/misc/hisi_powerkey.c | 9 ++++----- 3 files changed, 6 insertions(+), 7 deletions(-)
drivers/input/misc/drv260x.c +1 -1
@@ -538,7 +538,7 @@ static int drv260x_probe(struct i2c_client *client, haptics->input_dev =devm_input_allocate_device (dev);if (!haptics->input_dev) { -dev_err (&client->dev,"Failed to allocate input device\n" ); +dev_err (dev,"Failed to allocate input device\n" );return -ENOMEM ; }
drivers/input/misc/gpio_tilt_polled.c +1 -1
@@ -138,7 +138,7 @@ static int gpio_tilt_polled_probe(struct platform_device *pdev) input->name = pdev->name; input->phys =DRV_NAME "/input0" ; - input->dev.parent = &pdev->dev; + input->dev.parent = dev; input->id.bustype =BUS_HOST ; input->id.vendor =0x0001 ;
drivers/input/misc/hisi_powerkey.c +4 -5
@@ -75,9 +75,9 @@ static int hi65xx_powerkey_probe(struct platform_device *pdev)struct input_dev *input;int irq, i, error; - input =devm_input_allocate_device (&pdev->dev); + input =devm_input_allocate_device (dev);if (!input) { -dev_err (&pdev->dev,"failed to allocate input device\n" ); +dev_err (dev,"failed to allocate input device\n" );return -ENOMEM ; }
@@ -111,12 +111,11 @@ static int hi65xx_powerkey_probe(struct platform_device *pdev) error =input_register_device (input);if (error) { -dev_err (&pdev->dev,"failed to register input device: %d\n" , - error); +dev_err (dev,"failed to register input device: %d\n" , error);return error; } -device_init_wakeup (&pdev->dev,1 ); +device_init_wakeup (dev,1 );return 0 ; }
Signature · 1 line
2.7.4
PATCH 6/13 Input: mouse Use local variables consistently
In reply to Guenter RoeckIf a function declares a variable to access a structure element, use it conssistently.
The conversion was done automatically with coccinelle using the following semantic patch.
// Catch function parameters.
// Handle those first to trigger reformatting.
@@
identifier d;
identifier fn;
identifier svar;
identifier elem;
type T;
identifier i;
expression e;
identifier fn;
expression list es;
@@
fn(...) {
...
T d = &svar->elem;
<... when != d = e;
- fn(&svar->elem, es)
+ fn(d, es)
...> }
// Now address non-functions and multiple transformations in function // parameters.
@@
identifier d;
identifier fn;
identifier svar;
identifier elem;
type T;
identifier i;
expression e;
@@
fn(...) {
...
T d = &svar->elem;
<... when != d = e;
(
- &svar->elem
+ d
|
- svar->elem.i
+ d->i
)
...> }
--- drivers/input/mouse/alps.c | 2 +- drivers/input/mouse/bcm5974.c | 2 +- drivers/input/mouse/cyapa.c | 6 ++--- drivers/input/mouse/cypress_ps2.c | 4 ++-- drivers/input/mouse/elan_i2c_core.c | 46 +++++++++++++++---------------------- drivers/input/mouse/elantech.c | 2 +- drivers/input/mouse/hgpk.c | 5 ++-- drivers/input/mouse/logips2pp.c | 2 +- drivers/input/mouse/trackpoint.c | 4 ++-- 9 files changed, 31 insertions(+), 42 deletions(-)
drivers/input/mouse/alps.c +1 -1
@@ -1855,7 +1855,7 @@ static int alps_absolute_mode_v1_v2(struct psmouse *psmouse)* Switch mouse to poll (remote) mode so motion data will not * get in our way */ -return ps2_command (&psmouse->ps2dev,NULL ,PSMOUSE_CMD_SETPOLL ); +return ps2_command (ps2dev,NULL ,PSMOUSE_CMD_SETPOLL ); }static int alps_monitor_mode_send_word (struct psmouse *psmouse,u16 word)
drivers/input/mouse/bcm5974.c +1 -1
@@ -665,7 +665,7 @@ static int bcm5974_wellspring_mode(struct bcm5974 *dev, bool on)char *data;/* Type 3 does not require a mode switch */ -if (dev->cfg.tp_type ==TYPE3 ) +if (c->tp_type ==TYPE3 )return 0 ; data =kmalloc (c->um_size,GFP_KERNEL );
drivers/input/mouse/cyapa.c +3 -3
@@ -832,8 +832,8 @@ static int cyapa_prepare_wakeup_controls(struct cyapa *cyapa)int error;if (device_can_wakeup (dev)) { - error =sysfs_merge_group (&client->dev.kobj, - &cyapa_power_wakeup_group); + error =sysfs_merge_group (&dev->kobj, + &cyapa_power_wakeup_group);if (error) {dev_err (dev,"failed to add power wakeup group: %d\n" , error);
@@ -1312,7 +1312,7 @@ static int cyapa_probe(struct i2c_client *client,return error; } - error =sysfs_create_group (&client->dev.kobj, &cyapa_sysfs_group); + error =sysfs_create_group (&dev->kobj, &cyapa_sysfs_group);if (error) {dev_err (dev,"failed to create sysfs entries: %d\n" , error);return error;
drivers/input/mouse/cypress_ps2.c +2 -2
@@ -107,7 +107,7 @@ static int cypress_ps2_read_cmd_status(struct psmouse *psmouse,enum psmouse_state old_state;int pktsize; -ps2_begin_command (&psmouse->ps2dev); +ps2_begin_command (ps2dev); old_state = psmouse->state; psmouse->state =PSMOUSE_CMD_MODE ;
@@ -133,7 +133,7 @@ static int cypress_ps2_read_cmd_status(struct psmouse *psmouse, psmouse->state = old_state; psmouse->pktcnt =0 ; -ps2_end_command (&psmouse->ps2dev); +ps2_end_command (ps2dev);return rc; }
drivers/input/mouse/elan_i2c_core.c +18 -28
115 lines not on this page · raw message
drivers/input/mouse/elantech.c +1 -1
@@ -1412,7 +1412,7 @@ int elantech_detect(struct psmouse *psmouse, bool set_properties)struct ps2dev *ps2dev = &psmouse->ps2dev;unsigned char param[3 ]; -ps2_command (&psmouse->ps2dev,NULL ,PSMOUSE_CMD_RESET_DIS ); +ps2_command (ps2dev,NULL ,PSMOUSE_CMD_RESET_DIS ); if (ps2_command(ps2dev, NULL, PSMOUSE_CMD_DISABLE) || ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11) ||
drivers/input/mouse/hgpk.c +2 -3
@@ -713,8 +713,7 @@ static int hgpk_toggle_powersave(struct psmouse *psmouse, int enable)* the upper bound. (in practice, it takes about 3 loops.) */ for (timeo =20 ; timeo >0 ; timeo--) { -if (!ps2_sendbyte (&psmouse->ps2dev, -PSMOUSE_CMD_DISABLE ,20 )) +if (!ps2_sendbyte (ps2dev,PSMOUSE_CMD_DISABLE ,20 ))break ;msleep (25 ); }
@@ -740,7 +739,7 @@ static int hgpk_toggle_powersave(struct psmouse *psmouse, int enable)psmouse_set_state (psmouse,PSMOUSE_IGNORE );/* probably won't see an ACK, the touchpad will be off */ -ps2_sendbyte (&psmouse->ps2dev,0xec ,20 ); +ps2_sendbyte (ps2dev,0xec ,20 ); }return 0 ;
drivers/input/mouse/logips2pp.c +1 -1
@@ -402,7 +402,7 @@ int ps2pp_detect(struct psmouse *psmouse, bool set_properties) psmouse->set_resolution = ps2pp_set_resolution; psmouse->disconnect = ps2pp_disconnect; - error =device_create_file (&psmouse->ps2dev.serio->dev, + error =device_create_file (&ps2dev->serio->dev, &psmouse_attr_smartscroll.dattr);if (error) { psmouse_err(psmouse,
drivers/input/mouse/trackpoint.c +2 -2
@@ -379,7 +379,7 @@ int trackpoint_detect(struct psmouse *psmouse, bool set_properties)if (!set_properties)return 0 ; -if (trackpoint_read (&psmouse->ps2dev,TP_EXT_BTN , &button_info)) { +if (trackpoint_read (ps2dev,TP_EXT_BTN , &button_info)) {psmouse_warn (psmouse,"failed to get extended button data\n" ); button_info =0 ; }
@@ -402,7 +402,7 @@ int trackpoint_detect(struct psmouse *psmouse, bool set_properties)trackpoint_defaults (psmouse->private); - error =trackpoint_power_on_reset (&psmouse->ps2dev); + error =trackpoint_power_on_reset (ps2dev);/* Write defaults to TP only if reset fails. */ if (error)
Signature · 1 line
2.7.4
PATCH 7/13 Input: rmi4 - Use local variables consistently
In reply to Guenter RoeckIf a function declares a variable to access a structure element, use it conssistently.
The conversion was done automatically with coccinelle using the following semantic patch.
// Catch function parameters.
// Handle those first to trigger reformatting.
@@
identifier d;
identifier fn;
identifier svar;
identifier elem;
type T;
identifier i;
expression e;
identifier fn;
expression list es;
@@
fn(...) {
...
T d = &svar->elem;
<... when != d = e;
- fn(&svar->elem, es)
+ fn(d, es)
...> }
// Now address non-functions and multiple transformations in function // parameters.
@@
identifier d;
identifier fn;
identifier svar;
identifier elem;
type T;
identifier i;
expression e;
@@
fn(...) {
...
T d = &svar->elem;
<... when != d = e;
(
- &svar->elem
+ d
|
- svar->elem.i
+ d->i
)
...> }
--- drivers/input/rmi4/rmi_bus.c | 4 ++-- drivers/input/rmi4/rmi_driver.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/input/rmi4/rmi_bus.c +2 -2
@@ -261,10 +261,10 @@ int __rmi_register_function_handler(struct rmi_function_handler *handler, driver->probe = rmi_function_probe; driver->remove = rmi_function_remove; - error =driver_register (&handler->driver); + error =driver_register (driver);if (error) {pr_err ("driver_register() failed for %s, error: %d\n" , - handler->driver.name, error); + driver->name, error);return error; }
drivers/input/rmi4/rmi_driver.c +2 -2
@@ -836,7 +836,7 @@ static int rmi_create_function(struct rmi_device *rmi_dev, void *ctx, const struct pdt_entry *pdt) { struct device *dev = &rmi_dev->dev; -struct rmi_driver_data *data =dev_get_drvdata (&rmi_dev->dev); +struct rmi_driver_data *data =dev_get_drvdata (dev);int *current_irq_count = ctx;struct rmi_function *fn;int i;
@@ -1040,7 +1040,7 @@ int rmi_probe_interrupts(struct rmi_driver_data *data) }if (data->bootloader_mode) -dev_warn (&rmi_dev->dev,"Device in bootloader mode.\n" ); +dev_warn (dev,"Device in bootloader mode.\n" ); data->irq_count = irq_count; data->num_of_irq_regs = (data->irq_count +7 ) /8 ;
Signature · 1 line
2.7.4
Dmitry Torokhov
maintainerQuoted 22 lines · 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.
This time around, the patches are combined into groups instead of per-file. Each patch has only a single coccinelle rule applied, and only affects a single directory in the input subsystem.
As with the previous patch series, removed calls to
platform_set_drvdata()andi2c_set_clientdata()deserve extra scrutiny from reviewers.The conversion was done automatically with coccinelle using various semantic patches. The semantic patches and the scripts used to generate this commit log are either attached to the commits, or they are available at
https://github.com/groeck/coccinelle-patches.The series was build tested on kerneltests.org and by the 0day build system.
The patch series is based on v4.10-rc4, with input/next (sha
72d1f2346ded5) merged on top. For convenience, the series is available at:
git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.gitinput-base
Quoted 15 lines
----------------------------------------------------------------
Guenter Roeck (13):
Input: keyboard - Drop calls toplatform_set_drvdataandi2c_set_clientdata
Input: misc - Drop calls toplatform_set_drvdataandi2c_set_clientdata
Input: touchscreen - Drop calls toplatform_set_drvdataandi2c_set_clientdata
Input: keyboard - Use local variables consistently
Input: misc - Use local variables consistently
Input: mouse Use local variables consistently
Input: rmi4 - Use local variables consistently
Input: touchscreen - Use local variables consistently
Input: keyboard - drop unnecessary calls todevice_init_wakeup
Input: misc - drop unnecessary calls todevice_init_wakeup
Input: touchscreen - drop unnecessary calls todevice_init_wakeup
Input: serio - drop unnecessary calls todevice_init_wakeup
Input: misc - drop empty remove functions
Applied the lot, thank you.
Signature · 1 line
Dmitry
Re: [PATCH 04/13] Input: keyboard - Use local variables consistently
In reply to Guenter RoeckQuoted 2 lines · Guenter Roeck
If a function declares a variable to access a structure element, use it conssistently.
Weird spelling :)
drivers/input/keyboard/gpio_keys.c static int gpio_keys_setup_key(struct platform_device *pdev, · line 517
Quoted 5 lines
Signed-off-by Guenter Roeck <[email protected]>drivers/input/keyboard/gpio_keys.c +1
-2- error =devm_gpio_request_one (&pdev->dev, button->gpio, flags, - desc); + error =devm_gpio_request_one (dev, button->gpio, flags, desc);
I think I have changes in the GPIO tree touching these code sites.
I put those on an immutable branch so Dmitry can pull it if he needs it as a base for this patch:
https://git.kernel.org/cgit/linux/kernel/git/linusw/linux-gpio.git/commit/?h=ib-gpiod-flags
Yours,
Linus Walleij
Re: [PATCH 04/13] Input: keyboard - Use local variables consistently
Quoted 7 lines · Linus Walleij
Quoted 2 lines · Guenter Roeck
If a function declares a variable to access a structure element, use it conssistently.
Weird spelling :)
Call id sssnaky :-)
Guenter
Quoted 15 lines
drivers/input/keyboard/gpio_keys.c static int gpio_keys_setup_key(struct platform_device *pdev, · line 517
Quoted 5 lines
Signed-off-by Guenter Roeck <[email protected]>drivers/input/keyboard/gpio_keys.c +1
-2- error =devm_gpio_request_one (&pdev->dev, button->gpio, flags, - desc); + error =devm_gpio_request_one (dev, button->gpio, flags, desc);I think I have changes in the GPIO tree touching these code sites.
I put those on an immutable branch so Dmitry can pull it if he needs it as a base for this patch:
https://git.kernel.org/cgit/linux/kernel/git/linusw/linux-gpio.git/commit/?h=ib-gpiod-flagsYours,
Linus Walleij
Dmitry Torokhov
maintainerRe: [PATCH 04/13] Input: keyboard - Use local variables consistently
In reply to Linus WalleijQuoted 13 lines · Linus Walleij
Quoted 2 lines · Guenter Roeck
If a function declares a variable to access a structure element, use it conssistently.
Weird spelling :)
drivers/input/keyboard/gpio_keys.c static int gpio_keys_setup_key(struct platform_device *pdev, · line 517
Quoted 5 lines
Signed-off-by Guenter Roeck <[email protected]>drivers/input/keyboard/gpio_keys.c +1
-2- error =devm_gpio_request_one (&pdev->dev, button->gpio, flags, - desc); + error =devm_gpio_request_one (dev, button->gpio, flags, desc);
Quoted 5 lines
I think I have changes in the GPIO tree touching these code sites.
I put those on an immutable branch so Dmitry can pull it if he needs it as a base for this patch:
https://git.kernel.org/cgit/linux/kernel/git/linusw/linux-gpio.git/commit/?h=ib-gpiod-flags
I just tried it and it seems to merge cleanly even on top of Guenter's patch so I think I do not have to pull it in, not yet at least.
Thanks.
Signature · 1 line
Dmitry