aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2019-02-07 01:19:42 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2019-02-08 02:40:53 -0500
commit576057bf75cb3e40ff81bb01f021d76b764fdc92 (patch)
tree45b0b03f8e80a75a23a271a214ebcf2860080f23 /drivers/input
parent4958891764749304ac1511f6140ae3888c088e23 (diff)
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 <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/touchscreen/ili210x.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/drivers/input/touchscreen/ili210x.c b/drivers/input/touchscreen/ili210x.c
index 6cfe463ac118..af1dd9cff12a 100644
--- a/drivers/input/touchscreen/ili210x.c
+++ b/drivers/input/touchscreen/ili210x.c
@@ -376,7 +376,7 @@ static int ili210x_i2c_probe(struct i2c_client *client,
376 return error; 376 return error;
377 } 377 }
378 378
379 error = sysfs_create_group(&dev->kobj, &ili210x_attr_group); 379 error = devm_device_add_group(dev, &ili210x_attr_group);
380 if (error) { 380 if (error) {
381 dev_err(dev, "Unable to create sysfs attributes, err: %d\n", 381 dev_err(dev, "Unable to create sysfs attributes, err: %d\n",
382 error); 382 error);
@@ -386,7 +386,7 @@ static int ili210x_i2c_probe(struct i2c_client *client,
386 error = input_register_device(priv->input); 386 error = input_register_device(priv->input);
387 if (error) { 387 if (error) {
388 dev_err(dev, "Cannot register input device, err: %d\n", error); 388 dev_err(dev, "Cannot register input device, err: %d\n", error);
389 goto err_remove_sysfs; 389 return error;
390 } 390 }
391 391
392 device_init_wakeup(dev, 1); 392 device_init_wakeup(dev, 1);
@@ -396,17 +396,6 @@ static int ili210x_i2c_probe(struct i2c_client *client,
396 client->irq, firmware.id, firmware.major, firmware.minor); 396 client->irq, firmware.id, firmware.major, firmware.minor);
397 397
398 return 0; 398 return 0;
399
400err_remove_sysfs:
401 sysfs_remove_group(&dev->kobj, &ili210x_attr_group);
402 return error;
403}
404
405static int ili210x_i2c_remove(struct i2c_client *client)
406{
407 sysfs_remove_group(&client->dev.kobj, &ili210x_attr_group);
408
409 return 0;
410} 399}
411 400
412static int __maybe_unused ili210x_i2c_suspend(struct device *dev) 401static int __maybe_unused ili210x_i2c_suspend(struct device *dev)
@@ -454,7 +443,6 @@ static struct i2c_driver ili210x_ts_driver = {
454 }, 443 },
455 .id_table = ili210x_i2c_id, 444 .id_table = ili210x_i2c_id,
456 .probe = ili210x_i2c_probe, 445 .probe = ili210x_i2c_probe,
457 .remove = ili210x_i2c_remove,
458}; 446};
459 447
460module_i2c_driver(ili210x_ts_driver); 448module_i2c_driver(ili210x_ts_driver);