aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Dyer <nick@shmanahar.org>2018-01-24 16:46:04 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2018-01-24 17:44:05 -0500
commit060403f34008af90e310d7e0e7531ebb3acf9557 (patch)
treef8e0180ce46a84aad4e3892ad894e947cd65df20
parent2a924d71794c530e55e73d0ce2cc77233307eaa9 (diff)
Revert "Input: synaptics_rmi4 - use devm_device_add_group() for attributes in F01"
Since the sysfs attribute hangs off the RMI bus, which doesn't go away during firmware flash, it needs to be explicitly removed, otherwise we would try and register the same attribute twice. This reverts commit 36a44af5c176d619552d99697433261141dd1296. Signed-off-by: Nick Dyer <nick@shmanahar.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-rw-r--r--drivers/input/rmi4/rmi_f01.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/input/rmi4/rmi_f01.c b/drivers/input/rmi4/rmi_f01.c
index ae966e333a2f..8a07ae147df6 100644
--- a/drivers/input/rmi4/rmi_f01.c
+++ b/drivers/input/rmi4/rmi_f01.c
@@ -570,14 +570,19 @@ static int rmi_f01_probe(struct rmi_function *fn)
570 570
571 dev_set_drvdata(&fn->dev, f01); 571 dev_set_drvdata(&fn->dev, f01);
572 572
573 error = devm_device_add_group(&fn->rmi_dev->dev, &rmi_f01_attr_group); 573 error = sysfs_create_group(&fn->rmi_dev->dev.kobj, &rmi_f01_attr_group);
574 if (error) 574 if (error)
575 dev_warn(&fn->dev, 575 dev_warn(&fn->dev, "Failed to create sysfs group: %d\n", error);
576 "Failed to create attribute group: %d\n", error);
577 576
578 return 0; 577 return 0;
579} 578}
580 579
580static void rmi_f01_remove(struct rmi_function *fn)
581{
582 /* Note that the bus device is used, not the F01 device */
583 sysfs_remove_group(&fn->rmi_dev->dev.kobj, &rmi_f01_attr_group);
584}
585
581static int rmi_f01_config(struct rmi_function *fn) 586static int rmi_f01_config(struct rmi_function *fn)
582{ 587{
583 struct f01_data *f01 = dev_get_drvdata(&fn->dev); 588 struct f01_data *f01 = dev_get_drvdata(&fn->dev);
@@ -717,6 +722,7 @@ struct rmi_function_handler rmi_f01_handler = {
717 }, 722 },
718 .func = 0x01, 723 .func = 0x01,
719 .probe = rmi_f01_probe, 724 .probe = rmi_f01_probe,
725 .remove = rmi_f01_remove,
720 .config = rmi_f01_config, 726 .config = rmi_f01_config,
721 .attention = rmi_f01_attention, 727 .attention = rmi_f01_attention,
722 .suspend = rmi_f01_suspend, 728 .suspend = rmi_f01_suspend,