Input: ili210x - switch to using devm_device_add_group()
Subsystems (2)
Dmitry Torokhov
maintainerPATCH 1/1 Input: ili210x - switch to using devm_device_add_group()
By switching to devm_device_add_group() we can complete driver conversion to using managed resources and get rid of ili210x_i2c_remove().
Signed-off-by Dmitry Torokhov <[email protected]>
--- drivers/input/touchscreen/ili210x.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-)
drivers/input/touchscreen/ili210x.c +2 -14
@@ -376,7 +376,7 @@ static int ili210x_i2c_probe(struct i2c_client *client,return error; } - error =sysfs_create_group (&dev->kobj, &ili210x_attr_group); + error =devm_device_add_group (dev, &ili210x_attr_group);if (error) {dev_err (dev,"Unable to create sysfs attributes, err: %d\n" , error);
@@ -386,7 +386,7 @@ static int ili210x_i2c_probe(struct i2c_client *client, error =input_register_device (priv->input);if (error) {dev_err (dev,"Cannot register input device, err: %d\n" , error); - goto err_remove_sysfs; +return error; }device_init_wakeup (dev,1 );
@@ -396,17 +396,6 @@ static int ili210x_i2c_probe(struct i2c_client *client, client->irq, firmware.id, firmware.major, firmware.minor);return 0 ; - -err_remove_sysfs: -sysfs_remove_group (&dev->kobj, &ili210x_attr_group); -return error; -} - -static int ili210x_i2c_remove (struct i2c_client *client) -{ -sysfs_remove_group (&client->dev.kobj, &ili210x_attr_group); - -return 0 ; }static int __maybe_unused ili210x_i2c_suspend (struct device *dev)
@@ -454,7 +443,6 @@ static struct i2c_driver ili210x_ts_driver = { }, .id_table = ili210x_i2c_id, .probe = ili210x_i2c_probe, - .remove = ili210x_i2c_remove, };module_i2c_driver (ili210x_ts_driver);
Signature · 5 lines
2.20.1.611.gfbb209baf1-goog -- Dmitry
Quoted 50 lines · Dmitry Torokhov
By switching to
devm_device_add_group()we can complete driver conversion to using managed resources and get rid ofili210x_i2c_remove().Signed-off-by Dmitry Torokhov <[email protected]>--- drivers/input/touchscreen/ili210x.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-)drivers/input/touchscreen/ili210x.c +2
-13@@ -376,7 +376,7 @@ static int ili210x_i2c_probe(struct i2c_client *client,return error; } - error =sysfs_create_group (&dev->kobj, &ili210x_attr_group); + error =devm_device_add_group (dev, &ili210x_attr_group);if (error) {dev_err (dev,"Unable to create sysfs attributes, err: %d\n" , error);@@ -386,7 +386,7 @@ static int ili210x_i2c_probe(struct i2c_client *client, error =input_register_device (priv->input);if (error) {dev_err (dev,"Cannot register input device, err: %d\n" , error); - goto err_remove_sysfs; +return error; }device_init_wakeup (dev,1 );@@ -396,17 +396,6 @@ static int ili210x_i2c_probe(struct i2c_client *client, client->irq, firmware.id, firmware.major, firmware.minor);return 0 ; - -err_remove_sysfs: -sysfs_remove_group (&dev->kobj, &ili210x_attr_group); -return error; -} - -static int ili210x_i2c_remove (struct i2c_client *client) -{ -sysfs_remove_group (&client->dev.kobj, &ili210x_attr_group); - -return 0 ; }static int __maybe_unused ili210x_i2c_suspend (struct device *dev)
drivers/input/touchscreen/ili210x.c static struct i2c_driver ili210x_ts_driver = { · line 448
Quoted 7 lines
drivers/input/touchscreen/ili210x.c +0
-1@@ -454,7 +443,6 @@ static struct i2c_driver ili210x_ts_driver = { }, .id_table = ili210x_i2c_id, .probe = ili210x_i2c_probe, - .remove = ili210x_i2c_remove, };module_i2c_driver (ili210x_ts_driver);
Reviewed-by Marek Vasut <[email protected]>
On ILI251x
Tested-by Marek Vasut <[email protected]>
Signature · 2 lines
Best regards, Marek Vasut