Skip to content

Commit 060403f

Browse files
ndyerdtor
authored andcommitted
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 36a44af. Signed-off-by: Nick Dyer <nick@shmanahar.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent 2a924d7 commit 060403f

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

drivers/input/rmi4/rmi_f01.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -570,14 +570,19 @@ static int rmi_f01_probe(struct rmi_function *fn)
570570

571571
dev_set_drvdata(&fn->dev, f01);
572572

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);
574574
if (error)
575-
dev_warn(&fn->dev,
576-
"Failed to create attribute group: %d\n", error);
575+
dev_warn(&fn->dev, "Failed to create sysfs group: %d\n", error);
577576

578577
return 0;
579578
}
580579

580+
static 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+
581586
static int rmi_f01_config(struct rmi_function *fn)
582587
{
583588
struct f01_data *f01 = dev_get_drvdata(&fn->dev);
@@ -717,6 +722,7 @@ struct rmi_function_handler rmi_f01_handler = {
717722
},
718723
.func = 0x01,
719724
.probe = rmi_f01_probe,
725+
.remove = rmi_f01_remove,
720726
.config = rmi_f01_config,
721727
.attention = rmi_f01_attention,
722728
.suspend = rmi_f01_suspend,

0 commit comments

Comments
 (0)