Commit 060403f3 authored by Nick Dyer's avatar Nick Dyer Committed by Dmitry Torokhov

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 36a44af5.
Signed-off-by: default avatarNick Dyer <nick@shmanahar.org>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 2a924d71
...@@ -570,14 +570,19 @@ static int rmi_f01_probe(struct rmi_function *fn) ...@@ -570,14 +570,19 @@ static int rmi_f01_probe(struct rmi_function *fn)
dev_set_drvdata(&fn->dev, f01); dev_set_drvdata(&fn->dev, f01);
error = devm_device_add_group(&fn->rmi_dev->dev, &rmi_f01_attr_group); error = sysfs_create_group(&fn->rmi_dev->dev.kobj, &rmi_f01_attr_group);
if (error) if (error)
dev_warn(&fn->dev, dev_warn(&fn->dev, "Failed to create sysfs group: %d\n", error);
"Failed to create attribute group: %d\n", error);
return 0; return 0;
} }
static void rmi_f01_remove(struct rmi_function *fn)
{
/* Note that the bus device is used, not the F01 device */
sysfs_remove_group(&fn->rmi_dev->dev.kobj, &rmi_f01_attr_group);
}
static int rmi_f01_config(struct rmi_function *fn) static int rmi_f01_config(struct rmi_function *fn)
{ {
struct f01_data *f01 = dev_get_drvdata(&fn->dev); struct f01_data *f01 = dev_get_drvdata(&fn->dev);
...@@ -717,6 +722,7 @@ struct rmi_function_handler rmi_f01_handler = { ...@@ -717,6 +722,7 @@ struct rmi_function_handler rmi_f01_handler = {
}, },
.func = 0x01, .func = 0x01,
.probe = rmi_f01_probe, .probe = rmi_f01_probe,
.remove = rmi_f01_remove,
.config = rmi_f01_config, .config = rmi_f01_config,
.attention = rmi_f01_attention, .attention = rmi_f01_attention,
.suspend = rmi_f01_suspend, .suspend = rmi_f01_suspend,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment