Skip to content

Commit 36a44af

Browse files
dtorgregkh
authored andcommitted
Input: synaptics_rmi4 - use devm_device_add_group() for attributes in F01
Now that we have proper managed API to create device attributes, let's start using it instead of the manual unwinding. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 3184125 commit 36a44af

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

drivers/input/rmi4/rmi_f01.c

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

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

573-
error = sysfs_create_group(&fn->rmi_dev->dev.kobj, &rmi_f01_attr_group);
573+
error = devm_device_add_group(&fn->rmi_dev->dev, &rmi_f01_attr_group);
574574
if (error)
575-
dev_warn(&fn->dev, "Failed to create sysfs group: %d\n", error);
575+
dev_warn(&fn->dev,
576+
"Failed to create attribute group: %d\n", error);
576577

577578
return 0;
578579
}
579580

580-
static void rmi_f01_remove(struct rmi_function *fn)
581-
{
582-
sysfs_remove_group(&fn->rmi_dev->dev.kobj, &rmi_f01_attr_group);
583-
}
584-
585581
static int rmi_f01_config(struct rmi_function *fn)
586582
{
587583
struct f01_data *f01 = dev_get_drvdata(&fn->dev);
@@ -721,7 +717,6 @@ struct rmi_function_handler rmi_f01_handler = {
721717
},
722718
.func = 0x01,
723719
.probe = rmi_f01_probe,
724-
.remove = rmi_f01_remove,
725720
.config = rmi_f01_config,
726721
.attention = rmi_f01_attention,
727722
.suspend = rmi_f01_suspend,

0 commit comments

Comments
 (0)